Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
p0dyakov committed Dec 17, 2022
1 parent 71de48b commit 5a48fc9
Show file tree
Hide file tree
Showing 74 changed files with 193 additions and 1,078 deletions.
14 changes: 1 addition & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
# 📸 Simple photo editor made on Flutter
<img src="https://user-images.githubusercontent.com/80569772/206533164-c64a7f1b-d101-4d79-8bc3-f2d0f577d100.gif" alt="drawing" width="300"/>

## Screenshots
<p align="left" width="100%">
<img src="https://user-images.githubusercontent.com/80569772/206534198-300a0ac4-11f5-4fe9-ab8e-17ceaa435492.png" width="24%"/>
<img src="https://user-images.githubusercontent.com/80569772/206534314-7100d183-c6dc-4b09-9a1f-6470260e05cb.png" width="24%"/>
<img src="https://user-images.githubusercontent.com/80569772/206534258-b4c0f859-7267-42eb-8259-2c573673e3a2.png" width="24%"/>
<img src="https://user-images.githubusercontent.com/80569772/206534360-d6f985dd-11b0-4dd9-856f-a6b587dd5926.png" width="24%"/>
</p>
# 📸 Shop

## Stack
- flutter
- dart
- stream_bloc
- bitmap
- photo_manager
- gallery_saver
- freezed
- auto_route
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.photo_editor"
applicationId "com.example.shop"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 21
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="https://schemas.android.com/apk/res/android"
package="com.example.photo_editor">
package="com.example.shop">
<uses-permission android:name="android.permission.ACCESS_FILE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
Expand Down
4 changes: 2 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<manifest xmlns:android="https://schemas.android.com/apk/res/android" package="com.example.photo_editor" xmlns:tools="https://schemas.android.com/tools">
<manifest xmlns:android="https://schemas.android.com/apk/res/android" package="com.example.shop" xmlns:tools="https://schemas.android.com/tools">
<uses-permission android:name="android.permission.ACCESS_FILE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-sdk tools:overrideLibrary="io.github.edufolly.flutterbluetoothserial"/>
<application
android:label="Photo Editor"
android:label="Shop"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon">
<activity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.photo_editor
package com.example.shop

import io.flutter.embedding.android.FlutterActivity

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="https://schemas.android.com/apk/res/android"
package="com.example.photo_editor">
package="com.example.shop">
<uses-permission android:name="android.permission.ACCESS_FILE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
Expand Down
6 changes: 3 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:photo_editor/runner_stub.dart'
if (dart.library.io) 'package:photo_editor/runner_io.dart'
if (dart.library.html) 'package:photo_editor/runner_web.dart' as runner;
import 'package:shop/runner_stub.dart'
if (dart.library.io) 'package:shop/runner_io.dart'
if (dart.library.html) 'package:shop/runner_web.dart' as runner;

void main() => runner.run();
4 changes: 2 additions & 2 deletions lib/runner_io.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:photo_editor/runner_shared.dart' as runner;
import 'package:photo_editor/src/feature/app/logic/main_runner.dart';
import 'package:shop/runner_shared.dart' as runner;
import 'package:shop/src/feature/app/logic/main_runner.dart';

