Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bed8ace

Browse files
committed
Adopt flutter_lints 1.0
1 parent f2c87a3 commit bed8ace

File tree

114 files changed

+458
-374
lines changed

Some content is hidden

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

114 files changed

+458
-374
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"dart.lineLength": 120
3+
}

analysis_options.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
include: package:flutter_lints/flutter.yaml
2+
13
analyzer:
24
exclude:
3-
- "**/*.g.dart"
4-
- "**/*.freezed.dart"
5+
- "**/*.g.dart"
6+
- "**/*.freezed.dart"
57
language:
68
strict-inference: true
79
strong-mode:
@@ -10,7 +12,5 @@ analyzer:
1012
missing_required_param: error
1113
linter:
1214
rules:
13-
always-specify-types: true
14-
always_declare_return_types: true
15-
prefer-relative-imports: true
16-
avoid_types_on_closure_parameters: false
15+
avoid_print: false
16+
constant_identifier_names: false

lib/_spikes/button_sheet.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import 'package:flutter_folio/styled_widgets/buttons/styled_buttons.dart';
55
import 'package:flutter_folio/styled_widgets/styled_spacers.dart';
66

77
class ButtonSheet extends StatelessWidget {
8+
const ButtonSheet({Key? key}) : super(key: key);
9+
810
@override
911
Widget build(BuildContext context) {
10-
final underline = BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey)));
12+
const underline = BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey)));
1113
Widget _center(Widget w) => Container(child: w, height: 100, decoration: underline, alignment: Alignment.center);
1214
return GestureDetector(
1315
onTap: InputUtils.unFocus,

lib/_spikes/optimized_drag_stack/my_movable_box.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class BoxTransformData extends ChangeNotifier {
99
BoxTransformData({this.offset = Offset.zero, this.scale = 1});
1010

1111
@override
12+
// ignore: unnecessary_overrides
1213
void notifyListeners() => super.notifyListeners();
1314
}
1415

lib/_spikes/optimized_drag_stack/optimized_drag_stack.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ List<BoxTransformData> _boxes = List.generate(
1616

1717
// Create a Stack that will render each Box
1818
class OptimizedDragStack extends StatefulWidget {
19+
const OptimizedDragStack({Key? key}) : super(key: key);
20+
1921
@override
2022
_OptimizedDragStackState createState() => _OptimizedDragStackState();
2123
}
@@ -44,6 +46,7 @@ class _OptimizedDragStackState extends State<OptimizedDragStack> {
4446
}
4547
}
4648

49+
@override
4750
Widget build(BuildContext context) {
4851
return MaterialApp(
4952
home: Scaffold(
@@ -75,7 +78,7 @@ class _SquareImage extends StatelessWidget {
7578
width: 100 * scale,
7679
height: 100 * scale,
7780
child: Container(
78-
padding: EdgeInsets.all(20),
81+
padding: const EdgeInsets.all(20),
7982
color: RandomColor().randomColor(),
8083
child: CachedNetworkImage(
8184
imageUrl:

lib/_spikes/popup_menu_spike/popup_panel_spike.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import 'package:flutter_folio/views/editor_page/scrap_popup_editor/animated_menu
88
import 'package:flutter_folio/views/editor_page/scrap_popup_editor/scrap_popup_editor.dart';
99

1010
class PopupPanelSpike extends StatefulWidget {
11+
const PopupPanelSpike({Key? key}) : super(key: key);
12+
1113
@override
1214
_PopupPanelSpikeState createState() => _PopupPanelSpikeState();
1315
}
@@ -30,7 +32,7 @@ class _PopupPanelSpikeState extends State<PopupPanelSpike> {
3032
//Positioned(child: ControlPanel(), left: 100, top: 100),
3133

3234
Transform.translate(
33-
offset: Offset(100, 50),
35+
offset: const Offset(100, 50),
3436
//child: _ExamplePopupPanel(),
3537
child: ScrapPopupEditor(
3638
onRotChanged: (value) {
@@ -69,7 +71,6 @@ class _ExamplePopupPanelState extends State<_ExamplePopupPanel> {
6971
childBuilder: childBuilder);
7072
}
7173

72-
;
7374
timeDilation = 1;
7475
double row1Height = 60;
7576
double row2Height = 40;
@@ -96,15 +97,15 @@ class _ExamplePopupPanelState extends State<_ExamplePopupPanel> {
9697
..._sortChildrenWithSelectedOnTop([
9798
/// TOP ROW
9899
animatedPanel(
99-
Offset(0, 0), // Pos(row: 0, item: 0)
100+
const Offset(0, 0), // Pos(row: 0, item: 0)
100101
Size(150, row1Height),
101102
index: 0,
102103
openHeight: 100,
103104
childBuilder: (bool isOpen) => Content("CONTROL-1", Colors.green, isOpen: isOpen),
104105
),
105106

106107
animatedPanel(
107-
Offset(150, 0), // Pos(row: 0, item: 1)
108+
const Offset(150, 0), // Pos(row: 0, item: 1)
108109
Size(150, row1Height),
109110
index: 1,
110111
openHeight: 100,
@@ -163,7 +164,7 @@ class Content extends StatelessWidget {
163164
key: ValueKey(isOpen),
164165
child: Stack(fit: StackFit.expand, children: [
165166
if (isOpen == false) Text(lbl),
166-
if (isOpen) Center(child: Text(lbl, style: TextStyle(fontSize: 32)))
167+
if (isOpen) Center(child: Text(lbl, style: const TextStyle(fontSize: 32)))
167168
]),
168169
),
169170
);

lib/_spikes/tab_bug_repro.dart

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

33
class TabBugRepro extends StatelessWidget {
4+
const TabBugRepro({Key? key}) : super(key: key);
5+
46
@override
57
Widget build(BuildContext context) {
68
return MaterialApp(
79
home: Scaffold(
810
body: Column(
911
children: [
10-
TextButton(onPressed: () {}, child: Text("btn")),
12+
TextButton(onPressed: () {}, child: const Text("btn")),
1113
Flexible(
1214
child: IndexedStack(
1315
index: 0,
1416
children: [
15-
SomeView(),
17+
const SomeView(),
1618
ExcludeFocus(
1719
excluding: true,
18-
child: FocusTraversalGroup(child: SomeView()),
20+
child: FocusTraversalGroup(child: const SomeView()),
1921
)
2022
],
2123
)),
@@ -27,11 +29,13 @@ class TabBugRepro extends StatelessWidget {
2729
}
2830

2931
class SomeView extends StatelessWidget {
32+
const SomeView({Key? key}) : super(key: key);
33+
3034
@override
3135
Widget build(BuildContext context) {
3236
return Row(children: [
33-
TextButton(onPressed: () {}, child: Text("FOO")),
34-
TextButton(onPressed: () {}, child: Text("BAR")),
37+
TextButton(onPressed: () {}, child: const Text("FOO")),
38+
TextButton(onPressed: () {}, child: const Text("BAR")),
3539
]);
3640
}
3741
}

lib/_utils/context_utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ContextUtils {
99
} catch (e) {
1010
print(e);
1111
}
12-
return Size(1, 1);
12+
return const Size(1, 1);
1313
}
1414

1515
static Offset localToGlobal(BuildContext c, {Offset local = Offset.zero}) {

lib/_utils/file_utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ class FileUtils {
1616
} catch (e) {
1717
print("$e");
1818
}
19-
return null;
19+
return;
2020
}
2121
}

lib/_utils/native_window_utils/macos_window_utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'dart:math';
44
import 'package:flutter/services.dart';
55

66
class MacosWindowUtils {
7-
static const methodChannel = const MethodChannel("flutterfolio.com/io");
7+
static const methodChannel = MethodChannel("flutterfolio.com/io");
88
static const kMinTitlebarHeight = 24.0;
99
static const kDefaultTitlebarHeight = 24.0;
1010
static double _calculatedTitlebarHeight = 0.0;

0 commit comments

Comments
 (0)