refactor: use popup show

This commit is contained in:
Rongjian Zhang 2022-09-18 20:37:33 +08:00
parent b2e7a97dab
commit 8eda3e36c8
2 changed files with 9 additions and 22 deletions

View File

@ -232,25 +232,6 @@ class ThemeModel with ChangeNotifier {
}
}
Future<void> showWarning(BuildContext context, String message) async {
showCupertinoDialog(
context: context,
builder: (context) {
return CupertinoAlertDialog(
title: Text(message),
actions: <Widget>[
CupertinoDialogAction(
child: const Text('OK'),
onPressed: () {
Navigator.pop(context, true);
},
),
],
);
},
);
}
Future<bool?> showConfirm(BuildContext context, Widget content) {
return showCupertinoDialog(
context: context,
@ -281,8 +262,9 @@ class ThemeModel with ChangeNotifier {
String? _selectedItem;
showPicker(BuildContext context, PickerGroupItem<String?> groupItem) async {
await showCupertinoModalPopup(
await AntPopup.show(
context: context,
closeOnMaskClick: true,
builder: (context) {
return Column(
mainAxisAlignment: MainAxisAlignment.end,

View File

@ -1,3 +1,4 @@
import 'package:antd_mobile/antd_mobile.dart';
import 'package:flutter/cupertino.dart';
import 'package:from_css_color/from_css_color.dart';
import 'package:git_touch/models/theme.dart';
@ -31,8 +32,12 @@ class LanguageBar extends StatelessWidget {
return CupertinoButton(
padding: EdgeInsets.zero,
minSize: 0,
onPressed: () {
showCupertinoModalPopup(context: context, builder: _buildPopup);
onPressed: () async {
await AntPopup.show(
context: context,
closeOnMaskClick: true,
builder: _buildPopup,
);
},
child: Container(
// color: theme.palette.background,