class IoInitializationHooks extends InitializationHooks {
const IoInitializationHooks();
Expand Down
6 changes: 3 additions & 3 deletions lib/runner_shared.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:photo_editor/src/feature/app/logic/main_runner.dart';
import 'package:photo_editor/src/feature/app/photo_editor_app.dart';
import 'package:shop/src/feature/app/logic/main_runner.dart';
import 'package:shop/src/feature/app/shop_app.dart';

void sharedRun(InitializationHooks initializationHooks) => MainRunner.run(
appBuilder: (initializationData) => PhotoEditorApp(
appBuilder: (initializationData) => ShopApp(
initializationData: initializationData,
),
hooks: initializationHooks,
Expand Down
2 changes: 1 addition & 1 deletion lib/runner_stub.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import 'package:photo_editor/src/core/error/unknown_host_platform_error.dart';
import 'package:shop/src/core/error/unknown_host_platform_error.dart';

void run() => throw UnknownHostPlatformError();
4 changes: 2 additions & 2 deletions lib/runner_web.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:photo_editor/runner_shared.dart' as runner;
import 'package:photo_editor/src/feature/app/logic/main_runner.dart';
import 'package:shop/runner_shared.dart' as runner;
import 'package:shop/src/feature/app/logic/main_runner.dart';

class WebInitializationHooks extends InitializationHooks {
const WebInitializationHooks();
Expand Down
10 changes: 5 additions & 5 deletions lib/src/core/database/drift/app_database.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:drift/drift.dart';
import 'package:photo_editor/src/core/database/drift/connection/open_connection_stub.dart'
if (dart.library.io) 'package:photo_editor/src/core/database/drift/connection/open_connection_io.dart'
if (dart.library.html) 'package:photo_editor/src/core/database/drift/connection/open_connection_web.dart'
import 'package:shop/src/core/database/drift/connection/open_connection_stub.dart'
if (dart.library.io) 'package:shop/src/core/database/drift/connection/open_connection_io.dart'
if (dart.library.html) 'package:shop/src/core/database/drift/connection/open_connection_web.dart'
as connection;
import 'package:photo_editor/src/core/database/drift/tables.dart';
import 'package:photo_editor/src/core/model/message.dart';
import 'package:shop/src/core/database/drift/tables.dart';
import 'package:shop/src/core/model/message.dart';

part 'app_database.g.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:drift/drift.dart';
import 'package:photo_editor/src/core/error/unknown_host_platform_error.dart';
import 'package:shop/src/core/error/unknown_host_platform_error.dart';

QueryExecutor openConnection(String name) => throw UnknownHostPlatformError();
2 changes: 1 addition & 1 deletion lib/src/core/database/drift/tables.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:drift/drift.dart';
import 'package:photo_editor/src/core/model/message.dart';
import 'package:shop/src/core/model/message.dart';

@UseRowClass(Message)
class Messages extends Table {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ mixin _LoggerMixin on BaseSharedPreferencesDao {
}

mixin _KeyImplementationMixin on BaseSharedPreferencesDao {
late final String _fullNamespace = 'photo_editor.$_name';
late final String _fullNamespace = 'shop.$_name';
late final F1<String, String> _memoizedKey = _key.memoize();

String _key(String name) => '$_fullNamespace.$name';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:photo_editor/src/core/database/shared_preferences/shared_preferences_dao.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:shop/src/core/database/shared_preferences/shared_preferences_dao.dart';

part 'preferences_entries.dart';

Expand Down
14 changes: 7 additions & 7 deletions lib/src/core/extension/src/build_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
// ignore: depend_on_referenced_packages
import 'package:flutter_gen/gen_l10n/app_localizations.g.dart';
import 'package:photo_editor/src/core/database/drift/app_database.dart';
import 'package:photo_editor/src/core/model/dependencies_storage.dart';
import 'package:photo_editor/src/core/model/environment_storage.dart';
import 'package:photo_editor/src/core/model/repository_storage.dart';
import 'package:photo_editor/src/core/widget/dependencies_scope.dart';
import 'package:photo_editor/src/core/widget/environment_scope.dart';
import 'package:photo_editor/src/core/widget/repository_scope.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:shop/src/core/database/drift/app_database.dart';
import 'package:shop/src/core/model/dependencies_storage.dart';
import 'package:shop/src/core/model/environment_storage.dart';
import 'package:shop/src/core/model/repository_storage.dart';
import 'package:shop/src/core/widget/dependencies_scope.dart';
import 'package:shop/src/core/widget/environment_scope.dart';
import 'package:shop/src/core/widget/repository_scope.dart';

extension BuildContextX on BuildContext {
IEnvironmentStorage get environment => EnvironmentScope.of(this);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/l10n/app_en.arb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"appTitle": "Photo Editor"
"appTitle": "Shop"
}
2 changes: 1 addition & 1 deletion lib/src/core/l10n/app_ru.arb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"appTitle": "Photo Editor"
"appTitle": "Shop"
}
2 changes: 1 addition & 1 deletion lib/src/core/model/dependencies_storage.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:dio/dio.dart';
import 'package:photo_editor/src/core/database/drift/app_database.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:shop/src/core/database/drift/app_database.dart';

abstract class IDependenciesStorage {
Dio get dio;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/model/environment_storage.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:photo_editor/src/core/enum/environment.dart';
import 'package:shop/src/core/enum/environment.dart';

abstract class IEnvironmentStorage {
Environment get environment;
Expand Down
22 changes: 8 additions & 14 deletions lib/src/core/model/repository_storage.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import 'package:photo_editor/src/core/database/drift/app_database.dart';
import 'package:photo_editor/src/feature/editor/repository/editor_repository.dart';
import 'package:photo_editor/src/feature/editor/repository/editor_repository_interface.dart';
import 'package:photo_editor/src/feature/gallery/repository/gallery_repository.dart';
import 'package:photo_editor/src/feature/gallery/repository/gallery_repository_interface.dart';
import 'package:photo_editor/src/feature/settings/database/settings_dao.dart';
import 'package:photo_editor/src/feature/settings/repository/settings_repository.dart';
import 'package:photo_editor/src/feature/settings/repository/settings_repository_interface.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:shop/src/core/database/drift/app_database.dart';
import 'package:shop/src/feature/settings/database/settings_dao.dart';
import 'package:shop/src/feature/settings/repository/settings_repository.dart';
import 'package:shop/src/feature/settings/repository/settings_repository_interface.dart';
import 'package:shop/src/feature/shop/repository/shop_repository.dart';
import 'package:shop/src/feature/shop/repository/shop_repository_interface.dart';

abstract class IRepositoryStorage {
ISettingsRepository get settings;
IGalleryRepository get gallery;
IEditorRepository get editor;
IShopRepository get shop;
}

class RepositoryStorage implements IRepositoryStorage {
Expand All @@ -30,8 +27,5 @@ class RepositoryStorage implements IRepositoryStorage {
);

@override
IEditorRepository get editor => EditorRepository();

@override
IGalleryRepository get gallery => GalleryRepository();
IShopRepository get shop => ShopRepository();
}
2 changes: 1 addition & 1 deletion lib/src/core/resource/theme/light_theme.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:photo_editor/src/core/resource/theme/sizes.dart';
import 'package:shop/src/core/resource/theme/sizes.dart';

final appLightTheme = ThemeData(
backgroundColor: const Color(0xFFF8F7FA),
Expand Down
7 changes: 2 additions & 5 deletions lib/src/core/router/app_router.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:photo_editor/src/feature/editor/page/editor_page.dart';
import 'package:photo_editor/src/feature/gallery/page/gallery_page.dart';
import 'package:photo_manager/photo_manager.dart';
import 'package:shop/src/feature/shop/page/shop_page.dart';

part 'app_router.gr.dart';

@CustomAutoRouter(
transitionsBuilder: TransitionsBuilders.slideLeft,
replaceInRouteName: 'Page,Route',
routes: [
AutoRoute<void>(page: GalleryPage, path: '/gallery', initial: true),
AutoRoute<void>(page: EditorPage, path: '/editor'),
AutoRoute<void>(page: ShopPage, path: '/shop', initial: true),
],
)
class AppRouter extends _$AppRouter {}
2 changes: 1 addition & 1 deletion lib/src/core/widget/center_text.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:photo_editor/src/core/resource/theme/sizes.dart';
import 'package:shop/src/core/resource/theme/sizes.dart';

class CenterText extends StatelessWidget {
const CenterText({
Expand Down
4 changes: 2 additions & 2 deletions lib/src/core/widget/dependencies_scope.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:photo_editor/src/core/model/dependencies_storage.dart';
import 'package:photo_editor/src/core/widget/scope.dart';
import 'package:shop/src/core/model/dependencies_storage.dart';
import 'package:shop/src/core/widget/scope.dart';

class DependenciesScope extends Scope {
static const DelegateAccess<_DependenciesScopeDelegate> _delegateOf =
Expand Down
4 changes: 2 additions & 2 deletions lib/src/core/widget/environment_scope.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:photo_editor/src/core/model/environment_storage.dart';
import 'package:photo_editor/src/core/widget/scope.dart';
import 'package:shop/src/core/model/environment_storage.dart';
import 'package:shop/src/core/widget/scope.dart';

class EnvironmentScope extends Scope {
static const DelegateAccess<_EnvironmentScopeDelegate> _delegateOf =
Expand Down
4 changes: 2 additions & 2 deletions lib/src/core/widget/repository_scope.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:photo_editor/src/core/model/repository_storage.dart';
import 'package:photo_editor/src/core/widget/scope.dart';
import 'package:shop/src/core/model/repository_storage.dart';
import 'package:shop/src/core/widget/scope.dart';

class RepositoryScope extends Scope {
static const DelegateAccess<_RepositoryScopeDelegate> _delegateOf =
Expand Down
6 changes: 3 additions & 3 deletions lib/src/feature/app/bloc/initialization_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'dart:async';

import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:photo_editor/src/core/extension/extensions.dart';
import 'package:photo_editor/src/core/model/environment_storage.dart';
import 'package:photo_editor/src/feature/app/logic/error_tracking_manager.dart';
import 'package:pure/pure.dart';
import 'package:select_annotation/select_annotation.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:shop/src/core/extension/extensions.dart';
import 'package:shop/src/core/model/environment_storage.dart';
import 'package:shop/src/feature/app/logic/error_tracking_manager.dart';
import 'package:stream_bloc/stream_bloc.dart';

part 'initialization_bloc.freezed.dart';
Expand Down
12 changes: 6 additions & 6 deletions lib/src/feature/app/logic/main_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:photo_editor/src/core/extension/extensions.dart';
import 'package:photo_editor/src/core/model/environment_storage.dart';
import 'package:photo_editor/src/feature/app/bloc/app_bloc_observer.dart';
import 'package:photo_editor/src/feature/app/bloc/initialization_bloc.dart';
import 'package:photo_editor/src/feature/app/logic/error_tracking_manager.dart';
import 'package:photo_editor/src/feature/app/logic/logger.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:shop/src/core/extension/extensions.dart';
import 'package:shop/src/core/model/environment_storage.dart';
import 'package:shop/src/feature/app/bloc/app_bloc_observer.dart';
import 'package:shop/src/feature/app/bloc/initialization_bloc.dart';
import 'package:shop/src/feature/app/logic/error_tracking_manager.dart';
import 'package:shop/src/feature/app/logic/logger.dart';
import 'package:stream_bloc/stream_bloc.dart';
import 'package:stream_transform/stream_transform.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import 'package:flutter/material.dart';
import 'package:photo_editor/src/core/model/dependencies_storage.dart';
import 'package:photo_editor/src/core/model/repository_storage.dart';
import 'package:photo_editor/src/core/widget/dependencies_scope.dart';
import 'package:photo_editor/src/core/widget/environment_scope.dart';
import 'package:photo_editor/src/core/widget/repository_scope.dart';
import 'package:photo_editor/src/feature/app/bloc/initialization_bloc.dart';
import 'package:photo_editor/src/feature/app/widget/app_configuration.dart';
import 'package:photo_editor/src/feature/app/widget/app_lifecycle_scope.dart';
import 'package:photo_editor/src/feature/settings/widget/scope/settings_scope.dart';
import 'package:pure/pure.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:shop/src/core/model/dependencies_storage.dart';
import 'package:shop/src/core/model/repository_storage.dart';
import 'package:shop/src/core/widget/dependencies_scope.dart';
import 'package:shop/src/core/widget/environment_scope.dart';
import 'package:shop/src/core/widget/repository_scope.dart';
import 'package:shop/src/feature/app/bloc/initialization_bloc.dart';
import 'package:shop/src/feature/app/widget/app_configuration.dart';
import 'package:shop/src/feature/app/widget/app_lifecycle_scope.dart';
import 'package:shop/src/feature/settings/widget/scope/settings_scope.dart';

class PhotoEditorApp extends StatelessWidget {
class ShopApp extends StatelessWidget {
final InitializationData initializationData;

const PhotoEditorApp({
const ShopApp({
Key? key,
required this.initializationData,
}) : super(key: key);
Expand All @@ -29,7 +29,7 @@ class PhotoEditorApp extends StatelessWidget {
errorTrackingDisabler: initializationData.errorTrackingDisabler,
child: DependenciesScope(
create: (context) => DependenciesStorage(
databaseName: 'photo_editor_database',
databaseName: 'shop_database',
sharedPreferences: _sharedPreferences,
),
child: RepositoryScope(
Expand Down
8 changes: 4 additions & 4 deletions lib/src/feature/app/widget/app_configuration.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.g.dart';
import 'package:photo_editor/src/core/extension/extensions.dart';
import 'package:photo_editor/src/core/resource/theme/light_theme.dart';
import 'package:photo_editor/src/core/router/app_router.dart';
import 'package:photo_editor/src/feature/app/widget/app_router_builder.dart';
import 'package:shop/src/core/extension/extensions.dart';
import 'package:shop/src/core/resource/theme/light_theme.dart';
import 'package:shop/src/core/router/app_router.dart';
import 'package:shop/src/feature/app/widget/app_router_builder.dart';

class AppConfiguration extends StatelessWidget {
const AppConfiguration({
Expand Down
4 changes: 2 additions & 2 deletions lib/src/feature/app/widget/app_lifecycle_scope.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:photo_editor/src/core/widget/scope.dart';
import 'package:photo_editor/src/feature/app/logic/error_tracking_manager.dart';
import 'package:shop/src/core/widget/scope.dart';
import 'package:shop/src/feature/app/logic/error_tracking_manager.dart';

class AppLifecycleScope extends Scope {
static const DelegateAccess<_AppLifecycleScopeDelegate> _delegateOf =
Expand Down
Loading

0 comments on commit 5a48fc9

Please sign in to comment.