Skip to content

Commit 96040cd

Browse files
committed
update
1 parent 5a25dfd commit 96040cd

21 files changed

Lines changed: 97 additions & 95 deletions

example/lib/main.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ final class ExampleScreenController extends ScreenController {
3333
ExampleScreenController(super.screen, super.state);
3434
}
3535

36-
final class ExampleScreenState
37-
extends
38-
AdaptiveScreenState<ExampleScreen, Object?, ExampleScreenController> {
36+
final class ExampleScreenState extends AdaptiveScreenState<ExampleScreen,
37+
Object?, ExampleScreenController> {
3938
@override
4039
Widget wideBody(BuildContext context) {
4140
return Container(

lib/src/_hidden/_hidden.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ export './view_insets_builder.dart';
1212
export './image_painter.dart';
1313
export './current_platform.dart';
1414
export './screen_calculator.dart';
15-
export './surface.dart';
15+
export './surface.dart';

lib/src/_hidden/screen_calculator.dart

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -95,29 +95,29 @@ const MIN_MOBILE_ASPECT_RATIO = 4.0 / 3.0;
9595

9696
/// The smallest of the following common aspect ratios for mobile phones (4.0 / 3.0)
9797
double get minMobileAspectRatio => {
98-
// Samsungs
99-
16.0 / 10.0,
100-
// Pixels, Samsungs
101-
16.0 / 9.0,
102-
// Pixels, most iPhones before 2018
103-
18.0 / 9.0,
104-
// Pixels
105-
18.5 / 9.0,
106-
18.7 / 9.0,
107-
19.0 / 10.0,
108-
// Pixels
109-
19.0 / 9.0,
110-
// Pixels and most iPhones after 2018
111-
19.5 / 9.0,
112-
3.0 / 2.0,
113-
// Old iPhones, and many tablets!
114-
4.0 / 3.0,
115-
5.0 / 3.0,
116-
// Samsungs
117-
2.10 / 1,
118-
20.0 / 9.0,
119-
193 / 90,
120-
}.reduce((a, b) => a <= b ? a : b);
98+
// Samsungs
99+
16.0 / 10.0,
100+
// Pixels, Samsungs
101+
16.0 / 9.0,
102+
// Pixels, most iPhones before 2018
103+
18.0 / 9.0,
104+
// Pixels
105+
18.5 / 9.0,
106+
18.7 / 9.0,
107+
19.0 / 10.0,
108+
// Pixels
109+
19.0 / 9.0,
110+
// Pixels and most iPhones after 2018
111+
19.5 / 9.0,
112+
3.0 / 2.0,
113+
// Old iPhones, and many tablets!
114+
4.0 / 3.0,
115+
5.0 / 3.0,
116+
// Samsungs
117+
2.10 / 1,
118+
20.0 / 9.0,
119+
193 / 90,
120+
}.reduce((a, b) => a <= b ? a : b);
121121

122122
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
123123

lib/src/_hidden/surface.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ class Surface extends StatelessWidget {
5050

5151
@override
5252
Widget build(BuildContext context) {
53-
final $color = decoration?.color ?? color ?? Theme.of(context).colorScheme.surface;
53+
final $color =
54+
decoration?.color ?? color ?? Theme.of(context).colorScheme.surface;
5455
final $borderRadius = decoration?.borderRadius ?? borderRadius;
55-
final $decoration = decoration?.copyWith(color: $color, borderRadius: $borderRadius) ??
56-
BoxDecoration(color: $color, borderRadius: $borderRadius);
56+
final $decoration =
57+
decoration?.copyWith(color: $color, borderRadius: $borderRadius) ??
58+
BoxDecoration(color: $color, borderRadius: $borderRadius);
5759
return ClipRRect(
5860
borderRadius: $borderRadius,
5961
child: Container(

lib/src/_hidden/view_insets_builder.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,11 @@ class _State extends State<ViewInsetsBuilder> with WidgetsBindingObserver {
9797

9898
void _updateViewInsets() {
9999
final viewInsets = View.of(context).viewInsets;
100-
final reachedMax =
101-
viewInsets.top > _viewInsets.top ||
100+
final reachedMax = viewInsets.top > _viewInsets.top ||
102101
viewInsets.bottom > _viewInsets.bottom ||
103102
viewInsets.left > _viewInsets.left ||
104103
viewInsets.right > _viewInsets.right;
105-
final reachedMin =
106-
viewInsets.top == 0 &&
104+
final reachedMin = viewInsets.top == 0 &&
107105
viewInsets.bottom == 0 &&
108106
viewInsets.left == 0 &&
109107
viewInsets.right == 0;

lib/src/_src.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ export './screen_state.dart';
2121
export './transparent_page.dart';
2222
export './app_layout.dart';
2323
export './screen_route_manager.dart';
24-
export './screen.dart';
24+
export './screen.dart';

lib/src/app_layout.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ enum AppLayout {
5858
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
5959

6060
ScreenCalculator getCurrentScreenCalculator() {
61-
final firstDisplay = WidgetsBinding.instance.platformDispatcher.displays.first;
61+
final firstDisplay =
62+
WidgetsBinding.instance.platformDispatcher.displays.first;
6263
final displaySize = firstDisplay.size;
6364
final displayPixelRatio = firstDisplay.devicePixelRatio;
6465
final screenSize = displaySize / displayPixelRatio;

lib/src/screen_bread_crumb_bar.dart

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -62,32 +62,30 @@ class ScreenBreadCrumbBar extends StatelessWidget {
6262
.map((e) => e.path)
6363
.nonNulls
6464
.mapIndexed((n, path) {
65-
final last = n == screenBreadcrumbs.nonNulls.length - 1;
66-
return Material(
67-
color: Colors.transparent,
68-
child: InkWell(
69-
onTap:
70-
!last
71-
? () => routeService.goFromFront(n + 1)
72-
: null,
73-
child: Text(
74-
path,
75-
style: Theme.of(
76-
context,
77-
).textTheme.bodySmall?.copyWith(
78-
color:
79-
last
80-
? Theme.of(
81-
context,
82-
).colorScheme.onSurface.withAlpha(125)
83-
: Theme.of(
84-
context,
85-
).colorScheme.onSurface,
65+
final last = n == screenBreadcrumbs.nonNulls.length - 1;
66+
return Material(
67+
color: Colors.transparent,
68+
child: InkWell(
69+
onTap: !last
70+
? () => routeService.goFromFront(n + 1)
71+
: null,
72+
child: Text(
73+
path,
74+
style: Theme.of(
75+
context,
76+
).textTheme.bodySmall?.copyWith(
77+
color: last
78+
? Theme.of(
79+
context,
80+
).colorScheme.onSurface.withAlpha(125)
81+
: Theme.of(
82+
context,
83+
).colorScheme.onSurface,
8684
),
87-
),
88-
),
89-
);
90-
}),
85+
),
86+
),
87+
);
88+
}),
9189
],
9290
),
9391
);

lib/src/screen_controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ base class ScreenController<TExtra extends Object?> {
3131
//
3232

3333
ScreenController(this.superScreen, this.superState, [TExtra? extra])
34-
: pExtra = extra != null ? RootPod(extra) : null;
34+
: pExtra = extra != null ? RootPod(extra) : null;
3535

3636
//
3737
//

lib/src/screen_page.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ abstract base class ScreenPage extends StatefulWidget {
3636
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
3737

3838
abstract base class ScreenPageState<
39-
T1 extends ScreenPage,
40-
T2 extends ModelScreenConfiguration,
41-
T3 extends ScreenController<T2>
42-
>
43-
extends State<T1> {
39+
T1 extends ScreenPage,
40+
T2 extends ModelScreenConfiguration,
41+
T3 extends ScreenController<T2>> extends State<T1> {
4442
//
4543
//
4644
//

0 commit comments

Comments
 (0)