Skip to content

Commit 0983ee4

Browse files
committed
format the code
1 parent 0068feb commit 0983ee4

File tree

9 files changed

+49
-36
lines changed

9 files changed

+49
-36
lines changed

lib/action_sheet.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class ActionSheetPressDetails {
1212
}
1313
}
1414

15-
typedef ActionSheetPressVoidCallBack = void Function(ActionSheetPressDetails details);
15+
typedef ActionSheetPressVoidCallBack = void Function(
16+
ActionSheetPressDetails details);
1617

1718
///展示手机action
1819
class ActionSheet {
@@ -32,11 +33,15 @@ class ActionSheet {
3233
textColor: textColor,
3334
text: data.elementAt(i),
3435
onPressed: () {
35-
if (onPress != null) onPress(ActionSheetPressDetails(index: i, text: data.elementAt(i)));
36+
if (onPress != null)
37+
onPress(
38+
ActionSheetPressDetails(index: i, text: data.elementAt(i)));
3639
Navigator.of(context).pop();
3740
},
3841
));
39-
if (i != 0) widgets.insert(0, Divider(height: 1 / MediaQuery.of(context).devicePixelRatio));
42+
if (i != 0)
43+
widgets.insert(
44+
0, Divider(height: 1 / MediaQuery.of(context).devicePixelRatio));
4045
}
4146
widgets.add(Padding(
4247
padding: const EdgeInsets.only(top: 6),

lib/article.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class Article extends StatelessWidget {
7373
);
7474
}
7575
}
76+
7677
class Section extends StatelessWidget {
7778
Section({Key key, this.children}) : super(key: key);
7879
final List<Widget> children;
@@ -87,5 +88,3 @@ class Section extends StatelessWidget {
8788
);
8889
}
8990
}
90-
91-

lib/button.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ enum ButtonType {
1010
}
1111

