2020-06-07 14:47:28 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
2020-07-22 11:34:32 +02:00
|
|
|
import 'extension_helper.dart';
|
2020-06-07 14:47:28 +02:00
|
|
|
|
|
|
|
generalDialog(BuildContext context,
|
|
|
|
{Widget title, Widget content, List<Widget> actions}) =>
|
|
|
|
showGeneralDialog(
|
|
|
|
context: context,
|
|
|
|
barrierDismissible: true,
|
|
|
|
barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
|
|
|
|
barrierColor: Colors.black54,
|
|
|
|
transitionDuration: const Duration(milliseconds: 200),
|
|
|
|
pageBuilder: (BuildContext context, Animation animaiton,
|
|
|
|
Animation secondaryAnimation) =>
|
|
|
|
AnnotatedRegion<SystemUiOverlayStyle>(
|
|
|
|
value: SystemUiOverlayStyle(
|
|
|
|
statusBarIconBrightness: Brightness.light,
|
|
|
|
systemNavigationBarColor:
|
|
|
|
Theme.of(context).brightness == Brightness.light
|
|
|
|
? Color.fromRGBO(113, 113, 113, 1)
|
|
|
|
: Color.fromRGBO(15, 15, 15, 1),
|
|
|
|
),
|
|
|
|
child: AlertDialog(
|
|
|
|
elevation: 1,
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
|
|
|
titlePadding: EdgeInsets.all(20),
|
2020-07-22 11:34:32 +02:00
|
|
|
title: SizedBox(width: context.width - 160, child: title),
|
2020-06-07 14:47:28 +02:00
|
|
|
content: content,
|
|
|
|
actionsPadding: EdgeInsets.all(10),
|
|
|
|
actions: actions),
|
|
|
|
),
|
|
|
|
);
|