From d0c255d50d1ff4ed04a99acb9faf48050ea701f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20de=20Le=C3=B3n?= Date: Tue, 14 May 2024 11:22:14 -0300 Subject: [PATCH] feat: added hive to template (#196) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nicolás Lantean --- .fvm/fvm_config.json | 4 - .fvmrc | 3 + .gitignore | 4 +- lib/core/common/config.dart | 3 + lib/core/di/app_providers_module.dart | 4 - lib/core/di/di_repository_module.dart | 6 +- lib/core/model/db/repository_db_entity.dart | 21 --- .../model/serializer/project_serializer.dart | 38 ---- lib/core/repository/project_repository.dart | 11 +- lib/core/repository/session_repository.dart | 6 +- lib/core/source/common/app_database.dart | 19 -- lib/core/source/common/app_database.g.dart | 167 ------------------ lib/core/source/common/hive_base_source.dart | 95 ++++++++++ lib/core/source/common/local_storage.dart | 17 ++ lib/core/source/project_local_source.dart | 46 ++--- lib/main.dart | 2 + pubspec.lock | 96 ++-------- pubspec.yaml | 5 +- 18 files changed, 164 insertions(+), 383 deletions(-) delete mode 100644 .fvm/fvm_config.json create mode 100644 .fvmrc delete mode 100644 lib/core/model/db/repository_db_entity.dart delete mode 100644 lib/core/model/serializer/project_serializer.dart delete mode 100644 lib/core/source/common/app_database.dart delete mode 100644 lib/core/source/common/app_database.g.dart create mode 100644 lib/core/source/common/hive_base_source.dart create mode 100644 lib/core/source/common/local_storage.dart diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json deleted file mode 100644 index d8abe1b9..00000000 --- a/.fvm/fvm_config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "flutterSdkVersion": "3.13.9", - "flavors": {} -} \ No newline at end of file diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 00000000..05b430ce --- /dev/null +++ b/.fvmrc @@ -0,0 +1,3 @@ +{ + "flutter": "3.13.9" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 16d80ab4..2bc6cea4 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,7 @@ mason-lock.json # The .vscode folder contains launch configuration and tasks you configure in # VS Code which you may wish to be included in version control, so this line # is commented out by default. -#.vscode/ +.vscode/settings.json # Flutter/Dart/Pub related **/doc/api/ @@ -54,7 +54,7 @@ app.*.map.json *.env.default # Fvm -.fvm/flutter_sdk +.fvm/ # fastlane specific **/fastlane/report.xml diff --git a/lib/core/common/config.dart b/lib/core/common/config.dart index 98aa3228..8ac036d9 100644 --- a/lib/core/common/config.dart +++ b/lib/core/common/config.dart @@ -7,6 +7,7 @@ import 'package:flutter_template/core/common/environments.dart'; import 'package:flutter_template/core/common/extension/string_extensions.dart'; import 'package:flutter_template/core/common/helper/enum_helpers.dart'; import 'package:flutter_template/core/common/helper/env_helper.dart'; +import 'package:path_provider/path_provider.dart'; interface class Config { static const String environmentFolder = 'environments'; @@ -15,6 +16,7 @@ interface class Config { static late String apiBaseUrl; static late String supabaseApiKey; + static late String appDirectoryPath; static final _environment = enumFromString( Environments.values, @@ -25,6 +27,7 @@ interface class Config { static Future initialize() async { await _EnvConfig._setupEnv(_environment); _initializeEnvVariables(); + appDirectoryPath = (await getApplicationDocumentsDirectory()).path; } static void _initializeEnvVariables() { diff --git a/lib/core/di/app_providers_module.dart b/lib/core/di/app_providers_module.dart index 3d2f8597..39928f2d 100644 --- a/lib/core/di/app_providers_module.dart +++ b/lib/core/di/app_providers_module.dart @@ -1,5 +1,4 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart'; -import 'package:flutter_template/core/source/common/app_database.dart'; import 'package:get_it/get_it.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_template/core/source/common/local_shared_preferences_storage.dart'; @@ -20,9 +19,6 @@ class AppProvidersModule { extension _GetItDiModuleExtensions on GetIt { void _setupModule() { - registerSingletonAsync( - () => $FloorAppDatabase.databaseBuilder('app_database.db').build(), - ); registerLazySingleton(FlutterSecureStorage.new); registerSingletonAsync(() => SharedPreferences.getInstance()); diff --git a/lib/core/di/di_repository_module.dart b/lib/core/di/di_repository_module.dart index a16ca042..e7e07f2c 100644 --- a/lib/core/di/di_repository_module.dart +++ b/lib/core/di/di_repository_module.dart @@ -2,9 +2,9 @@ import 'package:flutter_template/core/repository/project_repository.dart'; import 'package:flutter_template/core/repository/session_repository.dart'; import 'package:flutter_template/core/source/auth_local_source.dart'; import 'package:flutter_template/core/source/auth_remote_source.dart'; -import 'package:flutter_template/core/source/common/app_database.dart'; import 'package:flutter_template/core/source/common/auth_interceptor.dart'; import 'package:flutter_template/core/source/common/http_service.dart'; +import 'package:flutter_template/core/source/project_local_source.dart'; import 'package:flutter_template/core/source/project_remote_source.dart'; import 'package:get_it/get_it.dart'; @@ -30,14 +30,14 @@ extension _GetItDiModuleExtensions on GetIt { } void _setupRepositories() { - registerLazySingleton(() => SessionRepository(get(), get(), get())); + registerLazySingleton(() => SessionRepository(get(), get())); registerLazySingleton(() => ProjectRepository(get(), get())); } void _setupSources() { registerLazySingleton(() => AuthLocalSource(get())); registerLazySingleton(() => AuthRemoteSource(get())); - registerLazySingleton(() => get().projectLocalSource); + registerLazySingleton(() => ProjectLocalSource()); registerLazySingleton(() => ProjectRemoteSource(get())); } } diff --git a/lib/core/model/db/repository_db_entity.dart b/lib/core/model/db/repository_db_entity.dart deleted file mode 100644 index c82b94be..00000000 --- a/lib/core/model/db/repository_db_entity.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:floor/floor.dart'; - -@Entity(tableName: 'projects') -class ProjectDbEntity { - @primaryKey - final int id; - final String name; - final String description; - final String url; - final String imageUrl; - final String language; - - ProjectDbEntity({ - required this.id, - required this.name, - required this.description, - required this.url, - required this.imageUrl, - required this.language, - }); -} diff --git a/lib/core/model/serializer/project_serializer.dart b/lib/core/model/serializer/project_serializer.dart deleted file mode 100644 index 2a0dd94f..00000000 --- a/lib/core/model/serializer/project_serializer.dart +++ /dev/null @@ -1,38 +0,0 @@ -import 'package:flutter_template/core/model/db/repository_db_entity.dart'; -import 'package:flutter_template/core/model/project.dart'; -import 'package:stock/stock.dart'; - -class ProjectStockTypeMapper extends StockTypeMapper { - @override - ProjectDbEntity fromOutput(Project value) => ProjectDbEntity( - id: value.id, - description: value.description, - name: value.name, - url: value.url, - language: value.language, - imageUrl: value.imageUrl, - ); - - @override - Project fromInput(ProjectDbEntity value) => Project( - id: value.id, - description: value.description, - name: value.name, - url: value.url, - language: value.language, - imageUrl: value.imageUrl, - ); -} - -class ProjectListStockTypeMapper - extends StockTypeMapper, List> { - final _projectSerializer = ProjectStockTypeMapper(); - - @override - List fromInput(List value) => - value.map(_projectSerializer.fromInput).toList(); - - @override - List fromOutput(List value) => - value.map(_projectSerializer.fromOutput).toList(); -} diff --git a/lib/core/repository/project_repository.dart b/lib/core/repository/project_repository.dart index 0fc38a7b..ba97a627 100644 --- a/lib/core/repository/project_repository.dart +++ b/lib/core/repository/project_repository.dart @@ -1,6 +1,4 @@ -import 'package:flutter_template/core/model/db/repository_db_entity.dart'; import 'package:flutter_template/core/model/project.dart'; -import 'package:flutter_template/core/model/serializer/project_serializer.dart'; import 'package:flutter_template/core/source/project_local_source.dart'; import 'package:flutter_template/core/source/project_remote_source.dart'; import 'package:stock/stock.dart'; @@ -19,10 +17,11 @@ class ProjectRepository { fetcher: Fetcher.ofFuture( (_) => _projectRemoteSource.getProjects(), ), - sourceOfTruth: SourceOfTruth>( - reader: (_) => _projectLocalSource.getProjects(), - writer: (_, value) => _projectLocalSource.replaceProjects(value), - ).mapToUsingMapper(ProjectListStockTypeMapper()), + sourceOfTruth: SourceOfTruth>( + reader: (_) => _projectLocalSource.getElementsStream(), + writer: (_, value) => + _projectLocalSource.replaceProjects(value ?? []), + ), ); Stream?> getProjects() => _store diff --git a/lib/core/repository/session_repository.dart b/lib/core/repository/session_repository.dart index dee2c7e8..89af8f78 100644 --- a/lib/core/repository/session_repository.dart +++ b/lib/core/repository/session_repository.dart @@ -4,15 +4,13 @@ import 'package:flutter_template/core/model/authentication_status.dart'; import 'package:flutter_template/core/model/user.dart'; import 'package:flutter_template/core/source/auth_local_source.dart'; import 'package:flutter_template/core/source/auth_remote_source.dart'; -import 'package:flutter_template/core/source/common/app_database.dart'; +import 'package:hive/hive.dart'; class SessionRepository { final AuthLocalSource _authLocalSource; final AuthRemoteSource _authRemoteSource; - final AppDatabase _appDataBase; SessionRepository( - this._appDataBase, this._authLocalSource, this._authRemoteSource, ); @@ -36,7 +34,7 @@ class SessionRepository { } Future logOut() async { - await _appDataBase.clearAllTables(); + await Hive.deleteFromDisk(); await _authLocalSource.saveUserToken(null); await _authLocalSource.saveUserInfo(null); } diff --git a/lib/core/source/common/app_database.dart b/lib/core/source/common/app_database.dart deleted file mode 100644 index 46f1d740..00000000 --- a/lib/core/source/common/app_database.dart +++ /dev/null @@ -1,19 +0,0 @@ -// database.dart - -import 'dart:async'; - -import 'package:floor/floor.dart'; -import 'package:flutter_template/core/model/db/repository_db_entity.dart'; -import 'package:flutter_template/core/source/project_local_source.dart'; -import 'package:sqflite/sqflite.dart' as sqflite; - -part 'app_database.g.dart'; - -@Database(version: 1, entities: [ProjectDbEntity]) -abstract class AppDatabase extends FloorDatabase { - ProjectLocalSource get projectLocalSource; - - Future clearAllTables() async { - await database.delete('projects'); - } -} diff --git a/lib/core/source/common/app_database.g.dart b/lib/core/source/common/app_database.g.dart deleted file mode 100644 index b842747f..00000000 --- a/lib/core/source/common/app_database.g.dart +++ /dev/null @@ -1,167 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'app_database.dart'; - -// ************************************************************************** -// FloorGenerator -// ************************************************************************** - -// ignore: avoid_classes_with_only_static_members -class $FloorAppDatabase { - /// Creates a database builder for a persistent database. - /// Once a database is built, you should keep a reference to it and re-use it. - static _$AppDatabaseBuilder databaseBuilder(String name) => - _$AppDatabaseBuilder(name); - - /// Creates a database builder for an in memory database. - /// Information stored in an in memory database disappears when the process is killed. - /// Once a database is built, you should keep a reference to it and re-use it. - static _$AppDatabaseBuilder inMemoryDatabaseBuilder() => - _$AppDatabaseBuilder(null); -} - -class _$AppDatabaseBuilder { - _$AppDatabaseBuilder(this.name); - - final String? name; - - final List _migrations = []; - - Callback? _callback; - - /// Adds migrations to the builder. - _$AppDatabaseBuilder addMigrations(List migrations) { - _migrations.addAll(migrations); - return this; - } - - /// Adds a database [Callback] to the builder. - _$AppDatabaseBuilder addCallback(Callback callback) { - _callback = callback; - return this; - } - - /// Creates the database and initializes it. - Future build() async { - final path = name != null - ? await sqfliteDatabaseFactory.getDatabasePath(name!) - : ':memory:'; - final database = _$AppDatabase(); - database.database = await database.open( - path, - _migrations, - _callback, - ); - return database; - } -} - -class _$AppDatabase extends AppDatabase { - _$AppDatabase([StreamController? listener]) { - changeListener = listener ?? StreamController.broadcast(); - } - - ProjectLocalSource? _projectLocalSourceInstance; - - Future open( - String path, - List migrations, [ - Callback? callback, - ]) async { - final databaseOptions = sqflite.OpenDatabaseOptions( - version: 1, - onConfigure: (database) async { - await database.execute('PRAGMA foreign_keys = ON'); - await callback?.onConfigure?.call(database); - }, - onOpen: (database) async { - await callback?.onOpen?.call(database); - }, - onUpgrade: (database, startVersion, endVersion) async { - await MigrationAdapter.runMigrations( - database, startVersion, endVersion, migrations); - - await callback?.onUpgrade?.call(database, startVersion, endVersion); - }, - onCreate: (database, version) async { - await database.execute( - 'CREATE TABLE IF NOT EXISTS `projects` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, `description` TEXT NOT NULL, `url` TEXT NOT NULL, `imageUrl` TEXT NOT NULL, `language` TEXT NOT NULL, PRIMARY KEY (`id`))'); - - await callback?.onCreate?.call(database, version); - }, - ); - return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); - } - - @override - ProjectLocalSource get projectLocalSource { - return _projectLocalSourceInstance ??= - _$ProjectLocalSource(database, changeListener); - } -} - -class _$ProjectLocalSource extends ProjectLocalSource { - _$ProjectLocalSource( - this.database, - this.changeListener, - ) : _queryAdapter = QueryAdapter(database, changeListener), - _projectDbEntityInsertionAdapter = InsertionAdapter( - database, - 'projects', - (ProjectDbEntity item) => { - 'id': item.id, - 'name': item.name, - 'description': item.description, - 'url': item.url, - 'imageUrl': item.imageUrl, - 'language': item.language - }, - changeListener); - - final sqflite.DatabaseExecutor database; - - final StreamController changeListener; - - final QueryAdapter _queryAdapter; - - final InsertionAdapter _projectDbEntityInsertionAdapter; - - @override - Stream> getProjects() { - return _queryAdapter.queryListStream('SELECT * FROM projects', - mapper: (Map row) => ProjectDbEntity( - id: row['id'] as int, - name: row['name'] as String, - description: row['description'] as String, - url: row['url'] as String, - imageUrl: row['imageUrl'] as String, - language: row['language'] as String), - queryableName: 'projects', - isView: false); - } - - @override - Future deleteAllProjects() async { - await _queryAdapter.queryNoReturn('DELETE FROM projects'); - } - - @override - Future insertProjects(List projects) async { - await _projectDbEntityInsertionAdapter.insertList( - projects, OnConflictStrategy.replace); - } - - @override - Future replaceProjects(List? projects) async { - if (database is sqflite.Transaction) { - await super.replaceProjects(projects); - } else { - await (database as sqflite.Database) - .transaction((transaction) async { - final transactionDatabase = _$AppDatabase(changeListener) - ..database = transaction; - await transactionDatabase.projectLocalSource.replaceProjects(projects); - }); - } - } -} diff --git a/lib/core/source/common/hive_base_source.dart b/lib/core/source/common/hive_base_source.dart new file mode 100644 index 00000000..d53dac68 --- /dev/null +++ b/lib/core/source/common/hive_base_source.dart @@ -0,0 +1,95 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:dartx/dartx.dart'; +import 'package:flutter_template/core/source/common/local_storage.dart'; +import 'package:hive/hive.dart'; +import 'package:mutex/mutex.dart'; +import 'package:rxdart/rxdart.dart'; + +abstract class HiveBaseSource implements LocalStorage { + final Map Function(Model) dbParser; + final Model Function(Map) modelParser; + final Mutex _mutex = Mutex(); + Box? _box; + + HiveBaseSource({required this.dbParser, required this.modelParser}); + + Future> getBox() async => _mutex.protect(() async { + if (_box != null && _box!.isOpen) { + return _box!; + } else { + _box = await Hive.openBox(Model.toString()); + return _box!; + } + }); + + Future withBox(Future Function(Box) body) async => + body(await getBox()); + + @override + Future putElement( + Key key, + Model response, + ) async => + withBox((box) async { + await box.put( + key, + jsonEncode(dbParser(response)), + ); + return response; + }); + + @override + Future> putAllElements(Map entries) => + withBox((box) async { + await box.putAll( + entries.mapValues( + (entry) => jsonEncode(dbParser(entry.value)), + ), + ); + return getElements(); + }); + + @override + Future deleteElement(Key key) => withBox((box) => box.delete(key)); + + @override + Future deleteAllElements() => withBox((box) => box.clear()); + + @override + Future getElement( + Key key, + ) => + withBox((box) async { + final data = box.get(key); + return data == null ? null : modelParser(jsonDecode(data)); + }); + + @override + Stream getElementStream( + Key key, + ) async* { + final box = await getBox(); + yield await getElement(key); + yield* box.watch(key: key).map( + (event) => modelParser(jsonDecode(event.value)), + ); + } + + @override + Future> getElements() => withBox( + (box) => Future.value( + box.values.map((e) => modelParser(jsonDecode(e))).toList(), + ), + ); + + @override + Stream> getElementsStream() async* { + final box = await getBox(); + yield await getElements(); + yield* box.watch().flatMap( + (event) => Stream.fromFuture(getElements()), + ); + } +} diff --git a/lib/core/source/common/local_storage.dart b/lib/core/source/common/local_storage.dart new file mode 100644 index 00000000..1090625d --- /dev/null +++ b/lib/core/source/common/local_storage.dart @@ -0,0 +1,17 @@ +abstract interface class LocalStorage { + Future putElement(Key key, Model response); + + Future> putAllElements(Map entries); + + Future deleteElement(Key key); + + Future deleteAllElements(); + + Future getElement(Key key); + + Stream getElementStream(Key key); + + Future> getElements(); + + Stream> getElementsStream(); +} diff --git a/lib/core/source/project_local_source.dart b/lib/core/source/project_local_source.dart index c0452abd..76aabb70 100644 --- a/lib/core/source/project_local_source.dart +++ b/lib/core/source/project_local_source.dart @@ -1,33 +1,21 @@ -import 'dart:async'; +import 'package:flutter_template/core/model/project.dart'; +import 'package:flutter_template/core/source/common/hive_base_source.dart'; -import 'package:floor/floor.dart'; -import 'package:flutter_template/core/model/db/repository_db_entity.dart'; +class ProjectLocalSource extends HiveBaseSource { + ProjectLocalSource() + : super( + dbParser: (project) => project.toJson(), + modelParser: (project) => Project.fromJson(project), + ); -@dao -abstract class ProjectLocalSource { - // It's set in the DAO creation - late final StreamController changeListener; - - @Query('SELECT * FROM projects') - Stream> getProjects(); - - @Insert(onConflict: OnConflictStrategy.replace) - Future insertProjects(List projects); - - @Query('DELETE FROM projects') - Future deleteAllProjects(); - - @transaction - Future replaceProjects(List? projects) async { - await deleteAllProjects(); - if (projects != null) { - await insertProjects(projects); - } - // Floor notifier does not work very well - // https://github.com/pinchbv/floor/issues/360 - // https://github.com/pinchbv/floor/issues/603 - if (projects == null || projects.isEmpty) { - changeListener.add('projects'); - } + Future> replaceProjects(List elements) async { + await deleteAllElements(); + return putAllElements( + Map.fromEntries( + elements.map( + (e) => MapEntry(e.id, e), + ), + ), + ); } } diff --git a/lib/main.dart b/lib/main.dart index 53aa58bd..811b101e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -7,6 +7,7 @@ import 'package:flutter_template/core/common/config.dart'; import 'package:flutter_template/core/common/logger.dart'; import 'package:flutter_template/core/di/di_provider.dart'; import 'package:flutter_template/ui/main/main_screen.dart'; +import 'package:hive/hive.dart'; Future main() async { await runZonedGuarded( @@ -26,6 +27,7 @@ Future _initSdks() async { WidgetsFlutterBinding.ensureInitialized(); await Logger.init(); await Config.initialize(); + Hive.init(Config.appDirectoryPath); await Future.wait([ DiProvider.init(), diff --git a/pubspec.lock b/pubspec.lock index 46b2d44c..6e02ddef 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -168,14 +168,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" - charcode: - dependency: transitive - description: - name: charcode - sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 - url: "https://pub.dev" - source: hosted - version: "1.3.1" checked_yaml: dependency: transitive description: @@ -336,30 +328,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" - floor: - dependency: "direct main" - description: - name: floor - sha256: "52a8eac2c8d274e7c0c54251226f59786bb5b749365a2d8537d8095aa5132d92" - url: "https://pub.dev" - source: hosted - version: "1.4.2" - floor_annotation: - dependency: transitive - description: - name: floor_annotation - sha256: fa3fa4f198cdd1d922a69ceb06e54663fe59256bf1cb3c036eff206b445a6960 - url: "https://pub.dev" - source: hosted - version: "1.4.2" - floor_generator: - dependency: "direct dev" - description: - name: floor_generator - sha256: "40aaf1b619adc03367ce4b7c79161e3198d43b572b5ec9cc99a4a89de27b08d2" - url: "https://pub.dev" - source: hosted - version: "1.4.2" flutter: dependency: "direct main" description: flutter @@ -564,6 +532,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.1" + hive: + dependency: "direct main" + description: + name: hive + sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" + url: "https://pub.dev" + source: hosted + version: "2.2.3" html: dependency: transitive description: @@ -652,14 +628,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.0" - lists: - dependency: transitive - description: - name: lists - sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27" - url: "https://pub.dev" - source: hosted - version: "1.0.1" logger: dependency: "direct main" description: @@ -717,13 +685,13 @@ packages: source: hosted version: "1.0.4" mutex: - dependency: transitive + dependency: "direct main" description: name: mutex - sha256: "03116a4e46282a671b46c12de649d72c0ed18188ffe12a8d0fc63e83f4ad88f4" + sha256: "8827da25de792088eb33e572115a5eb0d61d61a3c01acbc8bcbe76ed78f1a1f2" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.0" nested: dependency: transitive description: @@ -749,7 +717,7 @@ packages: source: hosted version: "1.8.3" path_provider: - dependency: transitive + dependency: "direct main" description: name: path_provider sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa @@ -1009,30 +977,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.5.0" - sqflite_common_ffi: - dependency: transitive - description: - name: sqflite_common_ffi - sha256: "0d5cc1be2eb18400ac6701c31211d44164393aa75886093002ecdd947be04f93" - url: "https://pub.dev" - source: hosted - version: "2.3.0+2" - sqlite3: - dependency: transitive - description: - name: sqlite3 - sha256: db65233e6b99e99b2548932f55a987961bc06d82a31a0665451fa0b4fff4c3fb - url: "https://pub.dev" - source: hosted - version: "2.1.0" - sqlparser: - dependency: transitive - description: - name: sqlparser - sha256: "91f47610aa54d8abf9d795a7b4e49b2a788f65d7493d5a68fbf180c3cbcc6f38" - url: "https://pub.dev" - source: hosted - version: "0.27.0" stack_trace: dependency: "direct main" description: @@ -1073,14 +1017,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" - strings: - dependency: transitive - description: - name: strings - sha256: "5af86299505c299640f5564e187c1a2ee9d6308c540e8d65f6385f5c67019122" - url: "https://pub.dev" - source: hosted - version: "0.2.2" synchronized: dependency: transitive description: @@ -1129,14 +1065,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" - unicode: - dependency: transitive - description: - name: unicode - sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1" - url: "https://pub.dev" - source: hosted - version: "0.3.1" universal_io: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index a70544c9..22c2b63f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -22,7 +22,6 @@ dependencies: dartx: 1.2.0 dio: 5.3.2 equatable: 2.0.5 - floor: 1.4.2 flutter_bloc: 8.1.3 flutter_dotenv: 5.1.0 flutter_native_splash: 2.3.2 @@ -41,6 +40,9 @@ dependencies: sqflite: 2.3.0 stack_trace: 1.11.0 stock: 1.0.1 + hive: 2.2.3 + path_provider: 2.1.1 + mutex: 3.1.0 # Remove when dart_code_metrics updates its dependencies dependency_overrides: @@ -53,7 +55,6 @@ dev_dependencies: auto_route_generator: 7.3.1 build_runner: 2.4.6 dart_code_metrics: 5.7.6 - floor_generator: 1.4.2 flutter_flavorizr: 2.2.1 flutter_gen_runner: 5.3.1 flutter_launcher_icons: 0.13.1