refactor: Improved share / forward dialog
This commit is contained in:
parent
69d4c50b13
commit
88e63d127a
9 changed files with 488 additions and 361 deletions
36
lib/utils/show_scaffold_dialog.dart
Normal file
36
lib/utils/show_scaffold_dialog.dart
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
|
||||
Future<void> showScaffoldDialog({
|
||||
required BuildContext context,
|
||||
Color? barrierColor,
|
||||
Color? containerColor,
|
||||
double maxWidth = 480,
|
||||
double maxHeight = 720,
|
||||
required Widget Function(BuildContext context) builder,
|
||||
}) =>
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: FluffyThemes.isColumnMode(context)
|
||||
? (context) => Center(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.borderRadius,
|
||||
),
|
||||
color: containerColor ??
|
||||
Theme.of(context).scaffoldBackgroundColor,
|
||||
),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
margin: const EdgeInsets.all(16),
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: maxWidth,
|
||||
maxHeight: maxHeight,
|
||||
),
|
||||
child: builder(context),
|
||||
),
|
||||
)
|
||||
: builder,
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue