mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-09 07:28:14 -07:00
feat: UI 2.0 and other Improvements (#357)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
9ca06eaa37
commit
e7b5bb40ff
169 changed files with 4584 additions and 3626 deletions
|
|
@ -1,5 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:fladder/theme.dart';
|
||||
|
||||
Future<void> showModalSideSheet(
|
||||
BuildContext context, {
|
||||
required Widget content,
|
||||
|
|
@ -30,13 +32,18 @@ Future<void> showModalSideSheet(
|
|||
pageBuilder: (context, animation1, animation2) {
|
||||
return Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Sheet(
|
||||
header: header,
|
||||
backButton: backButton,
|
||||
closeButton: closeButton,
|
||||
actions: actions,
|
||||
content: content,
|
||||
addDivider: addDivider,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0).copyWith(
|
||||
top: MediaQuery.paddingOf(context).top,
|
||||
),
|
||||
child: Sheet(
|
||||
header: header,
|
||||
backButton: backButton,
|
||||
closeButton: closeButton,
|
||||
actions: actions,
|
||||
content: content,
|
||||
addDivider: addDivider,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
@ -64,32 +71,40 @@ class Sheet extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final size = MediaQuery.of(context).size;
|
||||
final mediaQuery = MediaQuery.of(context);
|
||||
final size = mediaQuery.size;
|
||||
final theme = Theme.of(context);
|
||||
final colorScheme = theme.colorScheme;
|
||||
final padding = mediaQuery.padding.copyWith(left: 0, top: 0);
|
||||
|
||||
return Material(
|
||||
elevation: 1,
|
||||
color: colorScheme.surface,
|
||||
surfaceTintColor: colorScheme.onSurface,
|
||||
borderRadius: const BorderRadius.horizontal(left: Radius.circular(20)),
|
||||
child: Padding(
|
||||
padding: MediaQuery.of(context).padding,
|
||||
child: Container(
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 256,
|
||||
maxWidth: size.width <= 600 ? size.width : 400,
|
||||
minHeight: size.height,
|
||||
maxHeight: size.height,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildHeader(context),
|
||||
Expanded(
|
||||
child: content,
|
||||
),
|
||||
if (actions?.isNotEmpty ?? false) _buildFooter(context)
|
||||
],
|
||||
return MediaQuery(
|
||||
data: mediaQuery.copyWith(
|
||||
padding: mediaQuery.padding.copyWith(
|
||||
left: 0,
|
||||
)),
|
||||
child: Material(
|
||||
elevation: 1,
|
||||
color: colorScheme.surface,
|
||||
surfaceTintColor: colorScheme.onSurface,
|
||||
borderRadius: FladderTheme.largeShape.borderRadius,
|
||||
child: Padding(
|
||||
padding: padding,
|
||||
child: Container(
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 256,
|
||||
maxWidth: size.width <= 600 ? size.width : 400,
|
||||
minHeight: size.height,
|
||||
maxHeight: size.height,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildHeader(context),
|
||||
Expanded(
|
||||
child: content,
|
||||
),
|
||||
if (actions?.isNotEmpty ?? false) _buildFooter(context)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue