Skip to content

Commit f804c51

Browse files
reformat the code
1 parent 201c18b commit f804c51

File tree

3 files changed

+26
-56
lines changed

3 files changed

+26
-56
lines changed

lib/core/widgets/custom_widgets/custom_bottom_sheet.dart

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ class CustomBottomSheet {
5555
);
5656
}
5757

58-
static Future<void> _showBottomSheet(
59-
BuildContext context, Widget child) async {
58+
static Future<void> _showBottomSheet(BuildContext context, Widget child) async {
6059
return showModalBottomSheet(
6160
context: context,
6261
isScrollControlled: true,
@@ -152,17 +151,12 @@ class _BottomSheetDash extends StatelessWidget {
152151
@override
153152
Widget build(BuildContext context) {
154153
return Padding(
155-
padding: REdgeInsetsDirectional.only(
156-
start: 10,
157-
end: 10,
158-
top: 10,
159-
bottom: withLittleBottomPadding ? 5 : 10),
154+
padding: REdgeInsetsDirectional.only(start: 10, end: 10, top: 10, bottom: withLittleBottomPadding ? 5 : 10),
160155
child: Container(
161156
width: 40.w,
162157
height: 3.5.h,
163-
decoration: BoxDecoration(
164-
color: context.getColor(ThemeEnum.hoverColor),
165-
borderRadius: BorderRadius.circular(5)),
158+
decoration:
159+
BoxDecoration(color: context.getColor(ThemeEnum.hoverColor), borderRadius: BorderRadius.circular(5)),
166160
),
167161
);
168162
}

lib/core/widgets/custom_widgets/custom_circulars_progress.dart

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import 'package:algorithm_visualizer/core/helpers/current_device.dart';
22
import 'package:algorithm_visualizer/core/resources/theme_manager.dart';
33
import 'package:flutter/cupertino.dart';
44
import 'package:flutter/material.dart';
5-
import 'package:flutter/foundation.dart'
6-
show TargetPlatform, defaultTargetPlatform;
5+
import 'package:flutter/foundation.dart' show TargetPlatform, defaultTargetPlatform;
76
import 'package:flutter_screenutil/flutter_screenutil.dart';
87

98
class CustomCircularProgress extends StatelessWidget {
@@ -14,8 +13,7 @@ class CustomCircularProgress extends StatelessWidget {
1413
Widget build(BuildContext context) {
1514
bool isThatAndroid = defaultTargetPlatform == TargetPlatform.android;
1615
final color = this.color;
17-
final tColor =
18-
color == null ? Theme.of(context).focusColor : context.getColor(color);
16+
final tColor = color == null ? Theme.of(context).focusColor : context.getColor(color);
1917

2018
return isThatAndroid
2119
? Column(
@@ -27,14 +25,12 @@ class CustomCircularProgress extends StatelessWidget {
2725
child: SizedBox(
2826
width: 20.r,
2927
height: 20.r,
30-
child: CircularProgressIndicator(
31-
strokeWidth: 3.r, color: tColor),
28+
child: CircularProgressIndicator(strokeWidth: 3.r, color: tColor),
3229
),
3330
),
3431
],
3532
)
36-
: CupertinoActivityIndicator(
37-
color: tColor, radius: 9.r, animating: true);
33+
: CupertinoActivityIndicator(color: tColor, radius: 9.r, animating: true);
3834
}
3935
}
4036

@@ -46,43 +42,37 @@ class SmallCircularProgress extends StatelessWidget {
4642
Widget build(BuildContext context) {
4743
bool isThatAndroid = defaultTargetPlatform == TargetPlatform.android;
4844
final color = this.color;
49-
final tColor =
50-
color == null ? Theme.of(context).focusColor : context.getColor(color);
45+
final tColor = color == null ? Theme.of(context).focusColor : context.getColor(color);
5146

5247
return isThatAndroid
5348
? SizedBox(
5449
width: 15.r,
5550
height: 15.r,
5651
child: ClipOval(
57-
child:
58-
CircularProgressIndicator(strokeWidth: 3.5.r, color: tColor),
52+
child: CircularProgressIndicator(strokeWidth: 3.5.r, color: tColor),
5953
),
6054
)
61-
: CupertinoActivityIndicator(
62-
color: tColor, radius: 9.r, animating: true);
55+
: CupertinoActivityIndicator(color: tColor, radius: 9.r, animating: true);
6356
}
6457
}
6558

6659
class ThineCircularProgress extends StatelessWidget {
6760
final ThemeEnum? color;
6861
final ThemeEnum? backgroundColor;
6962
final double strokeWidth;
70-
const ThineCircularProgress(
71-
{super.key, this.color, this.backgroundColor, this.strokeWidth = 2});
63+
const ThineCircularProgress({super.key, this.color, this.backgroundColor, this.strokeWidth = 2});
7264

7365
@override
7466
Widget build(BuildContext context) {
7567
final color = this.color;
76-
final tColor =
77-
color == null ? Theme.of(context).focusColor : context.getColor(color);
68+
final tColor = color == null ? Theme.of(context).focusColor : context.getColor(color);
7869
final backgroundColor = this.backgroundColor;
7970

8071
return Center(
8172
child: CircularProgressIndicator.adaptive(
8273
strokeWidth: strokeWidth.r,
8374
valueColor: AlwaysStoppedAnimation<Color>(tColor),
84-
backgroundColor:
85-
backgroundColor != null ? context.getColor(backgroundColor) : null,
75+
backgroundColor: backgroundColor != null ? context.getColor(backgroundColor) : null,
8676
),
8777
);
8878
}
@@ -104,16 +94,14 @@ class ThineCircularProgressWithValue extends StatelessWidget {
10494
@override
10595
Widget build(BuildContext context) {
10696
final color = this.color;
107-
final tColor =
108-
color == null ? Theme.of(context).focusColor : context.getColor(color);
97+
final tColor = color == null ? Theme.of(context).focusColor : context.getColor(color);
10998
final backgroundColor = this.backgroundColor;
11099

111100
return Center(
112101
child: CircularProgressIndicator.adaptive(
113102
strokeWidth: strokeWidth.r,
114103
valueColor: AlwaysStoppedAnimation<Color>(tColor),
115-
backgroundColor:
116-
backgroundColor != null ? context.getColor(backgroundColor) : null,
104+
backgroundColor: backgroundColor != null ? context.getColor(backgroundColor) : null,
117105
value: value,
118106
),
119107
);
@@ -147,27 +135,22 @@ class CustomThineCircularProgress extends StatelessWidget {
147135
final ThemeEnum? color;
148136
final ThemeEnum? backgroundColor;
149137
final double strokeWidth;
150-
const CustomThineCircularProgress(
151-
{super.key, this.color, this.backgroundColor, this.strokeWidth = 2});
138+
const CustomThineCircularProgress({super.key, this.color, this.backgroundColor, this.strokeWidth = 2});
152139

153140
@override
154141
Widget build(BuildContext context) {
155142
final color = this.color;
156-
final tColor =
157-
color == null ? Theme.of(context).focusColor : context.getColor(color);
143+
final tColor = color == null ? Theme.of(context).focusColor : context.getColor(color);
158144
final backgroundColor = this.backgroundColor;
159145

160146
return Center(
161147
child: context.isAndroid
162148
? CircularProgressIndicator(
163149
strokeWidth: strokeWidth.r,
164150
valueColor: AlwaysStoppedAnimation<Color>(tColor),
165-
backgroundColor: backgroundColor != null
166-
? context.getColor(backgroundColor)
167-
: null,
151+
backgroundColor: backgroundColor != null ? context.getColor(backgroundColor) : null,
168152
)
169-
: CupertinoActivityIndicator(
170-
color: tColor, radius: strokeWidth.r, animating: true),
153+
: CupertinoActivityIndicator(color: tColor, radius: strokeWidth.r, animating: true),
171154
);
172155
}
173156
}
@@ -188,22 +171,18 @@ class CustomThineCircularProgressWithValue extends StatelessWidget {
188171
@override
189172
Widget build(BuildContext context) {
190173
final color = this.color;
191-
final tColor =
192-
color == null ? Theme.of(context).focusColor : context.getColor(color);
174+
final tColor = color == null ? Theme.of(context).focusColor : context.getColor(color);
193175
final backgroundColor = this.backgroundColor;
194176

195177
return Center(
196178
child: context.isAndroid
197179
? CircularProgressIndicator(
198180
strokeWidth: strokeWidth.r,
199181
valueColor: AlwaysStoppedAnimation<Color>(tColor),
200-
backgroundColor: backgroundColor != null
201-
? context.getColor(backgroundColor)
202-
: null,
182+
backgroundColor: backgroundColor != null ? context.getColor(backgroundColor) : null,
203183
value: value,
204184
)
205-
: CupertinoActivityIndicator(
206-
color: tColor, radius: strokeWidth.r, animating: false),
185+
: CupertinoActivityIndicator(color: tColor, radius: strokeWidth.r, animating: false),
207186
);
208187
}
209188
}
@@ -222,16 +201,14 @@ class BaseCircularProgress extends StatelessWidget {
222201
@override
223202
Widget build(BuildContext context) {
224203
final color = this.color;
225-
final tColor =
226-
color == null ? Theme.of(context).focusColor : context.getColor(color);
204+
final tColor = color == null ? Theme.of(context).focusColor : context.getColor(color);
227205
final backgroundColor = this.backgroundColor;
228206

229207
return Center(
230208
child: CircularProgressIndicator(
231209
strokeWidth: strokeWidth.r,
232210
valueColor: AlwaysStoppedAnimation<Color>(tColor),
233-
backgroundColor:
234-
backgroundColor != null ? context.getColor(backgroundColor) : null,
211+
backgroundColor: backgroundColor != null ? context.getColor(backgroundColor) : null,
235212
),
236213
);
237214
}

lib/core/widgets/custom_widgets/custom_dialog.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ class CustomAlertDialog {
2222
final BuildContext context;
2323
CustomAlertDialog(this.context);
2424

25-
Future<bool?> solidDialog(
26-
{required List<ListDialogParameters> parameters, bool barrierDismissible = true}) {
25+
Future<bool?> solidDialog({required List<ListDialogParameters> parameters, bool barrierDismissible = true}) {
2726
return showDialog<bool>(
2827
context: context,
2928
barrierDismissible: barrierDismissible,

0 commit comments

Comments
 (0)