Skip to content

Commit ea4b2b0

Browse files
Merge pull request #13 from bancolombia/feature/upgrade_package
update package dependencies and smell code
2 parents a820cac + 82708dd commit ea4b2b0

25 files changed

+366
-165
lines changed

.github/CODEOWNERS.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
* @juan-campuzano
1+
* @juan-campuzano
2+
* @bancolombia/ingenieria-de-software

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: flutter-actions/setup-flutter@v3
1616
with:
1717
channel: stable
18-
version: 3.24.0
18+
version: 3.32.0
1919
- name: Install dependencies
2020
run: flutter pub get
2121
- name: Run tests

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: flutter-actions/setup-flutter@v3
2020
with:
2121
channel: stable
22-
version: 3.24.0
22+
version: 3.32.0
2323
- name: Install dependencies
2424
run: dart pub get
2525
- name: Publish to pub.dev

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ migrate_working_dir/
3131
.pub-cache/
3232
.pub/
3333
/build/
34-
/analysis_options.yaml
3534
/codemagic.yaml
3635
/pubspec.lock
3736
/coverage

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
2+
## 1.5.0
3+
- Update to flutter `>= 3.27.0`.
4+
- Minor patch fixes.
25

36
## 1.4.0
47
- Update dependencies to be compatible with flutter 3.24 and removed `cupertino_icons`.

