mirror of
https://github.com/git-touch/git-touch
synced 2025-03-04 19:27:40 +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) {
|
Future<bool?> showConfirm(BuildContext context, Widget content) {
|
||||||
return showCupertinoDialog(
|
return showCupertinoDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@ -281,8 +262,9 @@ class ThemeModel with ChangeNotifier {
|
|||||||
String? _selectedItem;
|
String? _selectedItem;
|
||||||
|
|
||||||
showPicker(BuildContext context, PickerGroupItem<String?> groupItem) async {
|
showPicker(BuildContext context, PickerGroupItem<String?> groupItem) async {
|
||||||
await showCupertinoModalPopup(
|
await AntPopup.show(
|
||||||
context: context,
|
context: context,
|
||||||
|
closeOnMaskClick: true,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:antd_mobile/antd_mobile.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:from_css_color/from_css_color.dart';
|
import 'package:from_css_color/from_css_color.dart';
|
||||||
import 'package:git_touch/models/theme.dart';
|
import 'package:git_touch/models/theme.dart';
|
||||||
@ -31,8 +32,12 @@ class LanguageBar extends StatelessWidget {
|
|||||||
return CupertinoButton(
|
return CupertinoButton(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
minSize: 0,
|
minSize: 0,
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
showCupertinoModalPopup(context: context, builder: _buildPopup);
|
await AntPopup.show(
|
||||||
|
context: context,
|
||||||
|
closeOnMaskClick: true,
|
||||||
|
builder: _buildPopup,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
// color: theme.palette.background,
|
// color: theme.palette.background,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user