Skip to content

#some changes #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 124 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Flutter Mobile App Project Template (flutter_bloc, autoroute, dio, json_serializable, easy_localization bot_toast, flutter_secure_storage(and helpers), flutter_screenutil, flutter_native_splash, flutter_launcher_icons and other generally used features and tools in production.)
# Flutter Mobile App Project Template (flutter_bloc, go_router, vexana, json_serializable, easy_localization bot_toast, flutter_secure_storage, connectivity_plus, sizer, google_fonts, flutter_native_splash, flutter_launcher_icons and other generally used features and tools in production.)

This is a battery included [Flutter](https://flutter.dev/) project template. To the default setup have been added:

- [flutter_bloc](https://bloclibrary.dev/) - Predictable and Highly testable state management library for Dart.
- [autoroute](https://pub.dev/packages/autoroute) - Robust and customizable Flutter navigation package.
- [dio](https://pub.dev/packages/dio) - Popular and powerful Http client for Dart.
- [go_router](https://pub.dev/packages/go_router) - Robust and customizable Flutter navigation package.
- [vexana](https://pub.dev/packages/vexana) - Popular and powerful Http client for Dart.
- [json_serializable](https://pub.dev/packages/json_serializable) - Generates to/from json serialization code for our data models.
- [easy_localization](https://pub.dev/packages/easy_localization) - Easy and Fast internationalization.
- [bot_toast](https://pub.dev/packages/bot_toast) - Feature-Rich Toast/alert/notification/popup library for Flutter.
- [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage) - A Flutter plugin to store data in secure storage (encrypted, not in plain text like shared_preferences). Eg. for storing user credentials, tokens...
- [flutter_screenutil](https://pub.dev/packages/flutter_screenutil) - A package for adapting screen and font size.
- [sizer](https://pub.dev/packages/sizer) - A package for adapting screen and font size.
- [flutter_svg](https://pub.dev/packages/flutter_svg) - For rendering SVG assets.
- Some tooling for project initial setup.
- [flutter_native_splash](https://pub.dev/packages/flutter_native_splash) - Generates iOS, Android, and Web-native code for customizing the native splash screen background color and splash image.
Expand All @@ -28,47 +28,59 @@ Initialize the Flutter project, add all the necessary dependencies mentioned abo
dependencies:
flutter:
sdk: flutter
# ...
# ...
# Http client
dio: ^4.0.6
# I18n
cupertino_icons: ^1.0.5

#Text
google_fonts: ^3.0.1
auto_size_text: ^3.0.0

#Responsive
sizer: ^2.0.15

#Image
flutter_svg: ^1.1.6

#State Management
provider: ^6.0.4
flutter_bloc: ^8.1.1

#JsonAnnotation
json_annotation: ^4.7.0
equatable: ^2.0.5

#Network
vexana: ^3.0.1
url_launcher: ^6.1.6
connectivity_plus: ^2.3.5

#Locale Storage
flutter_secure_storage: ^6.0.0

#Navigation
go_router: ^5.1.1

#Localization
intl: ^0.17.0
easy_localization: ^3.0.1
# Secure String key-value storage
flutter_secure_storage: ^5.0.2
# Dependency Injection
provider: ^6.0.3
# State management
flutter_bloc: ^8.0.1
equatable: ^2.0.3
bloc: ^8.0.3
# Navigation
auto_route: ^4.0.1
# Global in-app alert/notification/toast/snackBar
bot_toast: ^4.0.2
# Responsiveness
flutter_screenutil: ^5.5.3+2
#SVG Support
flutter_svg: ^1.1.0
# Data Model Json serialization annotations
json_annotation: ^4.5.0
#Native Splash screen autoconfiguration
flutter_native_splash: ^2.2.3+1
bot_toast: ^4.0.3

#Native Splash Screen
flutter_native_splash: ^2.2.13

dev_dependencies:
flutter_test:
sdk: flutter
# ...
# ...
flutter_lints: ^2.0.1

# Code generation
build_runner: ^2.1.11
auto_route_generator: ^4.0.0
build_runner: ^2.2.0

# Json serialization code generation
json_serializable: ^6.2.0
json_serializable: ^6.3.1

# Native Launcher Icons generator
flutter_launcher_icons: ^0.9.3
flutter_launcher_icons: ^0.10.0

# Change app package name/bundle id and app name
change_app_package_name: ^1.1.0
rename: ^2.0.1
Expand Down Expand Up @@ -191,37 +203,87 @@ Main folders structure
...📄 {locale}.json

📂 lib
📂 bloc
...📂 bloc
📄 {global_bloc}.dart
📄 {global_bloc_event}.dart
📄 {global_bloc_state}.dart
📂 core
📂 core
📂 base
📂 bloc
📂 auth
📄 {auth_bloc}.dart
📄 {auth_event}.dart
📄 {auth_state}.dart
📄 app_bloc_observer.dart
📂 local_storage
📄 local_storage_manager.dart
📂 network
📄 dio_manager.dart
📂 theme
📄 colors.dart
📄 constants.dart
📄 dependency_injection.dart
📄 navigation.dart
📄 utils.dart
📂 ui
📂 widgets
...📄 {common_widget}.dart
📂 screens
...📂 {screen}.dart
📂 view_bloc
📄 {screen_bloc}.dart
📄 {screen_bloc_event}.dart
📄 {screen_bloc_state}.dart
📂 functions
📄 base_functions.dart
📂 model
📂 service
📂 state
📂 view
📂 components
📂 animated_text
📄 animated_text.dart
📂 button
📄 button_widget.dart
📂 popup
📄 main_popup.dart
📂 text
📄 custom_text.dart
📂 textFormField
📄 text_form_field_widget.dart
📄 validate_operations.dart
📂 constants
📂 app
📄 app_constants.dart
📂 enums
📄 api_enums.dart
📄 navigation_enums.dart
📄 network_results_enums.dart
📂 extensions
📄 color_extensions.dart
📄 context_extensions.dart
📄 iterable_extensions.dart
📄 network_extensions.dart
📄 num_extensions.dart
📄 string_extensions.dart
📂 init
📂 language
📂 local_storage
📄 local_storage_manager.dart,
📂 main_build
📄 main_build.dart
📂 navigation
📄 navigation.dart
📂 network
📄 network_change_manager.dart
📄 no_network_widget.dart
📄 vexana_manager.dart
📂 theme
📄 app_theme.dart
📂 mixins
📄 safe_context_mixin.dart
📄 state_mixin.dart
📂 utility
📄 utility.dart
📄 dependency_injector.dart
📄 locale_keys.g.dart
📂 view
📂 auth
📂 home
📂 bloc
📄 {home_bloc}.dart
📄 {home_event}.dart
📄 {home_state}.dart
📂 model
📂 service
📄 home_service.dart
📂 widgets
📄 home_view.dart
📄 main.dart
📂 scripts
📄 build.sh

📂 test

📂 test
📂 auth
📄 auth_service_test.dart
📄 widget_test.dart
📄 flutter_launcher_icons.yaml

📄 flutter_native_splash.yaml
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 33
ndkVersion flutter.ndkVersion

compileOptions {
Expand Down
15 changes: 0 additions & 15 deletions lib/bloc/some_global_bloc/some_global_bloc.dart

This file was deleted.

5 changes: 0 additions & 5 deletions lib/bloc/some_global_bloc/some_global_event.dart

This file was deleted.

10 changes: 0 additions & 10 deletions lib/bloc/some_global_bloc/some_global_state.dart

This file was deleted.

42 changes: 42 additions & 0 deletions lib/core/base/bloc/app_bloc_observer.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import 'dart:developer' as developer;
import 'package:flutter_bloc/flutter_bloc.dart';

class AppBlocObserver extends BlocObserver {
static AppBlocObserver? _instance;
static AppBlocObserver get instance {
_instance ??= AppBlocObserver._init();
return _instance!;
}

AppBlocObserver._init();

@override
void onEvent(Bloc<dynamic, dynamic> bloc, Object? event) {
super.onEvent(bloc, event);
developer.log(event.toString());
}

@override
void onError(BlocBase<dynamic> bloc, Object error, StackTrace stackTrace) {
developer.log(error.toString());
super.onError(bloc, error, stackTrace);
}

@override
void onChange(BlocBase<dynamic> bloc, Change<dynamic> change) {
super.onChange(bloc, change);
developer.log(change.toString());
}

@override
void onTransition(
Bloc<dynamic, dynamic> bloc,
Transition<dynamic, dynamic> transition,
) {
super.onTransition(bloc, transition);
developer.log(transition.toString());
developer.log(transition.event);
developer.log(transition.currentState);
developer.log(transition.nextState);
}
}
12 changes: 12 additions & 0 deletions lib/core/base/bloc/auth/auth_bloc.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:flutter/foundation.dart' show immutable;
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:equatable/equatable.dart';

part 'auth_event.dart';
part 'auth_state.dart';

class AuthBloc extends Bloc<AuthEvent, AuthState> {
AuthBloc() : super(AuthInitial()) {
on<AuthEvent>((event, emit) {});
}
}
8 changes: 8 additions & 0 deletions lib/core/base/bloc/auth/auth_event.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
part of 'auth_bloc.dart';

abstract class AuthEvent extends Equatable {
const AuthEvent();

@override
List<Object> get props => [];
}
11 changes: 11 additions & 0 deletions lib/core/base/bloc/auth/auth_state.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
part of 'auth_bloc.dart';

@immutable
abstract class AuthState extends Equatable {
const AuthState();

@override
List<Object> get props => [];
}

class AuthInitial extends AuthState {}
Loading