mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
fix: padding issues (#47)
## Pull Request Description This fixes a bunch of padding issues, and also improves padding in other areas. Issue Number: #29 --------- Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
f5343be4e7
commit
6669a06e53
18 changed files with 926 additions and 877 deletions
|
|
@ -121,6 +121,8 @@ class AdaptiveLayout extends InheritedWidget {
|
|||
}
|
||||
}
|
||||
|
||||
const defaultTitleBarHeight = 35.0;
|
||||
|
||||
class AdaptiveLayoutBuilder extends ConsumerStatefulWidget {
|
||||
final List<LayoutPoints> layoutPoints;
|
||||
final LayoutState fallBack;
|
||||
|
|
@ -182,20 +184,26 @@ class _AdaptiveLayoutBuilderState extends ConsumerState<AdaptiveLayoutBuilder> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AdaptiveLayout(
|
||||
layout: layout,
|
||||
controller: controller,
|
||||
size: size,
|
||||
inputDevice: (isDesktop || kIsWeb) ? InputDevice.pointer : InputDevice.touch,
|
||||
platform: currentPlatform,
|
||||
isDesktop: isDesktop,
|
||||
router: router,
|
||||
posterDefaults: switch (layout) {
|
||||
LayoutState.phone => const PosterDefaults(size: 300, ratio: 0.55),
|
||||
LayoutState.tablet => const PosterDefaults(size: 350, ratio: 0.55),
|
||||
LayoutState.desktop => const PosterDefaults(size: 400, ratio: 0.55),
|
||||
},
|
||||
child: widget.child,
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
padding: isDesktop || kIsWeb ? const EdgeInsets.only(top: defaultTitleBarHeight, bottom: 16) : null,
|
||||
viewPadding: isDesktop || kIsWeb ? const EdgeInsets.only(top: defaultTitleBarHeight, bottom: 16) : null,
|
||||
),
|
||||
child: AdaptiveLayout(
|
||||
layout: layout,
|
||||
controller: controller,
|
||||
size: size,
|
||||
inputDevice: (isDesktop || kIsWeb) ? InputDevice.pointer : InputDevice.touch,
|
||||
platform: currentPlatform,
|
||||
isDesktop: isDesktop,
|
||||
router: router,
|
||||
posterDefaults: switch (layout) {
|
||||
LayoutState.phone => const PosterDefaults(size: 300, ratio: 0.55),
|
||||
LayoutState.tablet => const PosterDefaults(size: 350, ratio: 0.55),
|
||||
LayoutState.desktop => const PosterDefaults(size: 400, ratio: 0.55),
|
||||
},
|
||||
child: widget.child,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue