Skip to content

Commit 811e960

Browse files
committed
format: use a line length of 80
1 parent 5dbb122 commit 811e960

21 files changed

+280
-128
lines changed

example/lib/indicators/check_mark_indicator.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class CheckMarkStyle {
2323

2424
static const defaultStyle = CheckMarkStyle(
2525
loading: CheckMarkColors(content: Colors.white, background: Colors.black),
26-
completed: CheckMarkColors(content: Colors.white, background: Colors.greenAccent),
26+
completed:
27+
CheckMarkColors(content: Colors.white, background: Colors.greenAccent),
2728
);
2829
}
2930

@@ -41,7 +42,8 @@ class CheckMarkIndicator extends StatefulWidget {
4142
State<CheckMarkIndicator> createState() => _CheckMarkIndicatorState();
4243
}
4344

44-
class _CheckMarkIndicatorState extends State<CheckMarkIndicator> with SingleTickerProviderStateMixin {
45+
class _CheckMarkIndicatorState extends State<CheckMarkIndicator>
46+
with SingleTickerProviderStateMixin {
4547
/// Whether to render check mark instead of spinner
4648
bool _renderCompleteState = false;
4749

@@ -69,7 +71,9 @@ class _CheckMarkIndicatorState extends State<CheckMarkIndicator> with SingleTick
6971
BuildContext context,
7072
IndicatorController controller,
7173
) {
72-
final style = _renderCompleteState ? widget.style.completed : widget.style.loading;
74+
final style = _renderCompleteState
75+
? widget.style.completed
76+
: widget.style.loading;
7377
return AnimatedContainer(
7478
duration: const Duration(milliseconds: 150),
7579
alignment: Alignment.center,
@@ -88,7 +92,9 @@ class _CheckMarkIndicatorState extends State<CheckMarkIndicator> with SingleTick
8892
child: CircularProgressIndicator(
8993
strokeWidth: 2,
9094
color: style.content,
91-
value: controller.isDragging || controller.isArmed ? controller.value.clamp(0.0, 1.0) : null,
95+
value: controller.isDragging || controller.isArmed
96+
? controller.value.clamp(0.0, 1.0)
97+
: null,
9298
),
9399
),
94100
);

example/lib/indicators/envelope_indicator.dart

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ class EnvelopRefreshIndicator extends StatelessWidget {
1111
static const _circleSize = 70.0;
1212

1313
static const _blurRadius = 10.0;
14-
static const _defaultShadow = [BoxShadow(blurRadius: _blurRadius, color: Colors.black26)];
14+
static const _defaultShadow = [
15+
BoxShadow(blurRadius: _blurRadius, color: Colors.black26)
16+
];
1517

1618
const EnvelopRefreshIndicator({
1719
super.key,
@@ -27,16 +29,20 @@ class EnvelopRefreshIndicator extends StatelessWidget {
2729
return CustomRefreshIndicator(
2830
leadingScrollIndicatorVisible: leadingScrollIndicatorVisible,
2931
trailingScrollIndicatorVisible: trailingScrollIndicatorVisible,
30-
builder: (context, child, controller) => LayoutBuilder(builder: (context, constraints) {
32+
builder: (context, child, controller) =>
33+
LayoutBuilder(builder: (context, constraints) {
3134
final widgetWidth = constraints.maxWidth;
3235
final widgetHeight = constraints.maxHeight;
3336
final letterTopWidth = (widgetWidth / 2) + 50;
3437

35-
final leftValue = (widgetWidth + _blurRadius - ((letterTopWidth + _blurRadius) * controller.value / 1))
38+
final leftValue = (widgetWidth +
39+
_blurRadius -
40+
((letterTopWidth + _blurRadius) * controller.value / 1))
3641
.clamp(letterTopWidth - 100, double.infinity);
3742

3843
final rightShift = widgetWidth + _blurRadius;
39-
final rightValue = (rightShift - (rightShift * controller.value / 1)).clamp(0.0, double.infinity);
44+
final rightValue = (rightShift - (rightShift * controller.value / 1))
45+
.clamp(0.0, double.infinity);
4046

4147
final opacity = (controller.value - 1).clamp(0, 0.5) / 0.5;
4248

@@ -79,23 +85,27 @@ class EnvelopRefreshIndicator extends StatelessWidget {
7985
child: Transform.scale(
8086
scale: controller.value,
8187
child: Opacity(
82-
opacity: controller.isLoading || controller.state.isSettling ? 1 : opacity,
88+
opacity: controller.isLoading || controller.state.isSettling
89+
? 1
90+
: opacity,
8391
child: Align(
8492
alignment: Alignment.center,
8593
child: Container(
8694
width: _circleSize,
8795
height: _circleSize,
8896
decoration: BoxDecoration(
8997
boxShadow: _defaultShadow,
90-
color: accent ?? Theme.of(context).colorScheme.primary,
98+
color:
99+
accent ?? Theme.of(context).colorScheme.primary,
91100
shape: BoxShape.circle,
92101
),
93102
child: Stack(
94103
fit: StackFit.expand,
95104
alignment: Alignment.center,
96105
children: <Widget>[
97106
CircularProgressIndicator(
98-
valueColor: const AlwaysStoppedAnimation(Colors.black),
107+
valueColor:
108+
const AlwaysStoppedAnimation(Colors.black),
99109
value: controller.isLoading ? null : 0,
100110
),
101111
const Icon(
@@ -128,7 +138,10 @@ class TrianglePainter extends CustomPainter {
128138
return radius * 0.57735 + 0.5;
129139
}
130140

131-
TrianglePainter({this.strokeColor = Colors.black, this.strokeWidth = 3, this.paintingStyle = PaintingStyle.stroke});
141+
TrianglePainter(
142+
{this.strokeColor = Colors.black,
143+
this.strokeWidth = 3,
144+
this.paintingStyle = PaintingStyle.stroke});
132145

133146
@override
134147
void paint(Canvas canvas, Size size) {
@@ -139,7 +152,8 @@ class TrianglePainter extends CustomPainter {
139152
final path = getTrianglePath(size.width, size.height);
140153
final shadowPaint = Paint()
141154
..color = Colors.black.withAlpha(50)
142-
..maskFilter = MaskFilter.blur(BlurStyle.normal, convertRadiusToSigma(10));
155+
..maskFilter =
156+
MaskFilter.blur(BlurStyle.normal, convertRadiusToSigma(10));
143157
canvas.drawPath(path, shadowPaint);
144158

145159
canvas.drawPath(path, paint);

example/lib/indicators/ice_cream_indicator.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ class IceCreamIndicator extends StatefulWidget {
2525
State<IceCreamIndicator> createState() => _IceCreamIndicatorState();
2626
}
2727

28-
class _IceCreamIndicatorState extends State<IceCreamIndicator> with SingleTickerProviderStateMixin {
28+
class _IceCreamIndicatorState extends State<IceCreamIndicator>
29+
with SingleTickerProviderStateMixin {
2930
static const _assets = <ParallaxConfig>[
3031
ParallaxConfig(
3132
image: AssetImage("assets/ice_cream_indicator/cup2.png"),
@@ -65,7 +66,8 @@ class _IceCreamIndicatorState extends State<IceCreamIndicator> with SingleTicker
6566

6667
@override
6768
void initState() {
68-
_spoonController = AnimationController(vsync: this, duration: const Duration(seconds: 1));
69+
_spoonController =
70+
AnimationController(vsync: this, duration: const Duration(seconds: 1));
6971
WidgetsBinding.instance.addPostFrameCallback((_) => _precacheImages());
7072
super.initState();
7173
}
@@ -133,7 +135,9 @@ class _IceCreamIndicatorState extends State<IceCreamIndicator> with SingleTicker
133135
child: _buildImage(controller, _assets[i]),
134136
builder: (context, child) {
135137
return Transform.rotate(
136-
angle: (-_spoonTween.transform(_spoonController.value)) * 1.25,
138+
angle: (-_spoonTween
139+
.transform(_spoonController.value)) *
140+
1.25,
137141
child: child,
138142
);
139143
},

example/lib/indicators/plane_indicator.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ class PlaneIndicator extends StatefulWidget {
4444
State<PlaneIndicator> createState() => _PlaneIndicatorState();
4545
}
4646

47-
class _PlaneIndicatorState extends State<PlaneIndicator> with TickerProviderStateMixin {
47+
class _PlaneIndicatorState extends State<PlaneIndicator>
48+
with TickerProviderStateMixin {
4849
static final _planeTween = CurveTween(curve: Curves.easeInOut);
4950
late AnimationController _planeController;
5051

@@ -171,7 +172,8 @@ class _PlaneIndicatorState extends State<PlaneIndicator> with TickerProviderStat
171172
),
172173
builder: (BuildContext context, Widget? child) {
173174
return Transform.translate(
174-
offset: Offset(0.0, 10 * (0.5 - _planeTween.transform(_planeController.value))),
175+
offset: Offset(0.0,
176+
10 * (0.5 - _planeTween.transform(_planeController.value))),
175177
child: child,
176178
);
177179
},
@@ -199,7 +201,8 @@ class _PlaneIndicatorState extends State<PlaneIndicator> with TickerProviderStat
199201
}
200202
},
201203
onRefresh: () => Future.delayed(const Duration(seconds: 3)),
202-
builder: (BuildContext context, Widget child, IndicatorController controller) {
204+
builder: (BuildContext context, Widget child,
205+
IndicatorController controller) {
203206
return AnimatedBuilder(
204207
animation: controller,
205208
child: child,
@@ -221,7 +224,9 @@ class _PlaneIndicatorState extends State<PlaneIndicator> with TickerProviderStat
221224
for (final cloud in _clouds)
222225
Transform.translate(
223226
offset: Offset(
224-
((screenWidth + cloud.width) * cloud.controller!.value) - cloud.width,
227+
((screenWidth + cloud.width) *
228+
cloud.controller!.value) -
229+
cloud.width,
225230
cloud.dy * controller.value,
226231
),
227232
child: OverflowBox(

example/lib/indicators/swipe_action.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class FetchMoreIndicator extends StatelessWidget {
2929
return AnimatedBuilder(
3030
animation: controller,
3131
builder: (context, _) {
32-
final dy = controller.value.clamp(0.0, 1.25) * -(height - (height * 0.25));
32+
final dy = controller.value.clamp(0.0, 1.25) *
33+
-(height - (height * 0.25));
3334
return Stack(
3435
children: [
3536
Transform.translate(
@@ -63,7 +64,9 @@ class FetchMoreIndicator extends StatelessWidget {
6364
color: appContentColor,
6465
),
6566
Text(
66-
controller.isLoading ? "Fetching..." : "Pull to fetch more",
67+
controller.isLoading
68+
? "Fetching..."
69+
: "Pull to fetch more",
6770
style: const TextStyle(
6871
color: appContentColor,
6972
),

example/lib/indicators/warp_indicator.dart

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ class WarpIndicator extends StatefulWidget {
4040
State<WarpIndicator> createState() => _WarpIndicatorState();
4141
}
4242

43-
class _WarpIndicatorState extends State<WarpIndicator> with SingleTickerProviderStateMixin {
43+
class _WarpIndicatorState extends State<WarpIndicator>
44+
with SingleTickerProviderStateMixin {
4445
static const _indicatorSize = 150.0;
4546
final _random = Random();
4647
WarpAnimationState _state = WarpAnimationState.stopped;
@@ -144,7 +145,8 @@ class _WarpIndicatorState extends State<WarpIndicator> with SingleTickerProvider
144145
animation: shakeController,
145146
builder: (_, __) {
146147
return LayoutBuilder(
147-
builder: (BuildContext context, BoxConstraints constraints) {
148+
builder:
149+
(BuildContext context, BoxConstraints constraints) {
148150
return CustomPaint(
149151
painter: Sky(
150152
stars: stars,
@@ -161,8 +163,10 @@ class _WarpIndicatorState extends State<WarpIndicator> with SingleTickerProvider
161163
return Transform.scale(
162164
scale: _scaleTween.transform(controller.value),
163165
child: Builder(builder: (context) {
164-
if (shakeController.value == 1.0 && _state == WarpAnimationState.playing) {
165-
SchedulerBinding.instance.addPostFrameCallback((_) => _resetShakeAnimation());
166+
if (shakeController.value == 1.0 &&
167+
_state == WarpAnimationState.playing) {
168+
SchedulerBinding.instance
169+
.addPostFrameCallback((_) => _resetShakeAnimation());
166170
}
167171
return Transform.rotate(
168172
angle: _angleTween.transform(shakeController.value),
@@ -216,7 +220,8 @@ class Star {
216220
speed = Offset(cos(angle), sin(angle));
217221
const minSpeedScale = 20;
218222
const maxSpeedScale = 35;
219-
final speedScale = minSpeedScale + random.nextInt(maxSpeedScale - minSpeedScale).toDouble();
223+
final speedScale = minSpeedScale +
224+
random.nextInt(maxSpeedScale - minSpeedScale).toDouble();
220225
speed = speed.scale(
221226
speedScale,
222227
speedScale,
@@ -239,7 +244,8 @@ class Star {
239244

240245
final startShiftAngle = angle + (pi / 2);
241246
final startShift = Offset(cos(startShiftAngle), sin(startShiftAngle));
242-
final shiftedStartPosition = startPosition + (startShift * (0.75 + value * 0.01));
247+
final shiftedStartPosition =
248+
startPosition + (startShift * (0.75 + value * 0.01));
243249

244250
final endShiftAngle = angle + (pi / 2);
245251
final endShift = Offset(cos(endShiftAngle), sin(endShiftAngle));

example/lib/main.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class MyApp extends StatelessWidget {
3838
'/envelope': (context) => const EnvelopIndicatorScreen(),
3939
'/fetch-more': (context) => const FetchMoreScreen(),
4040
'/horizontal': (context) => const HorizontalScreen(),
41-
'/programmatically-controlled': (context) => const ProgrammaticallyControlled(),
41+
'/programmatically-controlled': (context) =>
42+
const ProgrammaticallyControlled(),
4243
},
4344
);
4445
}

example/lib/screens/check_mark_indicator_screen.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ class CheckMarkIndicatorScreen extends StatefulWidget {
77
const CheckMarkIndicatorScreen({super.key});
88

99
@override
10-
State<CheckMarkIndicatorScreen> createState() => _CheckMarkIndicatorScreenState();
10+
State<CheckMarkIndicatorScreen> createState() =>
11+
_CheckMarkIndicatorScreenState();
1112
}
1213

1314
class _CheckMarkIndicatorScreenState extends State<CheckMarkIndicatorScreen> {

example/lib/screens/custom_material_indicator_screen.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ class CustomMaterialIndicatorScreen extends StatefulWidget {
77
const CustomMaterialIndicatorScreen({super.key});
88

99
@override
10-
State<CustomMaterialIndicatorScreen> createState() => _CustomMaterialIndicatorScreenState();
10+
State<CustomMaterialIndicatorScreen> createState() =>
11+
_CustomMaterialIndicatorScreenState();
1112
}
1213

13-
class _CustomMaterialIndicatorScreenState extends State<CustomMaterialIndicatorScreen> {
14+
class _CustomMaterialIndicatorScreenState
15+
extends State<CustomMaterialIndicatorScreen> {
1416
final _controller = IndicatorController();
1517

1618
@override

example/lib/screens/horizontal_screen.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ class _HorizontalScreenState extends State<HorizontalScreen> {
2626
_isHorizontal = !_isHorizontal;
2727
});
2828
},
29-
icon: _isHorizontal ? const Icon(Icons.swap_horizontal_circle) : const Icon(Icons.swap_vert_circle),
29+
icon: _isHorizontal
30+
? const Icon(Icons.swap_horizontal_circle)
31+
: const Icon(Icons.swap_vert_circle),
3032
)
3133
],
3234
),

0 commit comments

Comments
 (0)