1212
class Button extends StatefulWidget {
13-
Button({Key key, this.type = ButtonType.btnDefault, this.disabled, this.onPressed, this.loading,this.text = "button"}) : super(key: key);
13+
Button({Key key, this.type = ButtonType.btnDefault, this.disabled, this.onPressed, this.loading, this.text = "button"}) : super(key: key);
1414

1515
/// 按钮类型
1616
final ButtonType type; //按钮类型
1717
final bool disabled; //是否可用
1818
final VoidCallback onPressed; //按下时进行触发
1919
final bool loading; //是否加载中
20-
final String text;//按钮上的文字
20+
final String text; //按钮上的文字
2121
@override
2222
State<StatefulWidget> createState() => _Button();
2323
}
@@ -75,9 +75,8 @@ class _Button extends State<Button> {
7575
double wuiBtnMiniFontSize = 13;
7676
double wuiBtnMiniHeight = 2.3;
7777

78-
7978
Color wuiBtnPlainPrimaryColor = SmartColor.parse("rgba(26,173,25,1)");
80-
Color wuiBtnPlainPrimaryBorderColor = SmartColor.parse("rgba(26,173,25,1)");
79+
Color wuiBtnPlainPrimaryBorderColor = SmartColor.parse("rgba(26,173,25,1)");
8180
Color wuiBtnPlainPrimaryActiveColor = SmartColor.parse("rgba(26,173,25,.6)");
8281
Color wuiBtnPlainPrimaryActiveBorderColor = SmartColor.parse("rgba(26,173,25,.6)");
8382

@@ -114,7 +113,7 @@ class _Button extends State<Button> {
114113
}
115114

116115
_onTapDown(e) {
117-
if (widget.disabled == true || widget.loading == true ) return;
116+
if (widget.disabled == true || widget.loading == true) return;
118117
setState(() {
119118
fontColor = buttonColor.activeFontColor;
120119
btnColor = buttonColor.activeBg;

lib/cells.dart

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,12 @@ class _CellSelectState extends State<CellSelect> {
5353
String value;
5454

5555
_handleTap(BuildContext context) {
56-
ActionSheet.show(
57-
context,
58-
data: widget.options,
59-
onPress: (detail) {
60-
setState(() {
61-
value = detail.text;
62-
});
63-
if (widget.onChanged != null) widget.onChanged(detail.text);
64-
});
56+
ActionSheet.show(context, data: widget.options, onPress: (detail) {
57+
setState(() {
58+
value = detail.text;
59+
});
60+
if (widget.onChanged != null) widget.onChanged(detail.text);
61+
});
6562
}
6663

6764
@override

lib/load_more.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ class LoadMore extends StatelessWidget {
4040
width: 4,
4141
height: 4,
4242
child: Text(""),
43-
decoration: BoxDecoration(
44-
color: Color(0xFFE5E5E5),
45-
borderRadius: BorderRadius.all(Radius.circular(2))
46-
),
43+
decoration: BoxDecoration(color: Color(0xFFE5E5E5), borderRadius: BorderRadius.all(Radius.circular(2))),
4744
)
48-
: Text(type == LoadType.loading ? "正在加载" : "暂无数据",style: TextStyle(fontSize: 14),),
45+
: Text(
46+
type == LoadType.loading ? "正在加载" : "暂无数据",
47+
style: TextStyle(fontSize: 14),
48+
),
4949
],
5050
),
5151
),

lib/panel.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Panel extends StatelessWidget {
1919
Offstage(
2020
child: Container(
2121
padding: const EdgeInsets.only(top: 14, right: 15, bottom: 10, left: 15),
22-
child: Text(title??"", style: titleStyle),
22+
child: Text(title ?? "", style: titleStyle),
2323
),
2424
offstage: title == null,
2525
),

lib/picker.dart

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ class PickerItemDetails {
1414

1515
/// picker组件
1616
class Picker {
17-
1817
/// 展示picker组件
19-
static show(BuildContext context,{List<String> data, ValueChanged<PickerItemDetails> onOk, int initialItem = 0}) {
18+
static show(BuildContext context, {List<String> data, ValueChanged<PickerItemDetails> onOk, int initialItem = 0}) {
2019
showModalBottomSheet(
2120
context: context,
2221
builder: (_) {
@@ -30,10 +29,16 @@ class Picker {
3029
}
3130

3231
class DatePicker {
33-
static show(BuildContext context){
34-
showModalBottomSheet(context: context, builder: (_){
35-
return CupertinoDatePicker(onDateTimeChanged: (dateTime){},initialDateTime: DateTime.now() ,mode: CupertinoDatePickerMode.date,);
36-
});
32+
static show(BuildContext context) {
33+
showModalBottomSheet(
34+
context: context,
35+
builder: (_) {
36+
return CupertinoDatePicker(
37+
onDateTimeChanged: (dateTime) {},
38+
initialDateTime: DateTime.now(),
39+
mode: CupertinoDatePickerMode.date,
40+
);
41+
});
3742
}
3843
}
3944

lib/slider.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@ import 'package:flutter/cupertino.dart';
22
import 'package:flutter/material.dart';
33

44
class WSlider extends StatefulWidget {
5-
WSlider({Key key, this.onChanged, this.min = 0, this.max = 10, this.step = 0, this.activeColor = const Color(0xFF1AAD19), this.showValue = false,this.defaultValue})
5+
WSlider(
6+
{Key key,
7+
this.onChanged,
8+
this.min = 0,
9+
this.max = 10,
10+
this.step = 0,
11+
this.activeColor = const Color(0xFF1AAD19),
12+
this.showValue = false,
13+
this.defaultValue})
614
: super(key: key);
715

816
final ValueChanged<double> onChanged;
@@ -17,7 +25,7 @@ class WSlider extends StatefulWidget {
1725
}
1826

1927
class _SliderState extends State<WSlider> {
20-
double value ;
28+
double value;
2129

2230
handleChanged(newValue) {
2331
if (widget.onChanged != null) widget.onChanged(newValue);
@@ -27,7 +35,7 @@ class _SliderState extends State<WSlider> {
2735
void initState() {
2836
// TODO: implement initState
2937
super.initState();
30-
value = widget.defaultValue??widget.min;
38+
value = widget.defaultValue ?? widget.min;
3139
}
3240

3341
@override

lib/touchable.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class _TouchableHighlightState extends State<TouchableHighlight> {
2626
if (widget.onPressed != null) widget.onPressed();
2727
}
2828

29-
_onTapCancel(){
29+
_onTapCancel() {
3030
setState(() {
3131
bg = Color(0xFFFFFFFF);
3232
});
@@ -73,7 +73,7 @@ class _TouchableOpacityState extends State<TouchableOpacity> {
7373
if (widget.onPressed != null) widget.onPressed();
7474
}
7575

76-
_onTapCancel(){
76+
_onTapCancel() {
7777
setState(() {
7878
opacity = 1;
7979
});

0 commit comments

Comments
 (0)