analysis_options.yaml

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
linter:
4+
rules:
5+
avoid_print: true
6+
avoid_unnecessary_containers: true
7+
avoid_web_libraries_in_flutter: true
8+
no_logic_in_create_state: false
9+
prefer_const_constructors: true
10+
prefer_const_constructors_in_immutables: true
11+
prefer_const_declarations: true
12+
prefer_const_literals_to_create_immutables: true
13+
sized_box_for_whitespace: true
14+
use_full_hex_values_for_flutter_colors: true
15+
always_declare_return_types: true
16+
cancel_subscriptions: true
17+
close_sinks: true
18+
comment_references: false
19+
one_member_abstracts: false
20+
only_throw_errors: true
21+
package_api_docs: true
22+
prefer_single_quotes: true
23+
sort_child_properties_last: true
24+
camel_case_types: true
25+
library_names: true
26+
avoid_relative_lib_imports: false
27+
file_names: true
28+
library_prefixes: true
29+
non_constant_identifier_names: true
30+
constant_identifier_names: false
31+
directives_ordering: true
32+
curly_braces_in_flow_control_structures: true
33+
slash_for_doc_comments: false
34+
prefer_interpolation_to_compose_strings: true
35+
prefer_collection_literals: true
36+
avoid_function_literals_in_foreach_calls: false
37+
avoid_init_to_null: true
38+
prefer_initializing_formals: true
39+
type_init_formals: true
40+
empty_constructor_bodies: true
41+
empty_statements: true
42+
unnecessary_new: true
43+
unnecessary_this: true
44+
unnecessary_const: true
45+
unnecessary_overrides: true
46+
unnecessary_parenthesis: true
47+
unnecessary_getters_setters: true
48+
avoid_setters_without_getters: true
49+
avoid_return_types_on_setters: true
50+
parameter_assignments: true
51+
prefer_function_declarations_over_variables: false
52+
unawaited_futures: true
53+
prefer_relative_imports: true
54+
annotate_overrides: false
55+
overridden_fields: false
56+
implementation_imports: false
57+
no_leading_underscores_for_local_identifiers: true
58+
depend_on_referenced_packages: false
59+
use_super_parameters: true
60+
use_build_context_synchronously: true
61+
62+
analyzer:
63+
errors:
64+
missing_required_param: error
65+
missing_return: error
66+
parameter_assignments: error
67+
use_setters_to_change_properties: ignore
68+
deprecated_member_use: warning
69+
deprecated_member_use_from_same_package: warning
70+
no_leading_underscores_for_local_identifiers: warning
71+
use_super_parameters: warning
72+
use_build_context_synchronously: warning
73+
todo: warning
74+
exclude:
75+
- "**.mocks.dart"
76+
- "**.g.dart"
77+
plugins:
78+
- dart_code_linter
79+
80+
dart_code_linter:
81+
metrics:
82+
cyclomatic-complexity: 20
83+
maximum-nesting-level: 5
84+
number-of-methods: 10
85+
source-lines-of-code: 250
86+
metrics-exclude:
87+
- test/**
88+
rules:
89+
- avoid-non-null-assertion #IS001​
90+
- avoid-dynamic #IS015​
91+
- avoid-returning-widgets #IS021
92+
- avoid-nested-conditional-expressions #IS024​
93+
- avoid-unnecessary-type-casts #IS030
94+
- avoid-unnecessary-conditionals
95+
- avoid-unused-parameters: #Cuidado puede afectar la retro compatibilidad
96+
severity: none
97+
- missing-test-assertion #IS035
98+
- newline-before-return: #comentar en proyectos anteriores para no geenrar mucho ruido
99+
severity: none
100+
- no-boolean-literal-compare
101+
- no-empty-block # Quitarla puede ser una opcion
102+
- no-equal-then-else
103+
- no-magic-number
104+
- prefer-trailing-comma: #S/N​
105+
severity: none
106+
- prefer-conditional-expressions
107+
- prefer-immediate-return
108+
- prefer-moving-to-variable
109+
- format-comment:
110+
only-doc-comments: true
111+
- member-ordering:
112+
order:
113+
- constructors
114+
- public-fields
115+
- private-fields
116+
- close-method
117+
- dispose-method
118+
widgets-order:
119+
- constructor
120+
- build-method
121+
- init-state-method
122+
- did-change-dependencies-method
123+
- did-update-widget-method
124+
- dispose-method
125+
#Flutter
126+
- always-remove-listener
127+
- avoid-unnecessary-setstate
128+
- prefer-extracting-callbacks
129+
- prefer-using-list-view
130+
- avoid-ignoring-return-values:
131+
severity: none
132+
- avoid-passing-async-when-sync-expected:
133+
exclude:
134+
- test/**
135+
- avoid-unnecessary-type-assertions
136+
- avoid-unrelated-type-assertions
137+
- double-literal-format
138+
- prefer-async-await
139+
- prefer-correct-identifier-length:
140+
max-identifier-length: 35
141+
min-identifier-length: 3
142+
- prefer-correct-test-file-name
143+
- prefer-correct-type-name:
144+
min-length: 3
145+
max-length: 35
146+
- prefer-first
147+
- prefer-last
148+
- prefer-match-file-name:
149+
exclude:
150+
- test/**
151+
- avoid-border-all
152+
- avoid-expanded-as-spacer
153+
- avoid-wrapping-in-padding
154+
- no-blank-line-before-single-return
155+
- prefer-first-or-null
156+
- prefer-single-quotes
157+
158+
anti-patterns:
159+
- long-method
160+
- long-parameter-list

example/lib/src/presentation/core/app_widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
33
import '../home/home_page.dart';
44

55
class AppWidget extends StatelessWidget {
6-
const AppWidget({Key? key}) : super(key: key);
6+
const AppWidget({super.key});
77

88
@override
99
Widget build(BuildContext context) {

example/lib/src/presentation/home/home_page.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import 'package:flutter/material.dart';
33
import 'widgets/image_loader_widget.dart';
44

55
class HomePage extends StatefulWidget {
6-
const HomePage({Key? key, required this.title}) : super(key: key);
6+
const HomePage({
7+
super.key,
8+
required this.title,
9+
});
710

811
final String title;
912

@@ -23,10 +26,10 @@ class _HomePageState extends State<HomePage> {
2326
),
2427
),
2528
),
26-
body: Center(
29+
body: const Center(
2730
child: Column(
2831
mainAxisAlignment: MainAxisAlignment.center,
29-
children: const <Widget>[
32+
children: <Widget>[
3033
ImageLoaderWidget(),
3134
],
3235
),

example/lib/src/presentation/home/widgets/button_widget.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
import 'package:flutter/material.dart';
22

33
class ButtonWidget extends StatelessWidget {
4-
const ButtonWidget({Key? key}) : super(key: key);
4+
const ButtonWidget({super.key});
55

66
@override
77
Widget build(BuildContext context) {
88
return ElevatedButton(
99
style: ButtonStyle(elevation: WidgetStateProperty.all(10)),
1010
onPressed: () {},
11-
child: Row(
11+
child: const Row(
1212
mainAxisAlignment: MainAxisAlignment.spaceAround,
13-
children: const [
13+
children: [
1414
Text(
15-
"CIBSANS",
15+
'CIBSANS',
1616
style: TextStyle(
1717
fontFamily: 'CIBFontSans-Light',
1818
),
1919
),
2020
Text(
21-
"ROBOTO",
21+
'ROBOTO',
2222
style: TextStyle(
2323
fontFamily: 'Roboto-Regular',
2424
fontWeight: FontWeight.bold,

example/lib/src/presentation/home/widgets/image_loader_widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:flutter/material.dart';
22

33
class ImageLoaderWidget extends StatelessWidget {
4-
const ImageLoaderWidget({Key? key}) : super(key: key);
4+
const ImageLoaderWidget({super.key});
55

66
@override
77
Widget build(BuildContext context) {

0 commit comments

Comments
 (0)