Skip to content

Commit

Permalink
Media query fix
Browse files Browse the repository at this point in the history
  • Loading branch information
leoafarias committed May 11, 2024
1 parent de01c7e commit c698a62
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .fvmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"flutter": "3.19.0",
"flutter": "stable",
"flavors": {}
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"dart.flutterSdkPath": ".fvm/versions/3.19.0",
"dart.flutterSdkPath": ".fvm/versions/stable",
"files.exclude": {
"**/.fvm/versions": true,
"**/.fvm/flutter_sdk": true
Expand Down
6 changes: 1 addition & 5 deletions example/firebase.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"hosting": {
"source": ".",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"frameworksBackend": {
"region": "us-east1"
}
Expand Down
Binary file modified example/superdeck/generated/thumb_aShu2Vm6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified example/superdeck/generated/thumb_zXfqPfVD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/components/molecules/split_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class _SplitViewState extends State<SplitView>
final currentSlide = navigation.currentSlide.watch(context);
final sideIsOpen = navigation.sideIsOpen.watch(context);

final isSmall = context.isMobile;
final isSmall = context.isSmall || context.isMobileLandscape;

final sidePanel = SlideThumbnailList(
scrollDirection: isSmall ? Axis.horizontal : Axis.vertical,
Expand Down
61 changes: 28 additions & 33 deletions lib/components/superdeck_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,39 +86,34 @@ class _SuperDeckAppState extends State<SuperDeckApp> {
);
}

return MediaQuery(
data: const MediaQueryData(
size: kResolution,
),
child: Theme(
data: theme,
child: Builder(builder: (context) {
return MixTheme(
data: MixThemeData.withMaterial(),
child: MaterialApp.router(
debugShowCheckedModeBanner: false,
title: 'Superdeck',
routerConfig: _router,
theme: Theme.of(context),
key: kAppKey,
builder: (context, child) {
final result = _initialize.watch(context);

return result.map(
data: (_) => child!,
loading: () => renderLoading(),
error: (error, _) {
return ExceptionWidget(
error,
onRetry: _initialize.reload,
);
},
);
},
),
);
}),
),
return Theme(
data: theme,
child: Builder(builder: (context) {
return MixTheme(
data: MixThemeData.withMaterial(),
child: MaterialApp.router(
debugShowCheckedModeBanner: false,
title: 'Superdeck',
routerConfig: _router,
theme: Theme.of(context),
key: kAppKey,
builder: (context, child) {
final result = _initialize.watch(context);

return result.map(
data: (_) => child!,
loading: () => renderLoading(),
error: (error, _) {
return ExceptionWidget(
error,
onRetry: _initialize.reload,
);
},
);
},
),
);
}),
);
}
}
Expand Down
2 changes: 0 additions & 2 deletions lib/helpers/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ extension BuildContextExt on BuildContext {

bool get isExtraLarge => size.width >= 1440;

bool get isMobile => isSmall || isMobileLandscape;

bool get isMobileLandscape {
return size.shortestSide < 600 && isLandscape;
}
Expand Down

0 comments on commit c698a62

Please sign in to comment.