Skip to content

Commit 28f3948

Browse files
committed
chore: fix packages warnings
1 parent c19b7cf commit 28f3948

File tree

17 files changed

+57
-36
lines changed

17 files changed

+57
-36
lines changed

frontend/app_flowy/packages/flowy_infra_ui/example/lib/keyboard/keyboard_screen.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ class KeyboardScreen extends StatefulWidget {
2222
const KeyboardScreen({Key? key}) : super(key: key);
2323

2424
@override
25-
_KeyboardScreenState createState() => _KeyboardScreenState();
25+
State<KeyboardScreen> createState() => _KeyboardScreenState();
2626
}
2727

2828
class _KeyboardScreenState extends State<KeyboardScreen> {
2929
bool _isKeyboardVisible = false;
30-
final TextEditingController _controller = TextEditingController(text: 'Hello Flowy');
30+
final TextEditingController _controller =
31+
TextEditingController(text: 'Hello Flowy');
3132

3233
@override
3334
Widget build(BuildContext context) {

frontend/app_flowy/packages/flowy_infra_ui/example/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dependencies:
1414
path: ../
1515

1616
cupertino_icons: ^1.0.2
17+
provider:
1718

1819
dev_dependencies:
1920
flutter_test:

frontend/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_overlay.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ class FlowyOverlayState extends State<FlowyOverlay> {
398398

399399
if (style.blur) {
400400
child = BackdropFilter(
401-
child: child,
402401
filter: ImageFilter.blur(sigmaX: 4, sigmaY: 4),
402+
child: child,
403403
);
404404
}
405405
}

frontend/app_flowy/packages/flowy_infra_ui/lib/src/keyboard/keyboard_visibility_detector.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ class KeyboardVisibilityDetector extends StatefulWidget {
1414
final void Function(bool)? onKeyboardVisibilityChange;
1515

1616
@override
17-
_KeyboardVisibilityDetectorState createState() => _KeyboardVisibilityDetectorState();
17+
State<KeyboardVisibilityDetector> createState() =>
18+
_KeyboardVisibilityDetectorState();
1819
}
1920

20-
class _KeyboardVisibilityDetectorState extends State<KeyboardVisibilityDetector> {
21+
class _KeyboardVisibilityDetectorState
22+
extends State<KeyboardVisibilityDetector> {
2123
FlowyInfraUIPlatform get _platform => FlowyInfraUIPlatform.instance;
2224

2325
bool isObserving = false;
@@ -27,7 +29,8 @@ class _KeyboardVisibilityDetectorState extends State<KeyboardVisibilityDetector>
2729
@override
2830
void initState() {
2931
super.initState();
30-
_keyboardSubscription = _platform.onKeyboardVisibilityChange.listen((newValue) {
32+
_keyboardSubscription =
33+
_platform.onKeyboardVisibilityChange.listen((newValue) {
3134
setState(() {
3235
isKeyboardVisible = newValue;
3336
if (widget.onKeyboardVisibilityChange != null) {
@@ -62,7 +65,8 @@ class _KeyboardVisibilityDetectorInheritedWidget extends InheritedWidget {
6265
final bool isKeyboardVisible;
6366

6467
@override
65-
bool updateShouldNotify(_KeyboardVisibilityDetectorInheritedWidget oldWidget) {
68+
bool updateShouldNotify(
69+
_KeyboardVisibilityDetectorInheritedWidget oldWidget) {
6670
return isKeyboardVisible != oldWidget.isKeyboardVisible;
6771
}
6872
}

frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/container.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ class FlowyContainer extends StatelessWidget {
3131
return AnimatedContainer(
3232
width: width,
3333
height: height,
34-
child: child,
3534
margin: margin,
3635
alignment: align,
3736
duration: duration ?? Durations.medium,
3837
decoration: BoxDecoration(
3938
color: color,
4039
borderRadius: borderRadius,
4140
boxShadow: shadows,
42-
border: border));
41+
border: border),
42+
child: child);
4343
}
4444
}

frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/hover.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class _FlowyHoverState extends State<FlowyHover> {
5151
child: child,
5252
);
5353
} else {
54-
return Container(child: child, color: widget.style.backgroundColor);
54+
return Container(color: widget.style.backgroundColor, child: child);
5555
}
5656
}
5757
}

frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/icon_button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class FlowyIconButton extends StatelessWidget {
5757
onPressed: onPressed,
5858
child: Padding(
5959
padding: iconPadding,
60-
child: SizedBox.fromSize(child: child, size: childSize),
60+
child: SizedBox.fromSize(size: childSize, child: child),
6161
),
6262
),
6363
),

frontend/app_flowy/packages/flowy_infra_ui/lib/style_widget/scrolling/styled_scrollview.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ class StyledSingleChildScrollView extends StatefulWidget {
2727
}) : super(key: key);
2828

2929
@override
30-
_StyledSingleChildScrollViewState createState() => _StyledSingleChildScrollViewState();
30+
State<StyledSingleChildScrollView> createState() =>
31+
StyledSingleChildScrollViewState();
3132
}
3233

33-
class _StyledSingleChildScrollViewState extends State<StyledSingleChildScrollView> {
34+
class StyledSingleChildScrollViewState
35+
extends State<StyledSingleChildScrollView> {
3436
late ScrollController scrollController;
3537

3638
@override
@@ -92,10 +94,10 @@ class StyledCustomScrollView extends StatefulWidget {
9294
}) : super(key: key);
9395

9496
@override
95-
_StyledCustomScrollViewState createState() => _StyledCustomScrollViewState();
97+
StyledCustomScrollViewState createState() => StyledCustomScrollViewState();
9698
}
9799

98-
class _StyledCustomScrollViewState extends State<StyledCustomScrollView> {
100+
class StyledCustomScrollViewState extends State<StyledCustomScrollView> {
99101
late ScrollController controller;
100102

101103
@override

frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/base_styled_button.dart

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ class BaseStyledButton extends StatefulWidget {
4545
}) : super(key: key);
4646

4747
@override
48-
_BaseStyledBtnState createState() => _BaseStyledBtnState();
48+
State<BaseStyledButton> createState() => BaseStyledBtnState();
4949
}
5050

51-
class _BaseStyledBtnState extends State<BaseStyledButton> {
51+
class BaseStyledBtnState extends State<BaseStyledButton> {
5252
late FocusNode _focusNode;
5353
bool _isFocused = false;
5454

@@ -79,9 +79,16 @@ class _BaseStyledBtnState extends State<BaseStyledButton> {
7979
borderRadius: widget.borderRadius ?? Corners.s10Border,
8080
boxShadow: _isFocused
8181
? [
82-
BoxShadow(color: theme.shader6, offset: Offset.zero, blurRadius: 8.0, spreadRadius: 0.0),
8382
BoxShadow(
84-
color: widget.bgColor ?? theme.surface, offset: Offset.zero, blurRadius: 8.0, spreadRadius: -4.0),
83+
color: theme.shader6,
84+
offset: Offset.zero,
85+
blurRadius: 8.0,
86+
spreadRadius: 0.0),
87+
BoxShadow(
88+
color: widget.bgColor ?? theme.surface,
89+
offset: Offset.zero,
90+
blurRadius: 8.0,
91+
spreadRadius: -4.0),
8592
]
8693
: [],
8794
),
@@ -112,20 +119,21 @@ class _BaseStyledBtnState extends State<BaseStyledButton> {
112119
hoverColor: widget.hoverColor ?? theme.hover,
113120
highlightColor: widget.downColor ?? theme.main1,
114121
focusColor: widget.focusColor ?? Colors.grey.withOpacity(0.35),
115-
child: Opacity(
116-
child: Padding(
117-
padding: widget.contentPadding ?? EdgeInsets.all(Insets.m),
118-
child: widget.child,
119-
),
120-
opacity: widget.onPressed != null ? 1 : .7,
121-
),
122-
constraints: BoxConstraints(minHeight: widget.minHeight ?? 0, minWidth: widget.minWidth ?? 0),
122+
constraints: BoxConstraints(
123+
minHeight: widget.minHeight ?? 0, minWidth: widget.minWidth ?? 0),
123124
onPressed: widget.onPressed,
124125
shape: widget.shape ??
125126
RoundedRectangleBorder(
126127
side: BorderSide(color: widget.outlineColor, width: 1.5),
127128
borderRadius: widget.borderRadius ?? Corners.s10Border,
128129
),
130+
child: Opacity(
131+
opacity: widget.onPressed != null ? 1 : .7,
132+
child: Padding(
133+
padding: widget.contentPadding ?? EdgeInsets.all(Insets.m),
134+
child: widget.child,
135+
),
136+
),
129137
),
130138
);
131139
}

frontend/app_flowy/packages/flowy_infra_ui/lib/widget/buttons/primary_button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class PrimaryButton extends StatelessWidget {
3838
hoverColor: theme.main1,
3939
downColor: theme.main1,
4040
borderRadius: bigMode ? Corners.s12Border : Corners.s8Border,
41-
child: child,
4241
onPressed: onPressed,
42+
child: child,
4343
);
4444
}
4545
}

0 commit comments

Comments
 (0)