Skip to content
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

1.2.0+29 #89

Merged
merged 32 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5a45f6d
fix(Firebase Auth): Added firebase error type
Coloud1 Aug 6, 2024
dfa59c6
Merge pull request #87 from Onix-Systems/72-error-on-project-generati…
cozvtieg9 Aug 7, 2024
180dee8
feat(Version Control): Increased version to 1.1.4+29
Coloud1 Aug 7, 2024
fad0190
Merge branch 'dev' of github.com:Onix-Systems/onix-flutter-project-ge…
Coloud1 Aug 7, 2024
5f69f8a
feat(AutoRoute): Migrated auto route brick template to 9.0.0
Coloud1 Aug 7, 2024
1c4a268
feat(Auto Route): Renamed varialble and updated type
Coloud1 Aug 7, 2024
86b45f1
feat(AppRouter): Removed unused imports for both routers
Coloud1 Aug 7, 2024
4ecf516
feat(Constants): Updated class modifier and moved constructor below t…
Coloud1 Aug 7, 2024
da38c6c
feat(How To): Updated HOW_TO_CREATE_PROJECT.md
Coloud1 Aug 7, 2024
9722381
feat(Analyzer): Fixed analyzer hints. Removed unnecessary double quot…
Coloud1 Aug 7, 2024
9b024dd
fix(Pubspec): Downgraded intl dependency to 0.18.1
Coloud1 Aug 7, 2024
797eb14
feat(Refactoring): Added final class modifier for the Dimensions and …
Coloud1 Aug 7, 2024
b99ef57
fix(Dimensions): Added correct constructor for the Dimension class
Coloud1 Aug 7, 2024
4959e7d
feat(Base Arch): Syncronized base arch from boilerplate with brick
Coloud1 Aug 7, 2024
9bfaec8
feat(Base Arch): Updated BaseBlocState and BaseCubitState classes
Coloud1 Aug 7, 2024
4f388c3
feat(Base Arch): Updated code
Coloud1 Aug 7, 2024
2a303a9
feat(Base Arch): Updated code
Coloud1 Aug 7, 2024
007a966
fix(Base Arch): Added import and renamed method
Coloud1 Aug 7, 2024
acdab38
feat(Base Arch): Added web loader imports
Coloud1 Aug 7, 2024
fdc756e
feat(Base Arch): Added BlocListener
Coloud1 Aug 7, 2024
285428b
feat(Screen Util): Added abitily to enable or disable screen util gen…
Coloud1 Aug 8, 2024
b2fe1d8
feat(PostGen): Added conditional statement
Coloud1 Aug 8, 2024
849e47c
feat(Screen Util): Added several generation statements
Coloud1 Aug 8, 2024
11eadfc
feat(Screen Unit): added const modifier and updated statement
Coloud1 Aug 8, 2024
a643e90
feat(Branch Selector): Updated branch selector logic
Coloud1 Aug 8, 2024
21c6a80
feat(Pubspec): Downgraded intl dependency to 0.18.1 and updated proje…
Coloud1 Aug 8, 2024
371145b
feat(UI): Updated UI and navigation logic
Coloud1 Aug 8, 2024
cbba9a8
feat(Pubspec): Downgraded intl to 0.18.1
Coloud1 Aug 8, 2024
ac4cb73
feat(documentation): documentation update
fedorenkoalex Aug 8, 2024
35a343a
feat(documentation): how to docs update
fedorenkoalex Aug 8, 2024
5b8c555
feat(documentation): how to docs update
fedorenkoalex Aug 9, 2024
3ad4238
Merge pull request #88 from Onix-Systems/feature/update-29
cozvtieg9 Aug 9, 2024
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
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
</div>

<br/>
<br/>

<div align="center"><strong>Create your new Flutter project just in a few clicks.</strong><br>Flutter project generator is as an open source utility for MacOS designed to provide a quick start with your Flutter application development.<br />
<div align="center"><strong>How does it work? Watch the video!</strong></div>

<div align="center">
<a href="https://www.youtube.com/watch?v=E8kBX7HoqMU">
<img alt="refine logo" src="images/watch_yt_normal.png">
</a>
</div>

