Skip to content

Commit

Permalink
Refactor view package to features
Browse files Browse the repository at this point in the history
  • Loading branch information
ashtanko committed Mar 30, 2024
1 parent b040182 commit 2b04b87
Show file tree
Hide file tree
Showing 29 changed files with 50 additions and 14 deletions.
3 changes: 3 additions & 0 deletions assets/icons/navigation/icon_contacts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/navigation/icon_contacts_outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
2 changes: 1 addition & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions lib/generated/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/index.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export 'bloc/email_list/email_list_bloc.dart';
export 'bloc/theme/theme_cubit.dart';
export 'constants/index.dart';
export 'features/view.dart';
export 'models/models.dart';
export 'repository/repository.dart';
export 'routes/router.dart';
export 'theme/theme.dart';
export 'view/view.dart';
export 'widgets/widgets.dart';
2 changes: 1 addition & 1 deletion lib/models/nav_destination.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class NavDestination {

final Widget screen;
final String label;
final Icon icon;
final Widget icon;
final Widget? selectedIcon;
final Widget? child;
}
21 changes: 14 additions & 7 deletions lib/routes/router.dart
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_bloc_app_template/generated/assets.gen.dart';
import 'package:flutter_bloc_app_template/index.dart';

const List<NavDestination> destinations = [
final List<NavDestination> destinations = [
NavDestination(
label: 'Home',
icon: Icon(Icons.home_filled),
selectedIcon: Icon(Icons.home_filled),
screen: EmailListScreen(),
label: 'Contacts',
icon: Assets.icons.navigation.iconContactsOutline.svg(),
selectedIcon: Assets.icons.navigation.iconContacts.svg(),
screen: const EmailListScreen(),
),
NavDestination(
const NavDestination(
label: 'News',
icon: Icon(Icons.library_books_outlined),
selectedIcon: Icon(Icons.library_books),
screen: NewsScreen(),
),
NavDestination(
const NavDestination(
label: 'Settings',
icon: Icon(Icons.settings),
selectedIcon: Icon(Icons.settings_applications),
screen: SettingsScreen(),
),
const NavDestination(
label: 'Profile',
icon: Icon(Icons.settings),
selectedIcon: Icon(Icons.settings_applications),
screen: SettingsScreen(),
),
];

class Routes {
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ flutter:
assets:
# Add assets from the images directory to the application.
- assets/images/
- assets/icons/navigation/
- google_fonts/
fonts:
- family: Roboto
Expand Down
2 changes: 1 addition & 1 deletion test/view/email_list/email_list_view_test.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:bloc_test/bloc_test.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_bloc_app_template/features/email_list/view/attachment_icon.dart';
import 'package:flutter_bloc_app_template/generated/l10n.dart';
import 'package:flutter_bloc_app_template/index.dart';
import 'package:flutter_bloc_app_template/view/email_list/view/attachment_icon.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
Expand Down
2 changes: 1 addition & 1 deletion test/view/settings/settings_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'package:bloc_test/bloc_test.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_bloc_app_template/bloc/theme/app_theme.dart';
import 'package:flutter_bloc_app_template/features/settings/settings.dart';
import 'package:flutter_bloc_app_template/generated/l10n.dart';
import 'package:flutter_bloc_app_template/index.dart';
import 'package:flutter_bloc_app_template/view/settings/settings.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
Expand Down

0 comments on commit 2b04b87

Please sign in to comment.