diff --git a/lib/main.dart b/lib/main.dart index 3424536e..6e46644d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,9 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:flutter_ebook_app/src/features/features.dart'; -import 'package:flutter_ebook_app/src/router/app_router.dart'; -import 'package:flutter_ebook_app/src/theme/theme_config.dart'; +import 'package:flutter_ebook_app/src/app.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:google_fonts/google_fonts.dart'; import 'package:sembast/sembast.dart'; void main() async { @@ -12,38 +10,3 @@ void main() async { await DatabaseConfig.init(StoreRef.main()); runApp(ProviderScope(child: MyApp())); } - -class MyApp extends ConsumerWidget { - MyApp({super.key}); - - final _appRouter = AppRouter(); - - @override - Widget build(BuildContext context, WidgetRef ref) { - final currentAppTheme = ref.watch(currentAppThemeNotifierProvider); - return MaterialApp.router( - debugShowCheckedModeBanner: false, - title: Strings.appName, - theme: themeData( - currentAppTheme.value == CurrentAppTheme.dark - ? ThemeConfig.darkTheme - : ThemeConfig.lightTheme, - ), - darkTheme: themeData(ThemeConfig.darkTheme), - themeMode: currentAppTheme.value?.themeMode, - routerConfig: _appRouter.config(), - ); - } - - // Apply font to our app's theme - ThemeData themeData(ThemeData theme) { - return theme.copyWith( - textTheme: GoogleFonts.sourceSansProTextTheme( - theme.textTheme, - ), - colorScheme: theme.colorScheme.copyWith( - secondary: ThemeConfig.lightAccent, - ), - ); - } -} diff --git a/lib/src/app.dart b/lib/src/app.dart new file mode 100644 index 00000000..28df5b90 --- /dev/null +++ b/lib/src/app.dart @@ -0,0 +1,39 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:google_fonts/google_fonts.dart'; + +class MyApp extends ConsumerWidget { + MyApp({super.key}); + + final _appRouter = AppRouter(); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final currentAppTheme = ref.watch(currentAppThemeNotifierProvider); + return MaterialApp.router( + debugShowCheckedModeBanner: false, + title: Strings.appName, + theme: themeData( + currentAppTheme.value == CurrentAppTheme.dark + ? ThemeConfig.darkTheme + : ThemeConfig.lightTheme, + ), + darkTheme: themeData(ThemeConfig.darkTheme), + themeMode: currentAppTheme.value?.themeMode, + routerConfig: _appRouter.config(), + ); + } + + // Apply font to our app's theme + ThemeData themeData(ThemeData theme) { + return theme.copyWith( + textTheme: GoogleFonts.sourceSansProTextTheme( + theme.textTheme, + ), + colorScheme: theme.colorScheme.copyWith( + secondary: ThemeConfig.lightAccent, + ), + ); + } +} diff --git a/lib/src/features/common/application/application.dart b/lib/src/common/application/application.dart similarity index 100% rename from lib/src/features/common/application/application.dart rename to lib/src/common/application/application.dart diff --git a/lib/src/features/common/application/services/current_app_theme_service.dart b/lib/src/common/application/services/current_app_theme_service.dart similarity index 93% rename from lib/src/features/common/application/services/current_app_theme_service.dart rename to lib/src/common/application/services/current_app_theme_service.dart index a0211fec..6cc1773f 100644 --- a/lib/src/features/common/application/services/current_app_theme_service.dart +++ b/lib/src/common/application/services/current_app_theme_service.dart @@ -1,4 +1,4 @@ -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:shared_preferences/shared_preferences.dart'; diff --git a/lib/src/features/common/application/services/services.dart b/lib/src/common/application/services/services.dart similarity index 100% rename from lib/src/features/common/application/services/services.dart rename to lib/src/common/application/services/services.dart diff --git a/lib/src/features/common/common.dart b/lib/src/common/common.dart similarity index 86% rename from lib/src/features/common/common.dart rename to lib/src/common/common.dart index 22ff5905..6e753c5b 100644 --- a/lib/src/features/common/common.dart +++ b/lib/src/common/common.dart @@ -4,3 +4,4 @@ export 'data/data.dart'; export 'domain/domain.dart'; export 'extensions/extensions.dart'; export 'presentation/presentation.dart'; +export 'router/app_router.dart'; diff --git a/lib/src/features/common/constants/api.dart b/lib/src/common/constants/api.dart similarity index 100% rename from lib/src/features/common/constants/api.dart rename to lib/src/common/constants/api.dart diff --git a/lib/src/features/common/constants/constants.dart b/lib/src/common/constants/constants.dart similarity index 100% rename from lib/src/features/common/constants/constants.dart rename to lib/src/common/constants/constants.dart diff --git a/lib/src/features/common/constants/shared_preferences_key.dart b/lib/src/common/constants/shared_preferences_key.dart similarity index 100% rename from lib/src/features/common/constants/shared_preferences_key.dart rename to lib/src/common/constants/shared_preferences_key.dart diff --git a/lib/src/features/common/constants/strings.dart b/lib/src/common/constants/strings.dart similarity index 100% rename from lib/src/features/common/constants/strings.dart rename to lib/src/common/constants/strings.dart diff --git a/lib/src/features/common/constants/utils.dart b/lib/src/common/constants/utils.dart similarity index 100% rename from lib/src/features/common/constants/utils.dart rename to lib/src/common/constants/utils.dart diff --git a/lib/src/features/common/data/data.dart b/lib/src/common/data/data.dart similarity index 100% rename from lib/src/features/common/data/data.dart rename to lib/src/common/data/data.dart diff --git a/lib/src/features/common/data/data_sources/data_sources.dart b/lib/src/common/data/data_sources/data_sources.dart similarity index 100% rename from lib/src/features/common/data/data_sources/data_sources.dart rename to lib/src/common/data/data_sources/data_sources.dart diff --git a/lib/src/features/common/data/data_sources/downloads/downloads_local_data_source.dart b/lib/src/common/data/data_sources/downloads/downloads_local_data_source.dart similarity index 100% rename from lib/src/features/common/data/data_sources/downloads/downloads_local_data_source.dart rename to lib/src/common/data/data_sources/downloads/downloads_local_data_source.dart diff --git a/lib/src/features/common/data/data_sources/downloads/downloads_local_data_source_impl.dart b/lib/src/common/data/data_sources/downloads/downloads_local_data_source_impl.dart similarity index 96% rename from lib/src/features/common/data/data_sources/downloads/downloads_local_data_source_impl.dart rename to lib/src/common/data/data_sources/downloads/downloads_local_data_source_impl.dart index bfd196cf..d2715bdf 100644 --- a/lib/src/features/common/data/data_sources/downloads/downloads_local_data_source_impl.dart +++ b/lib/src/common/data/data_sources/downloads/downloads_local_data_source_impl.dart @@ -1,4 +1,4 @@ -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:sembast/sembast.dart'; diff --git a/lib/src/features/common/data/data_sources/favorites/favorites_local_data_source.dart b/lib/src/common/data/data_sources/favorites/favorites_local_data_source.dart similarity index 77% rename from lib/src/features/common/data/data_sources/favorites/favorites_local_data_source.dart rename to lib/src/common/data/data_sources/favorites/favorites_local_data_source.dart index f87f89ca..a50fc219 100644 --- a/lib/src/features/common/data/data_sources/favorites/favorites_local_data_source.dart +++ b/lib/src/common/data/data_sources/favorites/favorites_local_data_source.dart @@ -1,4 +1,4 @@ -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; abstract class FavoritesLocalDataSource { const FavoritesLocalDataSource(); diff --git a/lib/src/features/common/data/data_sources/favorites/favorites_local_data_source_impl.dart b/lib/src/common/data/data_sources/favorites/favorites_local_data_source_impl.dart similarity index 95% rename from lib/src/features/common/data/data_sources/favorites/favorites_local_data_source_impl.dart rename to lib/src/common/data/data_sources/favorites/favorites_local_data_source_impl.dart index 8bf6ef67..43de76de 100644 --- a/lib/src/features/common/data/data_sources/favorites/favorites_local_data_source_impl.dart +++ b/lib/src/common/data/data_sources/favorites/favorites_local_data_source_impl.dart @@ -1,4 +1,4 @@ -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:sembast/sembast.dart'; diff --git a/lib/src/features/common/data/database/database.dart b/lib/src/common/data/database/database.dart similarity index 100% rename from lib/src/features/common/data/database/database.dart rename to lib/src/common/data/database/database.dart diff --git a/lib/src/features/common/data/database/database_config.dart b/lib/src/common/data/database/database_config.dart similarity index 100% rename from lib/src/features/common/data/database/database_config.dart rename to lib/src/common/data/database/database_config.dart diff --git a/lib/src/features/common/data/failures/http_failure.dart b/lib/src/common/data/failures/http_failure.dart similarity index 100% rename from lib/src/features/common/data/failures/http_failure.dart rename to lib/src/common/data/failures/http_failure.dart diff --git a/lib/src/features/common/data/local/local_storage.dart b/lib/src/common/data/local/local_storage.dart similarity index 100% rename from lib/src/features/common/data/local/local_storage.dart rename to lib/src/common/data/local/local_storage.dart diff --git a/lib/src/features/common/data/remote/app_dio.dart b/lib/src/common/data/remote/app_dio.dart similarity index 92% rename from lib/src/features/common/data/remote/app_dio.dart rename to lib/src/common/data/remote/app_dio.dart index 04c6f900..03d9c08c 100644 --- a/lib/src/features/common/data/remote/app_dio.dart +++ b/lib/src/common/data/remote/app_dio.dart @@ -1,6 +1,6 @@ import 'package:dio/dio.dart'; import 'package:dio/io.dart'; -import 'package:flutter_ebook_app/src/features/common/constants/api.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; class AppDio with DioMixin implements Dio { AppDio._() { diff --git a/lib/src/features/common/data/repositories/book/book_repository.dart b/lib/src/common/data/repositories/book/book_repository.dart similarity index 93% rename from lib/src/features/common/data/repositories/book/book_repository.dart rename to lib/src/common/data/repositories/book/book_repository.dart index dbb4c364..e631c923 100644 --- a/lib/src/features/common/data/repositories/book/book_repository.dart +++ b/lib/src/common/data/repositories/book/book_repository.dart @@ -1,7 +1,7 @@ import 'dart:convert'; import 'package:dio/dio.dart'; -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:xml2json/xml2json.dart'; typedef BookRepositoryData = ({CategoryFeed? feed, HttpFailure? failure}); diff --git a/lib/src/features/common/data/repositories/downloads/downloads_repository.dart b/lib/src/common/data/repositories/downloads/downloads_repository.dart similarity index 88% rename from lib/src/features/common/data/repositories/downloads/downloads_repository.dart rename to lib/src/common/data/repositories/downloads/downloads_repository.dart index 56191e66..71e8f783 100644 --- a/lib/src/features/common/data/repositories/downloads/downloads_repository.dart +++ b/lib/src/common/data/repositories/downloads/downloads_repository.dart @@ -1,5 +1,4 @@ -import 'package:flutter_ebook_app/src/features/common/data/data_sources/downloads/downloads_local_data_source.dart'; -import 'package:flutter_ebook_app/src/features/common/data/data_sources/downloads/downloads_local_data_source_impl.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; abstract class DownloadsRepository { diff --git a/lib/src/features/common/data/repositories/favorites/favorites_repository.dart b/lib/src/common/data/repositories/favorites/favorites_repository.dart similarity index 94% rename from lib/src/features/common/data/repositories/favorites/favorites_repository.dart rename to lib/src/common/data/repositories/favorites/favorites_repository.dart index ca9c2d2c..05173370 100644 --- a/lib/src/features/common/data/repositories/favorites/favorites_repository.dart +++ b/lib/src/common/data/repositories/favorites/favorites_repository.dart @@ -1,4 +1,4 @@ -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; abstract class FavoritesRepository { diff --git a/lib/src/features/common/data/repositories/repositories.dart b/lib/src/common/data/repositories/repositories.dart similarity index 100% rename from lib/src/features/common/data/repositories/repositories.dart rename to lib/src/common/data/repositories/repositories.dart diff --git a/lib/src/features/common/domain/domain.dart b/lib/src/common/domain/domain.dart similarity index 100% rename from lib/src/features/common/domain/domain.dart rename to lib/src/common/domain/domain.dart diff --git a/lib/src/features/common/domain/models/category_feed.dart b/lib/src/common/domain/models/category_feed.dart similarity index 100% rename from lib/src/features/common/domain/models/category_feed.dart rename to lib/src/common/domain/models/category_feed.dart diff --git a/lib/src/features/common/domain/models/models.dart b/lib/src/common/domain/models/models.dart similarity index 100% rename from lib/src/features/common/domain/models/models.dart rename to lib/src/common/domain/models/models.dart diff --git a/lib/src/features/common/extensions/context_extensions.dart b/lib/src/common/extensions/context_extensions.dart similarity index 100% rename from lib/src/features/common/extensions/context_extensions.dart rename to lib/src/common/extensions/context_extensions.dart diff --git a/lib/src/features/common/extensions/extensions.dart b/lib/src/common/extensions/extensions.dart similarity index 100% rename from lib/src/features/common/extensions/extensions.dart rename to lib/src/common/extensions/extensions.dart diff --git a/lib/src/features/common/extensions/theme_extensions.dart b/lib/src/common/extensions/theme_extensions.dart similarity index 100% rename from lib/src/features/common/extensions/theme_extensions.dart rename to lib/src/common/extensions/theme_extensions.dart diff --git a/lib/src/features/common/presentation/notifiers/current_app_theme/current_app_theme_notifier.dart b/lib/src/common/presentation/notifiers/current_app_theme/current_app_theme_notifier.dart similarity index 93% rename from lib/src/features/common/presentation/notifiers/current_app_theme/current_app_theme_notifier.dart rename to lib/src/common/presentation/notifiers/current_app_theme/current_app_theme_notifier.dart index f967b4fc..7f2b362a 100644 --- a/lib/src/features/common/presentation/notifiers/current_app_theme/current_app_theme_notifier.dart +++ b/lib/src/common/presentation/notifiers/current_app_theme/current_app_theme_notifier.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'current_app_theme_notifier.g.dart'; diff --git a/lib/src/features/common/presentation/notifiers/current_app_theme/current_app_theme_notifier.g.dart b/lib/src/common/presentation/notifiers/current_app_theme/current_app_theme_notifier.g.dart similarity index 100% rename from lib/src/features/common/presentation/notifiers/current_app_theme/current_app_theme_notifier.g.dart rename to lib/src/common/presentation/notifiers/current_app_theme/current_app_theme_notifier.g.dart diff --git a/lib/src/features/common/presentation/notifiers/downloads/downloads_notifier.dart b/lib/src/common/presentation/notifiers/downloads/downloads_notifier.dart similarity index 94% rename from lib/src/features/common/presentation/notifiers/downloads/downloads_notifier.dart rename to lib/src/common/presentation/notifiers/downloads/downloads_notifier.dart index 7073c627..06aff81a 100644 --- a/lib/src/features/common/presentation/notifiers/downloads/downloads_notifier.dart +++ b/lib/src/common/presentation/notifiers/downloads/downloads_notifier.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'downloads_notifier.g.dart'; diff --git a/lib/src/features/common/presentation/notifiers/downloads/downloads_notifier.g.dart b/lib/src/common/presentation/notifiers/downloads/downloads_notifier.g.dart similarity index 100% rename from lib/src/features/common/presentation/notifiers/downloads/downloads_notifier.g.dart rename to lib/src/common/presentation/notifiers/downloads/downloads_notifier.g.dart diff --git a/lib/src/features/common/presentation/notifiers/favorites/favorites_notifier.dart b/lib/src/common/presentation/notifiers/favorites/favorites_notifier.dart similarity index 93% rename from lib/src/features/common/presentation/notifiers/favorites/favorites_notifier.dart rename to lib/src/common/presentation/notifiers/favorites/favorites_notifier.dart index 8c5e6679..47e4462f 100644 --- a/lib/src/features/common/presentation/notifiers/favorites/favorites_notifier.dart +++ b/lib/src/common/presentation/notifiers/favorites/favorites_notifier.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'favorites_notifier.g.dart'; diff --git a/lib/src/features/common/presentation/notifiers/favorites/favorites_notifier.g.dart b/lib/src/common/presentation/notifiers/favorites/favorites_notifier.g.dart similarity index 100% rename from lib/src/features/common/presentation/notifiers/favorites/favorites_notifier.g.dart rename to lib/src/common/presentation/notifiers/favorites/favorites_notifier.g.dart diff --git a/lib/src/features/common/presentation/notifiers/notifiers.dart b/lib/src/common/presentation/notifiers/notifiers.dart similarity index 100% rename from lib/src/features/common/presentation/notifiers/notifiers.dart rename to lib/src/common/presentation/notifiers/notifiers.dart diff --git a/lib/src/features/common/presentation/presentation.dart b/lib/src/common/presentation/presentation.dart similarity index 72% rename from lib/src/features/common/presentation/presentation.dart rename to lib/src/common/presentation/presentation.dart index e91d9eb0..99a83507 100644 --- a/lib/src/features/common/presentation/presentation.dart +++ b/lib/src/common/presentation/presentation.dart @@ -1,3 +1,4 @@ export 'notifiers/notifiers.dart'; export 'providers/providers.dart'; +export 'theme/theme_config.dart'; export 'ui/ui.dart'; diff --git a/lib/src/features/common/presentation/providers/database_provider.dart b/lib/src/common/presentation/providers/database_provider.dart similarity index 89% rename from lib/src/features/common/presentation/providers/database_provider.dart rename to lib/src/common/presentation/providers/database_provider.dart index 850b5159..4387c3af 100644 --- a/lib/src/features/common/presentation/providers/database_provider.dart +++ b/lib/src/common/presentation/providers/database_provider.dart @@ -1,4 +1,4 @@ -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:sembast/sembast.dart'; diff --git a/lib/src/features/common/presentation/providers/dio_provider.dart b/lib/src/common/presentation/providers/dio_provider.dart similarity index 65% rename from lib/src/features/common/presentation/providers/dio_provider.dart rename to lib/src/common/presentation/providers/dio_provider.dart index 955dc9bd..9d77c34b 100644 --- a/lib/src/features/common/presentation/providers/dio_provider.dart +++ b/lib/src/common/presentation/providers/dio_provider.dart @@ -1,5 +1,5 @@ import 'package:dio/dio.dart'; -import 'package:flutter_ebook_app/src/features/common/data/remote/app_dio.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; final dioProvider = Provider((ref) => AppDio.getInstance()); diff --git a/lib/src/features/common/presentation/providers/providers.dart b/lib/src/common/presentation/providers/providers.dart similarity index 100% rename from lib/src/features/common/presentation/providers/providers.dart rename to lib/src/common/presentation/providers/providers.dart diff --git a/lib/src/features/common/presentation/providers/shared_preferences_provider.dart b/lib/src/common/presentation/providers/shared_preferences_provider.dart similarity index 73% rename from lib/src/features/common/presentation/providers/shared_preferences_provider.dart rename to lib/src/common/presentation/providers/shared_preferences_provider.dart index 2f8c788d..1aa25c54 100644 --- a/lib/src/features/common/presentation/providers/shared_preferences_provider.dart +++ b/lib/src/common/presentation/providers/shared_preferences_provider.dart @@ -1,4 +1,4 @@ -import 'package:flutter_ebook_app/src/features/common/data/local/local_storage.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:shared_preferences/shared_preferences.dart'; diff --git a/lib/src/theme/theme_config.dart b/lib/src/common/presentation/theme/theme_config.dart similarity index 100% rename from lib/src/theme/theme_config.dart rename to lib/src/common/presentation/theme/theme_config.dart diff --git a/lib/src/features/common/presentation/ui/ui.dart b/lib/src/common/presentation/ui/ui.dart similarity index 100% rename from lib/src/features/common/presentation/ui/ui.dart rename to lib/src/common/presentation/ui/ui.dart diff --git a/lib/src/features/common/presentation/ui/widgets/book_card.dart b/lib/src/common/presentation/ui/widgets/book_card.dart similarity index 92% rename from lib/src/features/common/presentation/ui/widgets/book_card.dart rename to lib/src/common/presentation/ui/widgets/book_card.dart index 703b99ed..5afae255 100644 --- a/lib/src/features/common/presentation/ui/widgets/book_card.dart +++ b/lib/src/common/presentation/ui/widgets/book_card.dart @@ -1,8 +1,8 @@ import 'package:auto_route/auto_route.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; -import 'package:flutter_ebook_app/src/router/app_router.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:uuid/uuid.dart'; @@ -33,7 +33,8 @@ class BookCard extends ConsumerWidget { child: InkWell( borderRadius: const BorderRadius.all(Radius.circular(10.0)), onTap: () { - final bool isHomeTab = ref.read(currentTabNotifierProvider).isHomeTab; + final bool isHomeTab = + ref.read(currentTabNotifierProvider).isHomeTab; final route = BookDetailsRoute( entry: entry, imgTag: imgTag, diff --git a/lib/src/features/common/presentation/ui/widgets/book_item.dart b/lib/src/common/presentation/ui/widgets/book_item.dart similarity index 97% rename from lib/src/features/common/presentation/ui/widgets/book_item.dart rename to lib/src/common/presentation/ui/widgets/book_item.dart index b84ed2f4..1d5e870e 100644 --- a/lib/src/features/common/presentation/ui/widgets/book_item.dart +++ b/lib/src/common/presentation/ui/widgets/book_item.dart @@ -1,8 +1,8 @@ import 'package:auto_route/auto_route.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; -import 'package:flutter_ebook_app/src/router/app_router.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:uuid/uuid.dart'; diff --git a/lib/src/features/common/presentation/ui/widgets/book_list_item.dart b/lib/src/common/presentation/ui/widgets/book_list_item.dart similarity index 98% rename from lib/src/features/common/presentation/ui/widgets/book_list_item.dart rename to lib/src/common/presentation/ui/widgets/book_list_item.dart index 350e501f..c296a3e0 100644 --- a/lib/src/features/common/presentation/ui/widgets/book_list_item.dart +++ b/lib/src/common/presentation/ui/widgets/book_list_item.dart @@ -1,8 +1,8 @@ import 'package:auto_route/auto_route.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; -import 'package:flutter_ebook_app/src/router/app_router.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:uuid/uuid.dart'; diff --git a/lib/src/features/common/presentation/ui/widgets/description_text.dart b/lib/src/common/presentation/ui/widgets/description_text.dart similarity index 97% rename from lib/src/features/common/presentation/ui/widgets/description_text.dart rename to lib/src/common/presentation/ui/widgets/description_text.dart index ca2da45c..4645c723 100644 --- a/lib/src/features/common/presentation/ui/widgets/description_text.dart +++ b/lib/src/common/presentation/ui/widgets/description_text.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; class DescriptionTextWidget extends StatefulWidget { final String text; diff --git a/lib/src/features/common/presentation/ui/widgets/empty_view.dart b/lib/src/common/presentation/ui/widgets/empty_view.dart similarity index 100% rename from lib/src/features/common/presentation/ui/widgets/empty_view.dart rename to lib/src/common/presentation/ui/widgets/empty_view.dart diff --git a/lib/src/features/common/presentation/ui/widgets/error_widget.dart b/lib/src/common/presentation/ui/widgets/error_widget.dart similarity index 96% rename from lib/src/features/common/presentation/ui/widgets/error_widget.dart rename to lib/src/common/presentation/ui/widgets/error_widget.dart index 8694f8c2..16bc0db7 100644 --- a/lib/src/features/common/presentation/ui/widgets/error_widget.dart +++ b/lib/src/common/presentation/ui/widgets/error_widget.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; class MyErrorWidget extends StatelessWidget { final Function refreshCallBack; diff --git a/lib/src/features/common/presentation/ui/widgets/loading_widget.dart b/lib/src/common/presentation/ui/widgets/loading_widget.dart similarity index 87% rename from lib/src/features/common/presentation/ui/widgets/loading_widget.dart rename to lib/src/common/presentation/ui/widgets/loading_widget.dart index d52ea6a2..197ff4c8 100644 --- a/lib/src/features/common/presentation/ui/widgets/loading_widget.dart +++ b/lib/src/common/presentation/ui/widgets/loading_widget.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; class LoadingWidget extends StatelessWidget { diff --git a/lib/src/features/common/presentation/ui/widgets/modal_dialogs/custom_alert.dart b/lib/src/common/presentation/ui/widgets/modal_dialogs/custom_alert.dart similarity index 100% rename from lib/src/features/common/presentation/ui/widgets/modal_dialogs/custom_alert.dart rename to lib/src/common/presentation/ui/widgets/modal_dialogs/custom_alert.dart diff --git a/lib/src/features/common/presentation/ui/widgets/modal_dialogs/download_alert.dart b/lib/src/common/presentation/ui/widgets/modal_dialogs/download_alert.dart similarity index 98% rename from lib/src/features/common/presentation/ui/widgets/modal_dialogs/download_alert.dart rename to lib/src/common/presentation/ui/widgets/modal_dialogs/download_alert.dart index 385f6bca..9928c926 100644 --- a/lib/src/features/common/presentation/ui/widgets/modal_dialogs/download_alert.dart +++ b/lib/src/common/presentation/ui/widgets/modal_dialogs/download_alert.dart @@ -3,7 +3,7 @@ import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:path/path.dart' as path; import 'package:path_provider/path_provider.dart'; diff --git a/lib/src/features/common/presentation/ui/widgets/modal_dialogs/exit_modal_dialog.dart b/lib/src/common/presentation/ui/widgets/modal_dialogs/exit_modal_dialog.dart similarity index 97% rename from lib/src/features/common/presentation/ui/widgets/modal_dialogs/exit_modal_dialog.dart rename to lib/src/common/presentation/ui/widgets/modal_dialogs/exit_modal_dialog.dart index fcd7a9ab..59f4f7c5 100644 --- a/lib/src/features/common/presentation/ui/widgets/modal_dialogs/exit_modal_dialog.dart +++ b/lib/src/common/presentation/ui/widgets/modal_dialogs/exit_modal_dialog.dart @@ -1,7 +1,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; class ExitModalDialog extends StatelessWidget { const ExitModalDialog({super.key}); diff --git a/lib/src/features/common/presentation/ui/widgets/modal_dialogs/modal_dialogs.dart b/lib/src/common/presentation/ui/widgets/modal_dialogs/modal_dialogs.dart similarity index 100% rename from lib/src/features/common/presentation/ui/widgets/modal_dialogs/modal_dialogs.dart rename to lib/src/common/presentation/ui/widgets/modal_dialogs/modal_dialogs.dart diff --git a/lib/src/features/common/presentation/ui/widgets/responsive_widget.dart b/lib/src/common/presentation/ui/widgets/responsive_widget.dart similarity index 100% rename from lib/src/features/common/presentation/ui/widgets/responsive_widget.dart rename to lib/src/common/presentation/ui/widgets/responsive_widget.dart diff --git a/lib/src/features/common/presentation/ui/widgets/widgets.dart b/lib/src/common/presentation/ui/widgets/widgets.dart similarity index 100% rename from lib/src/features/common/presentation/ui/widgets/widgets.dart rename to lib/src/common/presentation/ui/widgets/widgets.dart diff --git a/lib/src/router/app_router.dart b/lib/src/common/router/app_router.dart similarity index 98% rename from lib/src/router/app_router.dart rename to lib/src/common/router/app_router.dart index 3f630f9e..aa11aa7c 100644 --- a/lib/src/router/app_router.dart +++ b/lib/src/common/router/app_router.dart @@ -1,5 +1,6 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; part 'app_router.gr.dart'; diff --git a/lib/src/router/app_router.gr.dart b/lib/src/common/router/app_router.gr.dart similarity index 100% rename from lib/src/router/app_router.gr.dart rename to lib/src/common/router/app_router.gr.dart diff --git a/lib/src/features/book_details/data/repositories/book_details_repository.dart b/lib/src/features/book_details/data/repositories/book_details_repository.dart index 4f694e08..485c344d 100644 --- a/lib/src/features/book_details/data/repositories/book_details_repository.dart +++ b/lib/src/features/book_details/data/repositories/book_details_repository.dart @@ -1,4 +1,4 @@ -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; class BookDetailsRepository extends BookRepository { diff --git a/lib/src/features/book_details/presentation/notifier/book_details_notifier.dart b/lib/src/features/book_details/presentation/notifier/book_details_notifier.dart index 6c790ddf..0c50d21d 100644 --- a/lib/src/features/book_details/presentation/notifier/book_details_notifier.dart +++ b/lib/src/features/book_details/presentation/notifier/book_details_notifier.dart @@ -1,5 +1,5 @@ +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/book_details/data/repositories/book_details_repository.dart'; -import 'package:flutter_ebook_app/src/features/common/common.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'book_details_notifier.g.dart'; diff --git a/lib/src/features/book_details/presentation/ui/screens/book_details_screen.dart b/lib/src/features/book_details/presentation/ui/screens/book_details_screen.dart index 96553c16..368ab3ce 100644 --- a/lib/src/features/book_details/presentation/ui/screens/book_details_screen.dart +++ b/lib/src/features/book_details/presentation/ui/screens/book_details_screen.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:auto_route/auto_route.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/src/features/downloads/presentation/ui/screens/download_screen.dart b/lib/src/features/downloads/presentation/ui/screens/download_screen.dart index 88f7580f..cfc10e54 100644 --- a/lib/src/features/downloads/presentation/ui/screens/download_screen.dart +++ b/lib/src/features/downloads/presentation/ui/screens/download_screen.dart @@ -3,7 +3,7 @@ import 'dart:io'; import 'package:auto_route/auto_route.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:iridium_reader_widget/views/viewers/epub_screen.dart'; diff --git a/lib/src/features/explore/data/repositories/explore_repository.dart b/lib/src/features/explore/data/repositories/explore_repository.dart index c615a2b7..e8f2d899 100644 --- a/lib/src/features/explore/data/repositories/explore_repository.dart +++ b/lib/src/features/explore/data/repositories/explore_repository.dart @@ -1,4 +1,4 @@ -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; class ExploreRepository extends BookRepository { diff --git a/lib/src/features/explore/presentation/notifiers/genre_feed/genre_feed_notifier.dart b/lib/src/features/explore/presentation/notifiers/genre_feed/genre_feed_notifier.dart index 01d2ffb6..cc0aa252 100644 --- a/lib/src/features/explore/presentation/notifiers/genre_feed/genre_feed_notifier.dart +++ b/lib/src/features/explore/presentation/notifiers/genre_feed/genre_feed_notifier.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; diff --git a/lib/src/features/explore/presentation/ui/screens/explore_screen.dart b/lib/src/features/explore/presentation/ui/screens/explore_screen.dart index 29541a43..4f621d34 100644 --- a/lib/src/features/explore/presentation/ui/screens/explore_screen.dart +++ b/lib/src/features/explore/presentation/ui/screens/explore_screen.dart @@ -1,5 +1,6 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; @RoutePage() diff --git a/lib/src/features/explore/presentation/ui/screens/explore_screen_large.dart b/lib/src/features/explore/presentation/ui/screens/explore_screen_large.dart index 5880757a..2de81142 100644 --- a/lib/src/features/explore/presentation/ui/screens/explore_screen_large.dart +++ b/lib/src/features/explore/presentation/ui/screens/explore_screen_large.dart @@ -1,7 +1,6 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; - -import 'package:flutter_ebook_app/src/router/app_router.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; class ExploreScreenLarge extends StatefulWidget { const ExploreScreenLarge({super.key}); diff --git a/lib/src/features/explore/presentation/ui/screens/explore_screen_small.dart b/lib/src/features/explore/presentation/ui/screens/explore_screen_small.dart index ec39f8f8..a51df876 100644 --- a/lib/src/features/explore/presentation/ui/screens/explore_screen_small.dart +++ b/lib/src/features/explore/presentation/ui/screens/explore_screen_small.dart @@ -1,7 +1,7 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; -import 'package:flutter_ebook_app/src/router/app_router.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @RoutePage() diff --git a/lib/src/features/explore/presentation/ui/screens/genre_screen.dart b/lib/src/features/explore/presentation/ui/screens/genre_screen.dart index 3bf2856d..ba23e181 100644 --- a/lib/src/features/explore/presentation/ui/screens/genre_screen.dart +++ b/lib/src/features/explore/presentation/ui/screens/genre_screen.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/src/features/favorites/presentation/ui/screens/favorites_screen.dart b/lib/src/features/favorites/presentation/ui/screens/favorites_screen.dart index 45beac70..6b88f96b 100644 --- a/lib/src/features/favorites/presentation/ui/screens/favorites_screen.dart +++ b/lib/src/features/favorites/presentation/ui/screens/favorites_screen.dart @@ -1,6 +1,6 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @RoutePage() diff --git a/lib/src/features/features.dart b/lib/src/features/features.dart index ad1f66d5..55e83a38 100644 --- a/lib/src/features/features.dart +++ b/lib/src/features/features.dart @@ -1,5 +1,4 @@ export 'book_details/book_details.dart'; -export 'common/common.dart'; export 'downloads/downloads.dart'; export 'explore/explore.dart'; export 'favorites/favourites.dart'; diff --git a/lib/src/features/home/data/repositories/home_repository.dart b/lib/src/features/home/data/repositories/home_repository.dart index 47ec1f6c..357b30e9 100644 --- a/lib/src/features/home/data/repositories/home_repository.dart +++ b/lib/src/features/home/data/repositories/home_repository.dart @@ -1,4 +1,4 @@ -import 'package:flutter_ebook_app/src/features/features.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; diff --git a/lib/src/features/home/presentation/notifiers/home_feed_notifier.dart b/lib/src/features/home/presentation/notifiers/home_feed_notifier.dart index 06321125..86af0621 100644 --- a/lib/src/features/home/presentation/notifiers/home_feed_notifier.dart +++ b/lib/src/features/home/presentation/notifiers/home_feed_notifier.dart @@ -1,3 +1,4 @@ +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -25,8 +26,8 @@ class HomeFeedNotifier extends _$HomeFeedNotifier { final popularFeedSuccessOrFailure = await homeRepository.getPopularHomeFeed(); final recentFeedSuccessOrFailure = await homeRepository.getRecentHomeFeed(); - CategoryFeed? popularFeed = popularFeedSuccessOrFailure.feed; - CategoryFeed? recentFeed = recentFeedSuccessOrFailure.feed; + final popularFeed = popularFeedSuccessOrFailure.feed; + final recentFeed = recentFeedSuccessOrFailure.feed; if (popularFeed == null) { throw popularFeedSuccessOrFailure.failure!.description; } diff --git a/lib/src/features/home/presentation/ui/screens/home_screen.dart b/lib/src/features/home/presentation/ui/screens/home_screen.dart index ec54ec8d..5d40cd10 100644 --- a/lib/src/features/home/presentation/ui/screens/home_screen.dart +++ b/lib/src/features/home/presentation/ui/screens/home_screen.dart @@ -1,5 +1,6 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; @RoutePage() diff --git a/lib/src/features/home/presentation/ui/screens/home_screen_large.dart b/lib/src/features/home/presentation/ui/screens/home_screen_large.dart index 96a4d571..157096b2 100644 --- a/lib/src/features/home/presentation/ui/screens/home_screen_large.dart +++ b/lib/src/features/home/presentation/ui/screens/home_screen_large.dart @@ -1,5 +1,6 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; class HomeScreenLarge extends StatelessWidget { diff --git a/lib/src/features/home/presentation/ui/screens/home_screen_small.dart b/lib/src/features/home/presentation/ui/screens/home_screen_small.dart index cf608cae..dbe70733 100644 --- a/lib/src/features/home/presentation/ui/screens/home_screen_small.dart +++ b/lib/src/features/home/presentation/ui/screens/home_screen_small.dart @@ -1,7 +1,7 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; -import 'package:flutter_ebook_app/src/router/app_router.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; class HomeScreenSmall extends ConsumerStatefulWidget { diff --git a/lib/src/features/settings/presentation/ui/screens/settings_screen.dart b/lib/src/features/settings/presentation/ui/screens/settings_screen.dart index 36b64aca..fae5cf1d 100644 --- a/lib/src/features/settings/presentation/ui/screens/settings_screen.dart +++ b/lib/src/features/settings/presentation/ui/screens/settings_screen.dart @@ -1,5 +1,6 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; @RoutePage() diff --git a/lib/src/features/settings/presentation/ui/screens/settings_screen_small.dart b/lib/src/features/settings/presentation/ui/screens/settings_screen_small.dart index cf1cb353..a6a00588 100644 --- a/lib/src/features/settings/presentation/ui/screens/settings_screen_small.dart +++ b/lib/src/features/settings/presentation/ui/screens/settings_screen_small.dart @@ -1,7 +1,6 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_ebook_app/src/features/features.dart'; -import 'package:flutter_ebook_app/src/router/app_router.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/src/features/splash/presentation/ui/screens/splash_screen.dart b/lib/src/features/splash/presentation/ui/screens/splash_screen.dart index 8511d3b5..efd6040e 100644 --- a/lib/src/features/splash/presentation/ui/screens/splash_screen.dart +++ b/lib/src/features/splash/presentation/ui/screens/splash_screen.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_ebook_app/src/router/app_router.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; @RoutePage() class SplashScreen extends StatefulWidget { diff --git a/lib/src/features/tabs/presentation/ui/screens/tabs_screen.dart b/lib/src/features/tabs/presentation/ui/screens/tabs_screen.dart index dbb3aa0d..2b880e0b 100644 --- a/lib/src/features/tabs/presentation/ui/screens/tabs_screen.dart +++ b/lib/src/features/tabs/presentation/ui/screens/tabs_screen.dart @@ -1,5 +1,6 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/src/features/tabs/presentation/ui/screens/tabs_screen_large.dart b/lib/src/features/tabs/presentation/ui/screens/tabs_screen_large.dart index 984cd1eb..51e2fc2c 100644 --- a/lib/src/features/tabs/presentation/ui/screens/tabs_screen_large.dart +++ b/lib/src/features/tabs/presentation/ui/screens/tabs_screen_large.dart @@ -1,7 +1,7 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_ebook_app/src/features/features.dart'; -import 'package:flutter_ebook_app/src/router/app_router.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/lib/src/features/tabs/presentation/ui/screens/tabs_screen_small.dart b/lib/src/features/tabs/presentation/ui/screens/tabs_screen_small.dart index 67e372dc..355167d4 100644 --- a/lib/src/features/tabs/presentation/ui/screens/tabs_screen_small.dart +++ b/lib/src/features/tabs/presentation/ui/screens/tabs_screen_small.dart @@ -1,7 +1,6 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_ebook_app/src/features/features.dart'; -import 'package:flutter_ebook_app/src/router/app_router.dart'; +import 'package:flutter_ebook_app/src/common/common.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; diff --git a/test/widget_test.dart b/test/widget_test.dart index badcd7bb..af95ced4 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -5,26 +5,21 @@ // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:flutter_ebook_app/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} +// void main() { +// testWidgets('Counter increments smoke test', (WidgetTester tester) async { +// // Build our app and trigger a frame. +// await tester.pumpWidget(MyApp()); +// +// // Verify that our counter starts at 0. +// expect(find.text('0'), findsOneWidget); +// expect(find.text('1'), findsNothing); +// +// // Tap the '+' icon and trigger a frame. +// await tester.tap(find.byIcon(Icons.add)); +// await tester.pump(); +// +// // Verify that our counter has incremented. +// expect(find.text('0'), findsNothing); +// expect(find.text('1'), findsOneWidget); +// }); +// }