<br/>
<div align="center"><strong>Create your new Flutter project just in a few clicks.</strong><br>Flutter project generator is an open source utility for MacOS designed to provide a quick start with your Flutter application development.<br/>
<br/>
</div>
<div align="center">
Expand All @@ -33,7 +41,7 @@ If you're a Onix Project Generator user and you like using our tool, don't **for

## What is Project Generator?

**Flutter Project Generator** is a utility for **MacOS** designed to quickly start a Flutter project from scratch.
**Flutter Project Generator** is an utility for **MacOS** designed to quickly start a Flutter project from scratch.

**Flutter Project Generator** creates an empty project on **Clean Architecture** with already defined file structure and dependencies.

Expand All @@ -58,7 +66,6 @@ Generated project tech consist of such libraries and packages:
* **State Management** - [BLoC](https://pub.dev/packages/flutter_bloc).
* **Networking** - [Dio](https://pub.dev/packages/dio).
* **Service Locator** - [GetIt](https://pub.dev/packages/get_it)
* **UI** - [ScreenUtil](https://pub.dev/packages/flutter_screenutil)
* **Code generator** - [Freezed](https://pub.dev/packages/freezed)
* **Navigation** - [GoRouter](https://pub.dev/packages/go_router) or [AutoRoute](https://pub.dev/packages/auto_route)

Expand All @@ -69,6 +76,7 @@ Also there an option to select **optional packages to include** to the project:
* **Flavors** - [Flavorizr](https://pub.dev/packages/flutter_flavorizr)
* **Localization** - [Intl](https://pub.dev/packages/intl_utils)
* **Theming** - [ThemeTailor](https://pub.dev/packages/theme_tailor)
* **UI** - [ScreenUtil](https://pub.dev/packages/flutter_screenutil)


## Key Features
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//@formatter:off
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
{{^web_only}}import 'package:loader_overlay/loader_overlay.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';{{/web_only}}
import 'package:{{project_name}}/core/arch/bloc/base_block_state.dart';
{{^web_only}}import 'package:loader_overlay/loader_overlay.dart';{{/web_only}}
{{#screen_util}}import 'package:flutter_screenutil/flutter_screenutil.dart';{{/screen_util}}
import 'package:{{project_name}}/core/arch/bloc/base_bloc_state.dart';
import 'package:{{project_name}}/app/bloc/app_bloc_imports.dart';
import 'package:{{project_name}}/presentation/style/theme/theme_imports.dart';
{{#isGoRouter}}import 'package:{{project_name}}/app/router/app_router.dart';{{/isGoRouter}}
Expand All @@ -30,11 +30,12 @@ class _AppState extends BaseState<AppScreenState, AppBloc, AppSR, App> {
{{#isGoRouter}}AppRouter.init();{{/isGoRouter}}
return {{^web_only}}GlobalLoaderOverlay(
overlayColor: Colors.black.withOpacity(0.5),
child: ScreenUtilInit(
child: {{/web_only}}
{{#screen_util}}ScreenUtilInit(
designSize: const Size(375, 812),
minTextAdapt: true,
builder: (context, child) {
return{{/web_only}} blocBuilder(
return{{/screen_util}} blocBuilder(
builder: (context, state) {
return MaterialApp.router(
debugShowCheckedModeBanner: false,
Expand Down Expand Up @@ -83,10 +84,25 @@ class _AppState extends BaseState<AppScreenState, AppBloc, AppSR, App> {
{{/handLocalization}}
);
},
{{^web_only}}
{{#screen_util}}
);
},
{{#web_only}}
);
{{/web_only}}
{{^web_only}}
),
);
{{/web_only}}
{{/screen_util}}
{{^screen_util}}
{{#web_only}}
);
},
),{{/web_only}}
);
{{/web_only}}
{{^web_only}}
),
);
{{/web_only}}
{{/screen_util}}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Constants {
const Constants._();

final class Constants {
static const String filterParamAll = 'All';

const Constants._();
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
//@formatter:off
{{^isGoRouter}}import 'package:auto_route/auto_route.dart';{{/isGoRouter}}
{{#isGoRouter}}import 'package:{{project_name}}/app/router/app_route.dart';{{/isGoRouter}}
{{#isGoRouter}}import 'package:flutter_bloc/flutter_bloc.dart';{{/isGoRouter}}
import 'package:flutter/material.dart';
{{#isGoRouter}}import 'package:go_router/go_router.dart';{{/isGoRouter}}
{{#isGoRouter}}import 'package:{{project_name}}/core/di/services.dart';{{/isGoRouter}}
{{^isGoRouter}}import 'package:{{project_name}}/app/router/guard/init_guard.dart';{{/isGoRouter}}

//{imports end}

{{^isGoRouter}}
part 'app_router.gr.dart';

@AutoRouterConfig(){{/isGoRouter}}
class AppRouter {{^isGoRouter}}extends _$AppRouter{{/isGoRouter}}{
class AppRouter {{^isGoRouter}}extends RootStackRouter{{/isGoRouter}}{
{{#isGoRouter}}static const _initialLocation = '/';

static final AppRouter _instance = AppRouter._privateConstructor();
Expand Down Expand Up @@ -45,12 +41,13 @@ class AppRouter {{^isGoRouter}}extends _$AppRouter{{/isGoRouter}}{
//{routes end}
];

final InitGuard init;
@override
late final List<AutoRouteGuard> guards;

@override
RouteType get defaultRouteType => const RouteType.adaptive();

AppRouter({
required this.init,
}) : super();{{/isGoRouter}}
required List<AutoRouteGuard> globalGuards,
}) : guards = globalGuards;{{/isGoRouter}}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:{{project_name}}/app/router/router_logging_observer.dart';

abstract class RouterModule {
AppRouter appRouter() {
return AppRouter(init: InitGuard());
return AppRouter(globalGuards: [InitGuard()]);
}

RouterLoggingObserver routerLoggingObserver(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{{^web_only}}import 'package:flutter_screenutil/flutter_screenutil.dart';{{/web_only}}
{{#screen_util}}import 'package:flutter_screenutil/flutter_screenutil.dart';{{/screen_util}}

class Dimensions {
{{^web_only}}static final delimiterH10 = 10.h;{{/web_only}}
{{#web_only}}static final delimiterH10 = 10.0;{{/web_only}}
}
final class Dimensions {
{{#screen_util}} static final delimiterH10 = 10.h;{{/screen_util}}
{{^screen_util}} static const delimiterH10 = 10.0;{{/screen_util}}

const Dimensions._();
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:{{project_name}}/core/arch/widget/common/toast.dart';
import 'package:{{project_name}}/core/arch/logger/app_logger_impl.dart';
import 'package:flutter/material.dart';
import 'package:{{project_name}}/core/arch/logger/app_logger_impl.dart';
import 'package:{{project_name}}/core/arch/widget/common/toast.dart';

class QaUtils {
final class QaUtils {
static Widget buildCharlesProxyBtn(_) {
return const SizedBox();
//TODO SHOW set proxy ONLY FOR QA BUILDS
Expand Down Expand Up @@ -84,4 +84,6 @@ class QaUtils {
builder: (context) => alert,
);
}

const QaUtils._();
}
Original file line number Diff line number Diff line change
@@ -1,52 +1,17 @@
import 'dart:async';

import 'package:{{project_name}}/core/arch/bloc/sr_mixin.dart';
import 'package:{{project_name}}/core/arch/domain/entity/failure/failure.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:{{project_name}}/core/arch/bloc/failure_stream_mixin.dart';
import 'package:{{project_name}}/core/arch/bloc/progress_stream_mixin.dart';
import 'package:{{project_name}}/core/arch/bloc/sr_mixin.dart';

abstract class BaseBloc<Event, State, SR> extends Bloc<Event, State>
with SingleResultMixin<Event, State, SR> {
@protected
late StreamController<Failure> _errorStreamController;

@protected
late StreamController<bool> _progressStreamController;

Stream<Failure> get failureStream => _errorStreamController.stream;

Stream<bool> get progressStream => _progressStreamController.stream;

BaseBloc(super.initialState) {
_errorStreamController = StreamController<Failure>.broadcast();
_progressStreamController = StreamController<bool>.broadcast();
}

void showProgress() {
if (!_progressStreamController.isClosed) {
_progressStreamController.add(true);
}
}

Future<void> hideProgress() async {
await Future<void>.delayed(const Duration(milliseconds: 50));
if (!_progressStreamController.isClosed) {
_progressStreamController.add(false);
}
}

void onFailure(Failure failure) {
if (!_errorStreamController.isClosed) {
_errorStreamController.add(failure);
}
}
with
SingleResultMixin<Event, State, SR>,
ProgressStreamMixin,
FailureStreamMixin {
BaseBloc(super.initialState);

void dispose() {
if (!_errorStreamController.isClosed) {
_errorStreamController.close();
}
if (!_progressStreamController.isClosed) {
_progressStreamController.close();
}
closeProgressStream();
closeFailureStream();
}
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
//@formatter:off
import 'package:{{project_name}}/core/arch/bloc/base_bloc.dart';
import 'package:{{project_name}}/core/arch/bloc/bloc_builders_mixin.dart';
import 'package:{{project_name}}/core/arch/bloc/bloc_typedefs.dart';
import 'package:{{project_name}}/core/arch/bloc/stream_listener.dart';
import 'package:{{project_name}}/core/arch/domain/entity/progress_state/progress_state.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:get_it/get_it.dart';
{{^web_only}}import 'package:loader_overlay/loader_overlay.dart';{{/web_only}}
{{#web_only}}import 'package:flutter_overlay_loader/flutter_overlay_loader.dart';
import 'package:{{project_name}}/core/extension/loader.dart';{{/web_only}}


typedef ListenDelegate<S> = void Function(BuildContext context, S state);
typedef StateListener<S> = Widget Function(S state);
typedef SingleResultListener<SR> = void Function(
BuildContext context,
SR singleResult,
);
import 'package:{{project_name}}/app/util/extension/loader.dart';{{/web_only}}

abstract class BaseState<S, B extends BaseBloc<dynamic, S, SR>, SR,
W extends StatefulWidget> extends State<W> {
W extends StatefulWidget> extends State<W>
with BlocBuildersMixin<B, S, SR> {
bool lazyBloc = false;
B? _bloc;

Expand Down Expand Up @@ -47,7 +43,7 @@ abstract class BaseState<S, B extends BaseBloc<dynamic, S, SR>, SR,
context.loaderOverlay.hide();
}{{/web_only}}
if (_bloc != null) {
_bloc?.dispose();
_bloc?.dispose();
}
super.dispose();
}
Expand All @@ -70,35 +66,16 @@ abstract class BaseState<S, B extends BaseBloc<dynamic, S, SR>, SR,
);
}

Widget blocConsumer({
required StateListener<S> stateListener,
required ListenDelegate<S>? listenDelegate,
BlocBuilderCondition<S>? buildWhen,
BlocListenerCondition<S>? listenWhen,
}) {
return BlocConsumer<B, S>(
builder: (_, state) => stateListener(state),
listener: listenDelegate ?? _defaultListenDelegate,
buildWhen: buildWhen,
listenWhen: listenWhen,
);
}

Widget blocBuilder({
required BlocWidgetBuilder<S> builder,
BlocBuilderCondition<S>? buildWhen,
}) {
return BlocBuilder<B, S>(builder: builder, buildWhen: buildWhen);
}

void onBlocCreated(BuildContext context, B bloc) {
bloc.progressStream.listen((event) async {
if (event) {
{{#web_only}}context.progressShow();{{/web_only}}
{{^web_only}}context.loaderOverlay.show();{{/web_only}}
} else {
{{#web_only}}context.progressHide();{{/web_only}}
{{^web_only}}context.loaderOverlay.hide();{{/web_only}}
if (event is DefaultProgressState) {
if (event.showProgress) {
{{#web_only}}context.progressShow();{{/web_only}}
{{^web_only}}context.loaderOverlay.show();{{/web_only}}
} else {
{{#web_only}}context.progressHide();{{/web_only}}
{{^web_only}}context.loaderOverlay.hide();{{/web_only}}
}
}
});
}
Expand All @@ -107,7 +84,4 @@ abstract class BaseState<S, B extends BaseBloc<dynamic, S, SR>, SR,
void initParams(BuildContext context) {}

Widget buildWidget(BuildContext context);

// ignore: no-empty-block
void _defaultListenDelegate(BuildContext context, S state) {}
}
Loading