Skip to content

Commit 60ad53c

Browse files
committed
chore: replaced pedantic with flutter_lints for static analysis
also formatted and fixed analysis issues
1 parent bcfa7f0 commit 60ad53c

File tree

10 files changed

+60
-34
lines changed

10 files changed

+60
-34
lines changed

analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include: package:pedantic/analysis_options.yaml
1+
include: package:flutter_lints/flutter.yaml

example/.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"file_picker","path":"/Users/danvick/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-4.0.3/","dependencies":[]},{"name":"permission_handler","path":"/Users/danvick/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.1.6/","dependencies":[]}],"android":[{"name":"file_picker","path":"/Users/danvick/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-4.0.3/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/danvick/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.3/","dependencies":[]},{"name":"permission_handler","path":"/Users/danvick/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.1.6/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[{"name":"file_picker","path":"/Users/danvick/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-4.0.3/","dependencies":[]}]},"dependencyGraph":[{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"permission_handler","dependencies":[]}],"date_created":"2021-09-18 20:37:20.695677","version":"2.5.0"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"file_picker","path":"/Users/danvick/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-4.2.0/","dependencies":[]},{"name":"permission_handler","path":"/Users/danvick/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.2.6/","dependencies":[]}],"android":[{"name":"file_picker","path":"/Users/danvick/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-4.2.0/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/danvick/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.4/","dependencies":[]},{"name":"permission_handler","path":"/Users/danvick/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.2.6/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[{"name":"file_picker","path":"/Users/danvick/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-4.2.0/","dependencies":[]}]},"dependencyGraph":[{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"permission_handler","dependencies":[]}],"date_created":"2021-11-06 13:33:48.487180","version":"2.5.1"}

example/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
**/doc/api/
2525
.dart_tool/
2626
.flutter-plugins
27+
.flutter-plugins-dependencies
2728
.packages
2829
.pub-cache/
2930
.pub/

example/lib/main.dart

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,26 @@ import 'package:flutter/material.dart';
22
import 'package:flutter_form_builder/flutter_form_builder.dart';
33
import 'package:form_builder_file_picker/form_builder_file_picker.dart';
44

5-
void main() => runApp(MyApp());
5+
void main() => runApp(const MyApp());
66

77
class MyApp extends StatelessWidget {
8+
const MyApp({Key? key}) : super(key: key);
9+
810
@override
911
Widget build(BuildContext context) {
1012
return MaterialApp(
1113
title: 'Flutter Demo',
1214
theme: ThemeData(
1315
primarySwatch: Colors.blue,
1416
),
15-
home: MyHomePage(),
17+
home: const MyHomePage(),
1618
);
1719
}
1820
}
1921

