mirror of
https://github.com/git-touch/git-touch
synced 2025-03-04 11:17:47 +01:00
refactor: use popup show
This commit is contained in:
parent
b2e7a97dab
commit
8eda3e36c8
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user