mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-09 15:38:13 -07:00
27 lines
738 B
Dart
27 lines
738 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.of(context).inputDevice == InputDevice.pointer) {
|
|
return showDialog(
|
|
context: context,
|
|
useSafeArea: false,
|
|
builder: (context) => Dialog(
|
|
child: builder(context),
|
|
),
|
|
);
|
|
} else {
|
|
return showDialog(
|
|
context: context,
|
|
useSafeArea: false,
|
|
builder: (context) => Padding(
|
|
padding: MediaQuery.paddingOf(context),
|
|
child: Dialog.fullscreen(
|
|
child: builder(context),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|