mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
26 lines
647 B
Dart
26 lines
647 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:fladder/util/adaptive_layout/adaptive_layout.dart';
|
|
|
|
Future<void> showDialogAdaptive({
|
|
required BuildContext context,
|
|
required Widget Function(BuildContext context) builder,
|
|
}) {
|
|
if (AdaptiveLayout.viewSizeOf(context) >= ViewSize.tablet) {
|
|
return showDialog(
|
|
context: context,
|
|
useSafeArea: false,
|
|
builder: (context) => Dialog(
|
|
child: builder(context),
|
|
),
|
|
);
|
|
} else {
|
|
return showDialog(
|
|
context: context,
|
|
useSafeArea: false,
|
|
builder: (context) => Dialog.fullscreen(
|
|
child: builder(context),
|
|
),
|
|
);
|
|
}
|
|
}
|