Skip to content

Commit 80f8178

Browse files
authored
Merge pull request #116 from Onix-Systems/dev
Update 1.3.0 (30)
2 parents 56b2476 + 93a61db commit 80f8178

File tree

301 files changed

+6290
-5573
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

301 files changed

+6290
-5573
lines changed

Makefile

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11

2-
build:
3-
@flutter clean
4-
@flutter build macos --release
2+
build_macos:
3+
@rm -rf release
4+
fvm flutter clean
5+
fvm flutter build macos --release
56
@mkdir release
67
@appdmg installers/dmg_creator/config.json release/Onix_Flutter_Project_Generator.dmg
8+
9+
build_runner:
10+
fvm dart run build_runner build --delete-conflicting-outputs
11+
12+
codegen:
13+
dart run build_runner build --delete-conflicting-outputs

README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,16 @@
1818
<br/>
1919

2020
<div align="center"><strong>How does it work? Watch the video!</strong></div>
21+
<br/>
22+
23+
https://github.com/user-attachments/assets/5fd10595-2964-4006-8926-4715e1032cba
2124

25+
<br/>
2226
<div align="center">
2327
<a href="https://www.youtube.com/watch?v=E8kBX7HoqMU">
2428
<img alt="refine logo" src="images/watch_yt_normal.png">
2529
</a>
30+
2631
</div>
2732

2833
<br/>
@@ -77,7 +82,7 @@ Also there an option to select **optional packages to include** to the project:
7782
* **Localization** - [Intl](https://pub.dev/packages/intl_utils)
7883
* **Theming** - [ThemeTailor](https://pub.dev/packages/theme_tailor)
7984
* **UI** - [ScreenUtil](https://pub.dev/packages/flutter_screenutil)
80-
85+
* **Monitor and capture errors** - [Sentry](https://pub.dev/packages/sentry_flutter)
8186

8287
## Key Features
8388

@@ -108,4 +113,4 @@ If you have any doubts related to the project or want to discuss something, then
108113

109114
## License
110115

111-
Licensed under the MIT License, Copyright (c) 2023-present Onix-Systems
116+
Licensed under the MIT License, Copyright (c) 2024-present Onix-Systems

analysis_options.yaml

+246-15
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,253 @@ analyzer:
1414
- "bricks/**"
1515
- '**/*.g.dart'
1616
- '**/*.freezed.dart'
17+
- "lib/app/localization/**"
18+
19+
errors:
20+
prefer_mixin: ignore
21+
flutter_style_todos: ignore
22+
invalid_annotation_target: ignore
23+
always_use_package_imports: warning
24+
avoid_dynamic_calls: info
25+
avoid_empty_else: error
26+
avoid_print: warning
27+
avoid_relative_lib_imports: warning
28+
avoid_returning_null_for_future: error
29+
avoid_slow_async_io: warning
30+
avoid_type_to_string: error
31+
avoid_types_as_parameter_names: info
32+
avoid_web_libraries_in_flutter: error
33+
cancel_subscriptions: error
34+
close_sinks: error
35+
comment_references: info
36+
control_flow_in_finally: error
37+
empty_statements: error
38+
hash_and_equals: error
39+
iterable_contains_unrelated_type: error
40+
list_remove_unrelated_type: error
41+
literal_only_boolean_expressions: warning
42+
no_adjacent_strings_in_list: error
43+
no_duplicate_case_values: error
44+
no_logic_in_create_state: error
45+
prefer_void_to_null: error
46+
test_types_in_equals: error
47+
throw_in_finally: error
48+
unnecessary_statements: error
49+
unrelated_type_equality_checks: error
50+
unsafe_html: error
51+
use_build_context_synchronously: info
52+
use_key_in_widget_constructors: info
53+
valid_regexps: error
54+
missing_required_param: error
55+
missing_return: error
56+
collection_methods_unrelated_type: warning
57+
avoid_final_parameters: error
58+
cast_nullable_to_non_nullable: warning
59+
implicit_call_tearoffs: info
1760

1861
linter:
19-
# The lint rules applied to this project can be customized in the
20-
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
21-
# included above or to enable additional rules. A list of all available lints
22-
# and their documentation is published at
23-
# https://dart-lang.github.io/linter/lints/index.html.
24-
#
25-
# Instead of disabling a lint rule for the entire project in the
26-
# section below, it can also be suppressed for a single line of code
27-
# or a specific dart file by using the `// ignore: name_of_lint` and
28-
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
29-
# producing the lint.
3062
rules:
31-
# avoid_print: false # Uncomment to disable the `avoid_print` rule
32-
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
63+
# Const rules.
64+
prefer_const_constructors: true
65+
prefer_const_constructors_in_immutables: true
66+
prefer_const_declarations: true
67+
prefer_const_literals_to_create_immutables: true
68+
unnecessary_const: true
69+
unnecessary_late: true
70+
71+
# Error rules.
72+
always_use_package_imports: true
73+
avoid_empty_else: true
74+
avoid_print: true
75+
avoid_relative_lib_imports: true
76+
avoid_slow_async_io: true
77+
avoid_type_to_string: true
78+
avoid_types_as_parameter_names: true
79+
avoid_web_libraries_in_flutter: true
80+
cancel_subscriptions: true
81+
close_sinks: true
82+
control_flow_in_finally: true
83+
empty_statements: true
84+
hash_and_equals: true
85+
collection_methods_unrelated_type: true
86+
literal_only_boolean_expressions: true
87+
no_adjacent_strings_in_list: true
88+
no_duplicate_case_values: true
89+
no_logic_in_create_state: true
90+
prefer_void_to_null: true
91+
test_types_in_equals: true
92+
throw_in_finally: true
93+
unnecessary_statements: true
94+
unrelated_type_equality_checks: true
95+
unsafe_html: true
96+
use_build_context_synchronously: true
97+
use_key_in_widget_constructors: true
98+
valid_regexps: true
99+
avoid_dynamic_calls: true
100+
invalid_case_patterns: true
101+
102+
# Style rules.
103+
always_declare_return_types: true
104+
always_put_required_named_parameters_first: true
105+
annotate_overrides: true
106+
avoid_annotating_with_dynamic: true
107+
avoid_bool_literals_in_conditional_expressions: true
108+
avoid_catching_errors: true
109+
avoid_equals_and_hash_code_on_mutable_classes: true
110+
avoid_escaping_inner_quotes: true
111+
avoid_field_initializers_in_const_classes: true
112+
avoid_function_literals_in_foreach_calls: true
113+
avoid_implementing_value_types: true
114+
avoid_init_to_null: true
115+
avoid_js_rounded_ints: true
116+
avoid_multiple_declarations_per_line: true
117+
avoid_null_checks_in_equality_operators: true
118+
avoid_positional_boolean_parameters: true
119+
avoid_private_typedef_functions: true
120+
avoid_renaming_method_parameters: true
121+
avoid_return_types_on_setters: true
122+
avoid_returning_null_for_void: true
123+
avoid_returning_this: true
124+
avoid_setters_without_getters: true
125+
avoid_shadowing_type_parameters: true
126+
avoid_single_cascade_in_expression_statements: true
127+
avoid_types_on_closure_parameters: true
128+
avoid_unnecessary_containers: true
129+
avoid_unused_constructor_parameters: true
130+
avoid_void_async: true
131+
await_only_futures: true
132+
camel_case_extensions: true
133+
camel_case_types: true
134+
cascade_invocations: true
135+
constant_identifier_names: true
136+
curly_braces_in_flow_control_structures: true
137+
deprecated_consistency: true
138+
directives_ordering: true
139+
do_not_use_environment: true
140+
empty_catches: true
141+
empty_constructor_bodies: true
142+
exhaustive_cases: true
143+
file_names: true
144+
implementation_imports: true
145+
leading_newlines_in_multiline_strings: true
146+
library_names: true
147+
library_prefixes: true
148+
missing_whitespace_between_adjacent_strings: true
149+
no_runtimeType_toString: true
150+
non_constant_identifier_names: true
151+
null_closures: true
152+
omit_local_variable_types: true
153+
one_member_abstracts: true
154+
only_throw_errors: true
155+
overridden_fields: true
156+
package_api_docs: true
157+
parameter_assignments: true
158+
prefer_adjacent_string_concatenation: true
159+
prefer_asserts_in_initializer_lists: true
160+
prefer_collection_literals: true
161+
prefer_conditional_assignment: true
162+
prefer_constructors_over_static_methods: true
163+
prefer_contains: true
164+
prefer_final_fields: true
165+
prefer_final_in_for_each: true
166+
prefer_final_locals: true
167+
prefer_for_elements_to_map_fromIterable: true
168+
prefer_function_declarations_over_variables: true
169+
prefer_generic_function_type_aliases: true
170+
prefer_if_elements_to_conditional_expressions: true
171+
prefer_if_null_operators: true
172+
prefer_initializing_formals: true
173+
prefer_inlined_adds: true
174+
prefer_interpolation_to_compose_strings: true
175+
prefer_is_empty: true
176+
prefer_is_not_empty: true
177+
prefer_is_not_operator: true
178+
prefer_iterable_whereType: true
179+
prefer_mixin: true
180+
prefer_null_aware_operators: true
181+
prefer_single_quotes: true
182+
prefer_spread_collections: true
183+
prefer_typing_uninitialized_variables: true
184+
provide_deprecation_message: true
185+
public_member_api_docs: false
186+
recursive_getters: true
187+
sized_box_for_whitespace: true
188+
slash_for_doc_comments: true
189+
sort_child_properties_last: true
190+
sort_constructors_first: false
191+
sort_unnamed_constructors_first: false
192+
type_annotate_public_apis: true
193+
type_init_formals: true
194+
unawaited_futures: true
195+
unnecessary_await_in_return: true
196+
unnecessary_brace_in_string_interps: true
197+
unnecessary_getters_setters: true
198+
unnecessary_lambdas: true
199+
unnecessary_new: true
200+
unnecessary_null_aware_assignments: true
201+
unnecessary_null_checks: true
202+
unnecessary_null_in_if_null_operators: true
203+
unnecessary_nullable_for_final_variable_declarations: true
204+
unnecessary_overrides: true
205+
unnecessary_parenthesis: true
206+
unnecessary_raw_strings: true
207+
unnecessary_string_escapes: true
208+
unnecessary_string_interpolations: true
209+
unnecessary_this: true
210+
use_full_hex_values_for_flutter_colors: true
211+
use_function_type_syntax_for_parameters: true
212+
use_if_null_to_convert_nulls_to_bools: true
213+
use_is_even_rather_than_modulo: true
214+
use_late_for_private_fields_and_variables: true
215+
use_named_constants: true
216+
use_raw_strings: true
217+
use_rethrow_when_possible: true
218+
use_setters_to_change_properties: true
219+
use_string_buffers: true
220+
use_to_and_as_if_applicable: true
221+
void_checks: true
222+
lines_longer_than_80_chars: true
223+
flutter_style_todos: true
224+
conditional_uri_does_not_exist: true
225+
no_leading_underscores_for_library_prefixes: true
226+
no_leading_underscores_for_local_identifiers: true
227+
secure_pubspec_urls: true
228+
sized_box_shrink_expand: true
229+
use_decorated_box: true
230+
use_colored_box: true
231+
avoid_double_and_int_checks: true
232+
avoid_final_parameters: true
233+
avoid_redundant_argument_values: true
234+
cast_nullable_to_non_nullable: true
235+
combinators_ordering: true
236+
dangling_library_doc_comments: true
237+
eol_at_end_of_file: true
238+
implicit_call_tearoffs: true
239+
join_return_with_assignment: true
240+
library_private_types_in_public_api: true
241+
no_default_cases: true
242+
noop_primitive_operations: true
243+
null_check_on_nullable_type_parameter: true
244+
package_prefixed_library_names: true
245+
prefer_asserts_with_message: true
246+
prefer_int_literals: true
247+
prefer_null_aware_method_calls: true
248+
require_trailing_commas: true
249+
tighten_type_of_initializing_formals: true
250+
unnecessary_constructor_name: true
251+
unnecessary_library_directive: true
252+
unnecessary_to_list_in_spreads: true
253+
use_enums: true
254+
use_string_in_part_of_directives: true
255+
use_super_parameters: true
256+
use_test_throws_matchers: true
257+
unnecessary_breaks: true
258+
259+
# Pub rules.
260+
package_names: true
261+
depend_on_referenced_packages: true
33262

34-
# Additional information about this file can be found at
35-
# https://dart.dev/guides/language/analysis-options
263+
#https://github.com/dart-lang/lints/blob/main/lib/core.yaml
264+
#https://github.com/dart-lang/lints/blob/main/lib/recommended.yaml
265+
#https://github.com/flutter/packages/blob/master/packages/flutter_lints/lib/flutter.yaml
266+
#https://pub.dev/packages/dart_code_metrics
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
APIKEY1 = 'APIKEY1'
2-
APIKEY2 = 'APIKEY2'
1+
APIKEY1=APIKEY1
2+
APIKEY2=APIKEY2

bricks/flutter_clean_base/__brick__/{{project_name.snakeCase()}}/lib/app.gen.dart

+18-13
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import 'package:flutter/cupertino.dart';
33
import 'package:flutter/material.dart';
44
{{^web_only}}import 'package:loader_overlay/loader_overlay.dart';{{/web_only}}
55
{{#screen_util}}import 'package:flutter_screenutil/flutter_screenutil.dart';{{/screen_util}}
6-
import 'package:{{project_name}}/core/arch/bloc/base_bloc_state.dart';
7-
import 'package:{{project_name}}/app/bloc/app_bloc_imports.dart';
86
import 'package:{{project_name}}/presentation/style/theme/theme_imports.dart';
7+
import 'package:{{project_name}}/core/arch/widget/common/theme_switcher.dart';
98
{{#isGoRouter}}import 'package:{{project_name}}/app/router/app_router.dart';{{/isGoRouter}}
109
{{^isGoRouter}}import 'package:{{project_name}}/core/di/app.dart';{{/isGoRouter}}
1110
{{^handLocalization}}import 'package:flutter_localizations/flutter_localizations.dart';{{/handLocalization}}
1211
{{#handLocalization}}import 'package:{{project_name}}/app/localization/common_app_localization_ext.dart';
1312
import 'package:flutter_gen/gen_l10n/app_localizations.dart';{{/handLocalization}}
1413
{{#flavorizr}}import 'package:{{project_name}}/core/arch/widget/common/flavor_banner.dart';{{/flavorizr}}
1514
{{^handLocalization}}import 'package:{{project_name}}/app/localization/generated/l10n.dart';{{/handLocalization}}
15+
{{^isGoRouter}}{{#sentry}}import 'package:sentry_flutter/sentry_flutter.dart';{{/sentry}}{{/isGoRouter}}
1616

1717
class App extends StatefulWidget {
1818
const App({super.key});
@@ -21,12 +21,11 @@ class App extends StatefulWidget {
2121
State<App> createState() => _AppState();
2222
}
2323

24-
class _AppState extends BaseState<AppScreenState, AppBloc, AppSR, App> {
24+
class _AppState extends State<App> {
2525
Locale? locale;
2626

27-
2827
@override
29-
Widget buildWidget(BuildContext context) {
28+
Widget build(BuildContext context) {
3029
{{#isGoRouter}}AppRouter.init();{{/isGoRouter}}
3130
return {{^web_only}}GlobalLoaderOverlay(
3231
overlayColor: Colors.black.withOpacity(0.5),
@@ -35,8 +34,9 @@ class _AppState extends BaseState<AppScreenState, AppBloc, AppSR, App> {
3534
designSize: const Size(375, 812),
3635
minTextAdapt: true,
3736
builder: (context, child) {
38-
return{{/screen_util}} blocBuilder(
39-
builder: (context, state) {
37+
return{{/screen_util}}
38+
ThemeModeSwitcher(
39+
builder: (context, themeMode, _) {
4040
return MaterialApp.router(
4141
debugShowCheckedModeBanner: false,
4242
builder: (context, widget) {
@@ -55,12 +55,17 @@ class _AppState extends BaseState<AppScreenState, AppBloc, AppSR, App> {
5555
scrollBehavior: const CupertinoScrollBehavior(),
5656
theme: createLightTheme(),
5757
darkTheme: createDarkTheme(),
58-
themeMode: state.themeMode,
59-
{{#isGoRouter}}routeInformationProvider: AppRouter.router.routeInformationProvider,{{/isGoRouter}}
60-
routeInformationParser: {{#isGoRouter}}AppRouter.router.routeInformationParser,{{/isGoRouter}}
61-
{{^isGoRouter}}appRouter().defaultRouteParser(),{{/isGoRouter}}
62-
routerDelegate: {{#isGoRouter}}AppRouter.router.routerDelegate,{{/isGoRouter}}
63-
{{^isGoRouter}}appRouter().delegate(),{{/isGoRouter}}
58+
themeMode: themeMode,
59+
{{^isGoRouter}}
60+
{{^sentry}}routerConfig: appRouter().config(),{{/sentry}}
61+
{{#sentry}}routerConfig: appRouter().config(
62+
navigatorObservers: () => [
63+
SentryNavigatorObserver(),
64+
],
65+
),
66+
{{/sentry}}
67+
{{/isGoRouter}}
68+
{{#isGoRouter}}routerConfig: AppRouter.router,{{/isGoRouter}}
6469
locale: locale,
6570
{{^handLocalization}}
6671
localizationsDelegates: const [

0 commit comments

Comments
 (0)