2022
class MyHomePage extends StatefulWidget {
23+
const MyHomePage({Key? key}) : super(key: key);
24+
2125
@override
2226
_MyHomePageState createState() => _MyHomePageState();
2327
}
@@ -30,45 +34,45 @@ class _MyHomePageState extends State<MyHomePage> {
3034
Widget build(BuildContext context) {
3135
return Scaffold(
3236
appBar: AppBar(
33-
title: Text('FormBuilder FilePicker Example'),
37+
title: const Text('FormBuilder FilePicker Example'),
3438
),
3539
body: Padding(
36-
padding: EdgeInsets.all(10),
40+
padding: const EdgeInsets.all(10),
3741
child: FormBuilder(
3842
key: _formKey,
3943
child: Column(
4044
children: <Widget>[
4145
FormBuilderFilePicker(
4246
name: 'images',
43-
decoration: InputDecoration(labelText: 'Attachments'),
47+
decoration: const InputDecoration(labelText: 'Attachments'),
4448
maxFiles: null,
4549
allowMultiple: true,
4650
previewImages: true,
47-
onChanged: (val) => print(val),
51+
onChanged: (val) => debugPrint(val.toString()),
4852
selector: Row(
49-
children: <Widget>[
53+
children: const <Widget>[
5054
Icon(Icons.file_upload),
5155
Text('Upload'),
5256
],
5357
),
5458
onFileLoading: (val) {
55-
print(val);
59+
debugPrint(val.toString());
5660
},
5761
customFileViewerBuilder:
5862
_useCustomFileViewer ? customFileViewerBuilder : null,
5963
),
60-
SizedBox(height: 20),
64+
const SizedBox(height: 20),
6165
Row(
6266
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
6367
children: [
6468
ElevatedButton(
65-
child: Text('Submit'),
69+
child: const Text('Submit'),
6670
onPressed: () {
6771
_formKey.currentState!.save();
68-
print(_formKey.currentState!.value);
72+
debugPrint(_formKey.currentState!.value.toString());
6973
},
7074
),
71-
Spacer(),
75+
const Spacer(),
7276
ElevatedButton(
7377
child: Text(_useCustomFileViewer
7478
? 'Use Default File Viewer'
@@ -96,17 +100,17 @@ class _MyHomePageState extends State<MyHomePage> {
96100
itemBuilder: (context, index) {
97101
final file = files![index];
98102
return ListTile(
99-
title: Text(file.name!),
103+
title: Text(file.name),
100104
trailing: IconButton(
101-
icon: Icon(Icons.delete),
105+
icon: const Icon(Icons.delete),
102106
onPressed: () {
103107
files.removeAt(index);
104108
setter.call([...files]);
105109
},
106110
),
107111
);
108112
},
109-
separatorBuilder: (context, index) => Divider(
113+
separatorBuilder: (context, index) => const Divider(
110114
color: Colors.blueAccent,
111115
),
112116
itemCount: files!.length,

example/pubspec.lock

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ packages:
8383
url: "https://pub.dartlang.org"
8484
source: hosted
8585
version: "6.0.1"
86+
flutter_lints:
87+
dependency: "direct dev"
88+
description:
89+
name: flutter_lints
90+
url: "https://pub.dartlang.org"
91+
source: hosted
92+
version: "1.0.4"
8693
flutter_localizations:
8794
dependency: transitive
8895
description: flutter
@@ -126,6 +133,13 @@ packages:
126133
url: "https://pub.dartlang.org"
127134
source: hosted
128135
version: "0.6.3"
136+
lints:
137+
dependency: transitive
138+
description:
139+
name: lints
140+
url: "https://pub.dartlang.org"
141+
source: hosted
142+
version: "1.0.1"
129143
matcher:
130144
dependency: transitive
131145
description:
@@ -153,7 +167,7 @@ packages:
153167
name: permission_handler
154168
url: "https://pub.dartlang.org"
155169
source: hosted
156-
version: "8.2.5"
170+
version: "8.2.6"
157171
permission_handler_platform_interface:
158172
dependency: transitive
159173
description:

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ environment:
99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
1312
flutter_form_builder: ^6.0.0
1413
form_builder_file_picker:
1514
path: ../
1615

1716
dev_dependencies:
17+
flutter_lints: ^1.0.4
1818
flutter_test:
1919
sdk: flutter
2020

example/test/widget_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import 'package:example/main.dart';
1313
void main() {
1414
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
1515
// Build our app and trigger a frame.
16-
await tester.pumpWidget(MyApp());
16+
await tester.pumpWidget(const MyApp());
1717

1818
// Verify that our counter starts at 0.
1919
expect(find.text('0'), findsOneWidget);

lib/src/form_builder_file_picker.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ class FormBuilderFilePicker extends FormBuilderField<List<PlatformFile>> {
128128
customFileViewerBuilder != null
129129
? customFileViewerBuilder.call(state._files,
130130
(files) => state._setFiles(files ?? [], field))
131-
: state.defaultFileViewer(state._files, field as FormFieldState<List<PlatformFile>>),
131+
: state.defaultFileViewer(state._files,
132+
field as FormFieldState<List<PlatformFile>>),
132133
],
133134
),
134135
);

pubspec.lock

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ packages:
8383
url: "https://pub.dartlang.org"
8484
source: hosted
8585
version: "6.0.1"
86+
flutter_lints:
87+
dependency: "direct dev"
88+
description:
89+
name: flutter_lints
90+
url: "https://pub.dartlang.org"
91+
source: hosted
92+
version: "1.0.4"
8693
flutter_localizations:
8794
dependency: transitive
8895
description: flutter
@@ -119,6 +126,13 @@ packages:
119126
url: "https://pub.dartlang.org"
120127
source: hosted
121128
version: "0.6.3"
129+
lints:
130+
dependency: transitive
131+
description:
132+
name: lints
133+
url: "https://pub.dartlang.org"
134+
source: hosted
135+
version: "1.0.1"
122136
matcher:
123137
dependency: transitive
124138
description:
@@ -140,20 +154,13 @@ packages:
140154
url: "https://pub.dartlang.org"
141155
source: hosted
142156
version: "1.8.0"
143-
pedantic:
144-
dependency: "direct dev"
145-
description:
146-
name: pedantic
147-
url: "https://pub.dartlang.org"
148-
source: hosted
149-
version: "1.11.0"
150157
permission_handler:
151158
dependency: "direct main"
152159
description:
153160
name: permission_handler
154161
url: "https://pub.dartlang.org"
155162
source: hosted
156-
version: "8.2.5"
163+
version: "8.2.6"
157164
permission_handler_platform_interface:
158165
dependency: transitive
159166
description:

pubspec.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ environment:
77
sdk: '>=2.12.0 <3.0.0'
88

99
dependencies:
10+
community_material_icon: ^5.9.55
11+
file_picker: ^4.2.0
1012
flutter:
1113
sdk: flutter
12-
1314
flutter_form_builder: ^6.0.1
14-
file_picker: ^4.2.0
15-
permission_handler: ^8.2.5
16-
community_material_icon: ^5.9.55
15+
permission_handler: ^8.2.6
1716

1817
dev_dependencies:
18+
flutter_lints: ^1.0.4
1919
flutter_test:
2020
sdk: flutter
21-
pedantic: ^1.11.0
2221
flutter:

0 commit comments

Comments
 (0)