Skip to content

Commit 11e733f

Browse files
committed
style: dart format + trailing comma fixes for Dart 3.11
1 parent 7abe220 commit 11e733f

17 files changed

Lines changed: 65 additions & 47 deletions

example/lib/example_01_minimal.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ base class MinimalController extends ScreenController {
3737
}
3838
}
3939

40-
base class _MinimalScreenState extends ScreenState<MinimalScreen, MinimalController> {
40+
base class _MinimalScreenState
41+
extends ScreenState<MinimalScreen, MinimalController> {
4142
@override
4243
Widget buildWidget(BuildContext context) {
4344
return Scaffold(

example/lib/example_04_default_adaptive.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ base class OpinionatedScreen extends Screen {
2222
State createState() => _State();
2323
}
2424

25-
base class _State extends DefaultAdaptiveScreenState<OpinionatedScreen, ScreenController> {
25+
base class _State
26+
extends DefaultAdaptiveScreenState<OpinionatedScreen, ScreenController> {
2627
// Replace the default 28.sc / 112.sc padding without forking the mixin.
2728
@override
2829
EdgeInsets get defaultPaddingInsets => const EdgeInsets.symmetric(
@@ -41,7 +42,8 @@ base class _State extends DefaultAdaptiveScreenState<OpinionatedScreen, ScreenCo
4142
child: ListTile(
4243
leading: CircleAvatar(child: Text('$i')),
4344
title: Text('Opinionated item $i'),
44-
subtitle: const Text('Scrolls inside the default scrollable mixin.'),
45+
subtitle:
46+
const Text('Scrolls inside the default scrollable mixin.'),
4547
),
4648
);
4749
},

example/lib/example_06_controller_state.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,15 @@ base class _CounterScreenState
8181
child: Column(
8282
mainAxisSize: MainAxisSize.min,
8383
children: [
84-
Text('Count: ${c.count}',
85-
style: Theme.of(context).textTheme.headlineMedium,),
84+
Text(
85+
'Count: ${c.count}',
86+
style: Theme.of(context).textTheme.headlineMedium,
87+
),
8688
const SizedBox(height: 16),
87-
ElevatedButton(onPressed: c.increment, child: const Text('Increment')),
89+
ElevatedButton(
90+
onPressed: c.increment,
91+
child: const Text('Increment'),
92+
),
8893
],
8994
),
9095
);

example/lib/example_09_side_modes.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ base class _DemoScreen extends Screen {
5959
State createState() => _DemoScreenState();
6060
}
6161

62-
base class _DemoScreenState extends AdaptiveScreenState<_DemoScreen, ScreenController> {
62+
base class _DemoScreenState
63+
extends AdaptiveScreenState<_DemoScreen, ScreenController> {
6364
@override
6465
AdaptiveScreenSideMode get topSideMode => widget.mode;
6566

example/lib/example_3.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ final class OverlayExampleController extends ScreenController {
3333
}
3434

3535
/// 3. THE STATE (UI & Adaptive Layout)
36-
final class _OverlayExampleScreenState
37-
extends
38-
AdaptiveScreenState<OverlayExampleScreen, OverlayExampleController> {
36+
final class _OverlayExampleScreenState extends AdaptiveScreenState<
37+
OverlayExampleScreen, OverlayExampleController> {
3938
// Use OVERLAY so the body content scrolls behind the header/footer
4039
@override
4140
AdaptiveScreenSideMode get topSideMode => AdaptiveScreenSideMode.OVERLAY;

example/lib/main.dart

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,26 @@ class _Index extends StatelessWidget {
2424

2525
static final examples = <_Example>[
2626
_Example('01 — Minimal screen', (_) => const ex01.MinimalScreen()),
27-
_Example('02 — Scrollable header (legacy)', (_) => const ex02.ExampleScreen()),
28-
_Example('03 — Overlay layout (legacy)', (_) => const ex03.OverlayExampleScreen()),
29-
_Example('04 — DefaultAdaptiveScreenState', (_) => const ex04.OpinionatedScreen()),
27+
_Example(
28+
'02 — Scrollable header (legacy)',
29+
(_) => const ex02.ExampleScreen(),
30+
),
31+
_Example(
32+
'03 — Overlay layout (legacy)',
33+
(_) => const ex03.OverlayExampleScreen(),
34+
),
35+
_Example(
36+
'04 — DefaultAdaptiveScreenState',
37+
(_) => const ex04.OpinionatedScreen(),
38+
),
3039
_Example('05 — Custom breakpoints', (_) => const ex05.TunedScreen()),
31-
_Example('06 — Controller cache + state', (_) => const ex06.CounterScreen(
32-
key: ValueKey('counter'),
33-
controllerTimeout: Duration(minutes: 5),
34-
),),
40+
_Example(
41+
'06 — Controller cache + state',
42+
(_) => const ex06.CounterScreen(
43+
key: ValueKey('counter'),
44+
controllerTimeout: Duration(minutes: 5),
45+
),
46+
),
3547
_Example('07 — Async controller init', (_) => const ex07.AsyncInitScreen()),
3648
_Example('08 — df_router integration', (_) => const ex08.MyApp()),
3749
_Example('09 — Side modes showcase', (_) => const ex09.SideModeShowcase()),

lib/src/_src.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ export './screen_states/adaptive_screen_state/mixins/default_padding_screen_mixi
2525
export './screen_states/adaptive_screen_state/mixins/default_scrollable_align_screen_mixin.dart';
2626
export './screen_states/adaptive_screen_state/mixins/mobile_frame_wide_layout_screen_mixin.dart';
2727
export './screen_states/adaptive_screen_state/mixins/never_scrollable_align_screen_mixin.dart';
28-
export './screen_states/adaptive_screen_state/mixins/rotate_icon_horizontal_mobile_layout_screen_mixin.dart';
28+
export './screen_states/adaptive_screen_state/mixins/rotate_icon_horizontal_mobile_layout_screen_mixin.dart';

lib/src/_utils/current_platform.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class CurrentPlatform {
153153
BuildContext context, {
154154
LayoutBreakpoints? breakpoints,
155155
}) {
156-
return isOsMobile && isWindowSizeMobileFor(context, breakpoints: breakpoints);
156+
return isOsMobile &&
157+
isWindowSizeMobileFor(context, breakpoints: breakpoints);
157158
}
158159
}

lib/src/_utils/surface.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Surface extends StatelessWidget {
5656
final borderRadius1 = decoration?.borderRadius ?? borderRadius;
5757
final decoration1 =
5858
decoration?.copyWith(color: color1, borderRadius: borderRadius1) ??
59-
BoxDecoration(color: color1, borderRadius: borderRadius1);
59+
BoxDecoration(color: color1, borderRadius: borderRadius1);
6060
return ClipRRect(
6161
borderRadius: borderRadius1,
6262
child: Container(

lib/src/app_layout.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
import 'dart:ui' show Size;
1515

16-
import 'package:flutter/widgets.dart' show BuildContext, MediaQuery, WidgetsBinding;
16+
import 'package:flutter/widgets.dart'
17+
show BuildContext, MediaQuery, WidgetsBinding;
1718

1819
import '_utils/_utils.g.dart';
1920
import 'layout_breakpoints.dart';

0 commit comments

Comments
 (0)