Skip to content

Commit 0782f8c

Browse files
committed
formatted code
1 parent d2e086b commit 0782f8c

File tree

5 files changed

+105
-112
lines changed

5 files changed

+105
-112
lines changed

lib/components/alert/gf_alert.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,11 @@ class GFAlert extends StatefulWidget {
6161
}
6262

6363
class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
64-
6564
AnimationController animationController;
6665
Animation<double> animation;
6766

6867
@override
6968
void initState() {
70-
7169
animationController = AnimationController(
7270
duration: const Duration(milliseconds: 300),
7371
vsync: this,

lib/components/badge/gf_badge.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class _GFBadgeState extends State<GFBadge> {
6969
}
7070

7171
@override
72-
void didUpdateWidget(GFBadge oldWidget){
72+
void didUpdateWidget(GFBadge oldWidget) {
7373
color = widget.color;
7474
textColor = widget.textColor;
7575
child = widget.text != null ? Text(widget.text ?? '') : widget.child;

lib/components/badge/gf_button_badge.dart

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import 'package:flutter/widgets.dart';
44
import 'package:flutter/material.dart';
55
import 'package:getflutter/getflutter.dart';
66

7-
87
class GFButtonBadge extends StatefulWidget {
98
/// Create badges badges of all types. check out [GFIconButton] for icon badges, and [GFBadge] for badges
109
const GFButtonBadge({
@@ -48,9 +47,9 @@ class GFButtonBadge extends StatefulWidget {
4847
this.disabledTextColor,
4948
this.icon,
5049
}) : materialTapTargetSize =
51-
materialTapTargetSize ?? MaterialTapTargetSize.padded,
50+
materialTapTargetSize ?? MaterialTapTargetSize.padded,
5251
assert(shape != null, 'Button shape can not be null'),
53-
// assert(elevation != null && elevation >= 0.0),
52+
// assert(elevation != null && elevation >= 0.0),
5453
assert(focusElevation != null && focusElevation >= 0.0),
5554
assert(hoverElevation != null && hoverElevation >= 0.0),
5655
assert(highlightElevation != null && highlightElevation >= 0.0),
@@ -59,15 +58,17 @@ class GFButtonBadge extends StatefulWidget {
5958
assert(animationDuration != null),
6059
assert(clipBehavior != null),
6160
assert(autofocus != null),
62-
super(key: key, );
61+
super(
62+
key: key,
63+
);
6364

6465
/// Called when the button is tapped or otherwise activated.
6566
final VoidCallback onPressed;
6667

6768
/// Called by the underlying [InkWell] widget's InkWell.onHighlightChanged callback.
6869
final ValueChanged<bool> onHighlightChanged;
6970

70-
/// Defines the default text style, with [Material.textStyle], for the button's [child].
71+
/// Defines the default text style, with [Material.textStyle], for the button's child.
7172
final TextStyle textStyle;
7273

7374
/// The border side for the badge's [Material].
@@ -103,7 +104,7 @@ class GFButtonBadge extends StatefulWidget {
103104
/// The elevation for the badge's [Material] when the badge is not [enabled].
104105
final double disabledElevation;
105106

106-
/// The internal padding for the badge's [child].
107+
/// The internal padding for the badge's child.
107108
final EdgeInsetsGeometry padding;
108109

109110
/// Defines the badge's size.
@@ -227,53 +228,51 @@ class GFButtonBadge extends StatefulWidget {
227228
class _GFButtonBadgeState extends State<GFButtonBadge> {
228229
@override
229230
Widget build(BuildContext context) => ConstrainedBox(
230-
constraints: const BoxConstraints(
231-
minHeight: 26,
232-
minWidth: 98,
233-
),
234-
child: Container(
235-
height: widget.size,
236-
child: GFButton(
237-
onPressed: widget.onPressed,
238-
onHighlightChanged: widget.onHighlightChanged,
239-
textStyle: widget.textStyle,
240-
boxShadow: widget.boxShadow,
241-
buttonBoxShadow: widget.badgeBoxShadow,
242-
focusColor: widget.focusColor,
243-
hoverColor: widget.hoverColor,
244-
highlightColor: widget.highlightColor,
245-
splashColor: widget.splashColor,
246-
elevation: widget.elevation,
247-
focusElevation: widget.focusElevation,
248-
hoverElevation: widget.hoverElevation,
249-
highlightElevation: widget.highlightElevation,
250-
disabledElevation: widget.disabledElevation,
251-
constraints: widget.constraints,
252-
borderShape: widget.borderShape,
253-
animationDuration: widget.animationDuration,
254-
clipBehavior: widget.clipBehavior,
255-
focusNode: widget.focusNode,
256-
autofocus: widget.autofocus,
257-
type: widget.type,
258-
shape: widget.shape,
259-
color: widget.color,
260-
textColor: widget.textColor,
261-
position: widget.position,
262-
size: widget.size,
263-
borderSide: widget.borderSide,
264-
text: widget.text,
265-
icon: widget.icon,
266-
blockButton: widget.blockButton,
267-
fullWidthButton: widget.fullWidthButton,
268-
disabledColor: widget.disabledTextColor,
269-
disabledTextColor: widget.disabledColor,
270-
),
271-
),
272-
);
231+
constraints: const BoxConstraints(
232+
minHeight: 26,
233+
minWidth: 98,
234+
),
235+
child: Container(
236+
height: widget.size,
237+
child: GFButton(
238+
onPressed: widget.onPressed,
239+
onHighlightChanged: widget.onHighlightChanged,
240+
textStyle: widget.textStyle,
241+
boxShadow: widget.boxShadow,
242+
buttonBoxShadow: widget.badgeBoxShadow,
243+
focusColor: widget.focusColor,
244+
hoverColor: widget.hoverColor,
245+
highlightColor: widget.highlightColor,
246+
splashColor: widget.splashColor,
247+
elevation: widget.elevation,
248+
focusElevation: widget.focusElevation,
249+
hoverElevation: widget.hoverElevation,
250+
highlightElevation: widget.highlightElevation,
251+
disabledElevation: widget.disabledElevation,
252+
constraints: widget.constraints,
253+
borderShape: widget.borderShape,
254+
animationDuration: widget.animationDuration,
255+
clipBehavior: widget.clipBehavior,
256+
focusNode: widget.focusNode,
257+
autofocus: widget.autofocus,
258+
type: widget.type,
259+
shape: widget.shape,
260+
color: widget.color,
261+
textColor: widget.textColor,
262+
position: widget.position,
263+
size: widget.size,
264+
borderSide: widget.borderSide,
265+
text: widget.text,
266+
icon: widget.icon,
267+
blockButton: widget.blockButton,
268+
fullWidthButton: widget.fullWidthButton,
269+
disabledColor: widget.disabledTextColor,
270+
disabledTextColor: widget.disabledColor,
271+
),
272+
),
273+
);
273274
}
274275

275-
276-
277276
//
278277
//class GFButtonBadge extends GFButton {
279278
//

lib/components/button/gf_button.dart

Lines changed: 49 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -741,8 +741,6 @@
741741
// }
742742
//}
743743

744-
745-
746744
import 'dart:math' as math;
747745
import 'package:flutter/foundation.dart';
748746
import 'package:flutter/gestures.dart';
@@ -795,9 +793,9 @@ class GFButton extends StatefulWidget {
795793
this.disabledColor,
796794
this.disabledTextColor,
797795
}) : materialTapTargetSize =
798-
materialTapTargetSize ?? MaterialTapTargetSize.padded,
796+
materialTapTargetSize ?? MaterialTapTargetSize.padded,
799797
assert(shape != null, 'Button shape can not be null'),
800-
// assert(elevation != null && elevation >= 0.0),
798+
// assert(elevation != null && elevation >= 0.0),
801799
assert(focusElevation != null && focusElevation >= 0.0),
802800
assert(hoverElevation != null && hoverElevation >= 0.0),
803801
assert(highlightElevation != null && highlightElevation >= 0.0),
@@ -1010,8 +1008,6 @@ class _GFButtonState extends State<GFButton> {
10101008
super.initState();
10111009
}
10121010

1013-
1014-
10151011
bool get _hovered => _states.contains(MaterialState.hovered);
10161012
bool get _focused => _states.contains(MaterialState.focused);
10171013
bool get _pressed => _states.contains(MaterialState.pressed);
@@ -1165,8 +1161,8 @@ class _GFButtonState extends State<GFButton> {
11651161
widget.type == GFButtonType.transparent) {
11661162
return widget.enabled
11671163
? textColor == null
1168-
? color == GFColors.TRANSPARENT ? GFColors.DARK : color
1169-
: textColor
1164+
? color == GFColors.TRANSPARENT ? GFColors.DARK : color
1165+
: textColor
11701166
: getDisabledTextColor();
11711167
}
11721168
if (textColor == null) {
@@ -1183,13 +1179,13 @@ class _GFButtonState extends State<GFButton> {
11831179
final Color effectiveTextColor = MaterialStateProperty.resolveAs<Color>(
11841180
widget.textStyle?.color, _states);
11851181
final Color themeColor =
1186-
Theme.of(context).colorScheme.onSurface.withOpacity(0.12);
1182+
Theme.of(context).colorScheme.onSurface.withOpacity(0.12);
11871183
final BorderSide outlineBorder = BorderSide(
11881184
color: color == null
11891185
? themeColor
11901186
: widget.borderSide == null
1191-
? getBorderColor()
1192-
: widget.borderSide.color,
1187+
? getBorderColor()
1188+
: widget.borderSide.color,
11931189
width: widget.borderSide?.width == null
11941190
? widget.type == GFButtonType.outline2x ? 2.0 : 1.0
11951191
: widget.borderSide?.width,
@@ -1209,13 +1205,13 @@ class _GFButtonState extends State<GFButton> {
12091205
}
12101206

12111207
final BorderSide shapeBorder = widget.type == GFButtonType.outline ||
1212-
widget.type == GFButtonType.outline2x
1208+
widget.type == GFButtonType.outline2x
12131209
? outlineBorder
12141210
: widget.borderSide ??
1215-
BorderSide(
1216-
color: color == null ? themeColor : getBorderColor(),
1217-
width: 0,
1218-
);
1211+
BorderSide(
1212+
color: color == null ? themeColor : getBorderColor(),
1213+
width: 0,
1214+
);
12191215

12201216
if (shape == GFButtonShape.pills) {
12211217
shapeBorderType = RoundedRectangleBorder(
@@ -1248,31 +1244,31 @@ class _GFButtonState extends State<GFButton> {
12481244
} else {
12491245
return BoxDecoration(
12501246
color: widget.type == GFButtonType.transparent ||
1251-
widget.type == GFButtonType.outline ||
1252-
widget.type == GFButtonType.outline2x
1247+
widget.type == GFButtonType.outline ||
1248+
widget.type == GFButtonType.outline2x
12531249
? Colors.transparent
12541250
: color,
12551251
borderRadius: widget.shape == GFButtonShape.pills
12561252
? BorderRadius.circular(50)
12571253
: widget.shape == GFButtonShape.standard
1258-
? BorderRadius.circular(5)
1259-
: BorderRadius.zero,
1254+
? BorderRadius.circular(5)
1255+
: BorderRadius.zero,
12601256
boxShadow: [
12611257
widget.boxShadow == null && widget.buttonBoxShadow == true
12621258
? BoxShadow(
1263-
color: themeColor,
1264-
blurRadius: 1.5,
1265-
spreadRadius: 2,
1266-
offset: Offset.zero,
1267-
)
1259+
color: themeColor,
1260+
blurRadius: 1.5,
1261+
spreadRadius: 2,
1262+
offset: Offset.zero,
1263+
)
12681264
: widget.boxShadow != null
1269-
? widget.boxShadow
1270-
: BoxShadow(
1271-
color: Theme.of(context).canvasColor,
1272-
blurRadius: 0,
1273-
spreadRadius: 0,
1274-
offset: Offset.zero,
1275-
),
1265+
? widget.boxShadow
1266+
: BoxShadow(
1267+
color: Theme.of(context).canvasColor,
1268+
blurRadius: 0,
1269+
spreadRadius: 0,
1270+
offset: Offset.zero,
1271+
),
12761272
],
12771273
);
12781274
}
@@ -1348,25 +1344,25 @@ class _GFButtonState extends State<GFButton> {
13481344
widthFactor: 1,
13491345
heightFactor: 1,
13501346
child: icon != null &&
1351-
(position == GFPosition.start || position == null)
1347+
(position == GFPosition.start || position == null)
13521348
? Row(
1353-
mainAxisSize: MainAxisSize.min,
1354-
children: <Widget>[
1355-
icon,
1356-
const SizedBox(width: 8),
1357-
child
1358-
],
1359-
)
1349+
mainAxisSize: MainAxisSize.min,
1350+
children: <Widget>[
1351+
icon,
1352+
const SizedBox(width: 8),
1353+
child
1354+
],
1355+
)
13601356
: icon != null && (position == GFPosition.end)
1361-
? Row(
1362-
mainAxisSize: MainAxisSize.min,
1363-
children: <Widget>[
1364-
child,
1365-
const SizedBox(width: 8),
1366-
icon
1367-
],
1368-
)
1369-
: child,
1357+
? Row(
1358+
mainAxisSize: MainAxisSize.min,
1359+
children: <Widget>[
1360+
child,
1361+
const SizedBox(width: 8),
1362+
icon
1363+
],
1364+
)
1365+
: child,
13701366
),
13711367
),
13721368
),
@@ -1402,9 +1398,9 @@ class _InputPadding extends SingleChildRenderObjectWidget {
14021398
Widget child,
14031399
this.minSize,
14041400
}) : super(
1405-
key: key,
1406-
child: child,
1407-
);
1401+
key: key,
1402+
child: child,
1403+
);
14081404

14091405
final Size minSize;
14101406

@@ -1494,4 +1490,4 @@ class _RenderInputPadding extends RenderShiftedBox {
14941490
},
14951491
);
14961492
}
1497-
}
1493+
}

lib/components/floating_widget/gf_floating_widget.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ class GFFloatingWidget extends StatefulWidget {
3737
}
3838

3939
class _GFFloatingWidgetState extends State<GFFloatingWidget> {
40-
41-
Widget child;
40+
Widget child;
4241

4342
@override
4443
void initState() {
45-
child=widget.child;
44+
child = widget.child;
4645
super.initState();
4746
}
4847

4948
@override
50-
void didUpdateWidget(GFFloatingWidget oldWidget){
51-
child=widget.child;
49+
void didUpdateWidget(GFFloatingWidget oldWidget) {
50+
child = widget.child;
5251
super.didUpdateWidget(oldWidget);
5352
}
53+
5454
@override
5555
Widget build(BuildContext context) => Stack(
5656
alignment: Alignment.center,

0 commit comments

Comments
 (0)