1
0
mirror of https://github.com/stonega/tsacdop synced 2024-12-17 02:39:28 +01:00
tsacdop-podcast-app-android/lib/util/general_dialog.dart
stonegate 9c13450a9c Add feature discovery
Add privacy page
2020-06-07 20:47:28 +08:00

35 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'context_extension.dart';
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),
title: SizedBox(width: context.width-160, child: title),
content: content,
actionsPadding: EdgeInsets.all(10),
actions: actions),
),
);