fluttertoast插件修改
This commit is contained in:
parent
be07fc454d
commit
2a0b3e5aa1
|
|
@ -4,31 +4,41 @@ PODS:
|
|||
- Flutter
|
||||
- AgoraIrisRTC_iOS (3.6.2-fix.1)
|
||||
- Flutter (1.0.0)
|
||||
- "permission_handler (5.1.0+2)":
|
||||
- fluttertoast (0.0.2):
|
||||
- Flutter
|
||||
- Toast
|
||||
- permission_handler_apple (9.0.4):
|
||||
- Flutter
|
||||
- Toast (4.0.0)
|
||||
|
||||
DEPENDENCIES:
|
||||
- agora_rtc_engine (from `.symlinks/plugins/agora_rtc_engine/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
|
||||
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
|
||||
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- AgoraIrisRTC_iOS
|
||||
- Toast
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
agora_rtc_engine:
|
||||
:path: ".symlinks/plugins/agora_rtc_engine/ios"
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
permission_handler:
|
||||
:path: ".symlinks/plugins/permission_handler/ios"
|
||||
fluttertoast:
|
||||
:path: ".symlinks/plugins/fluttertoast/ios"
|
||||
permission_handler_apple:
|
||||
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
agora_rtc_engine: ffc530eff766a38272568ebaead9341d73f58856
|
||||
AgoraIrisRTC_iOS: 9b11083bb79048ae4db7e2f56109cc51ac9e3834
|
||||
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
|
||||
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
|
||||
fluttertoast: 16fbe6039d06a763f3533670197d01fc73459037
|
||||
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
|
||||
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
|
||||
|
||||
PODFILE CHECKSUM: bd5ecd90bb4d3dada07dd6c6725bb70ab42e9619
|
||||
|
||||
|
|
|
|||
|
|
@ -1,98 +1,98 @@
|
|||
// import 'package:flutter/material.dart';
|
||||
// import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
|
||||
// // 普通气泡弹框
|
||||
// // 使用:showToast("xxxxxxx");
|
||||
// void showToast(
|
||||
// String text, {
|
||||
// gravity: ToastGravity.CENTER,
|
||||
// toastLength: Toast.LENGTH_SHORT,
|
||||
// }) {
|
||||
// Fluttertoast.showToast(
|
||||
// msg: text,
|
||||
// toastLength: Toast.LENGTH_SHORT,
|
||||
// gravity: ToastGravity.CENTER,
|
||||
// timeInSecForIosWeb: 3,
|
||||
// backgroundColor: Colors.grey[600], // 灰色背景
|
||||
// fontSize: 16.0,
|
||||
// );
|
||||
// }
|
||||
// 普通气泡弹框
|
||||
// 使用:showToast("xxxxxxx");
|
||||
void showToast(
|
||||
String text, {
|
||||
gravity: ToastGravity.CENTER,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
}) {
|
||||
Fluttertoast.showToast(
|
||||
msg: text,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.CENTER,
|
||||
timeInSecForIosWeb: 3,
|
||||
backgroundColor: Colors.grey[600], // 灰色背景
|
||||
fontSize: 16.0,
|
||||
);
|
||||
}
|
||||
|
||||
// // 一个加载中的动画,不传text时,默认显示文字Loading...
|
||||
// // 使用:showLoading(context, 'xxxxxxx');
|
||||
// void showLoading(context, text) {
|
||||
// text = text ?? "Loading...";
|
||||
// showDialog(
|
||||
// barrierDismissible: false,
|
||||
// context: context,
|
||||
// builder: (context) {
|
||||
// return Center(
|
||||
// child: Container(
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.white,
|
||||
// borderRadius: BorderRadius.circular(3.0),
|
||||
// boxShadow: [
|
||||
// // 阴影
|
||||
// BoxShadow(
|
||||
// color: Colors.black12,
|
||||
// //offset: Offset(2.0,2.0),
|
||||
// blurRadius: 10.0,
|
||||
// )
|
||||
// ]),
|
||||
// padding: EdgeInsets.all(16),
|
||||
// margin: EdgeInsets.all(16),
|
||||
// constraints: BoxConstraints(minHeight: 120, minWidth: 180),
|
||||
// child: Column(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: <Widget>[
|
||||
// SizedBox(
|
||||
// height: 30,
|
||||
// width: 30,
|
||||
// child: CircularProgressIndicator(
|
||||
// strokeWidth: 3,
|
||||
// ),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(top: 20.0),
|
||||
// child: Text(
|
||||
// text,
|
||||
// style: Theme.of(context).textTheme.bodyMedium,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
// 一个加载中的动画,不传text时,默认显示文字Loading...
|
||||
// 使用:showLoading(context, 'xxxxxxx');
|
||||
void showLoading(context, text) {
|
||||
text = text ?? "Loading...";
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return Center(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(3.0),
|
||||
boxShadow: [
|
||||
// 阴影
|
||||
BoxShadow(
|
||||
color: Colors.black12,
|
||||
//offset: Offset(2.0,2.0),
|
||||
blurRadius: 10.0,
|
||||
)
|
||||
]),
|
||||
padding: EdgeInsets.all(16),
|
||||
margin: EdgeInsets.all(16),
|
||||
constraints: BoxConstraints(minHeight: 120, minWidth: 180),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 30,
|
||||
width: 30,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 3,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 20.0),
|
||||
child: Text(
|
||||
text,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// // 带有确定取消按钮的提示框,content是提示框的内容文字,confirmCallback是点击确定按钮的回调
|
||||
// // 使用:showConfirmDialog(context, '确认xxxxxxx吗?', () {print('xxxxxxx');});
|
||||
// void showConfirmDialog(
|
||||
// BuildContext context, String content, Function confirmCallback) {
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (context) {
|
||||
// return AlertDialog(
|
||||
// title: Text("提示"),
|
||||
// content: Text(content),
|
||||
// actions: <Widget>[
|
||||
// FlatButton(
|
||||
// onPressed: () {
|
||||
// confirmCallback();
|
||||
// Navigator.of(context).pop();
|
||||
// },
|
||||
// child: Text("确认"),
|
||||
// ),
|
||||
// FlatButton(
|
||||
// onPressed: () {
|
||||
// Navigator.of(context).pop();
|
||||
// },
|
||||
// child: Text("取消"),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// });
|
||||
// }
|
||||
// 带有确定取消按钮的提示框,content是提示框的内容文字,confirmCallback是点击确定按钮的回调
|
||||
// 使用:showConfirmDialog(context, '确认xxxxxxx吗?', () {print('xxxxxxx');});
|
||||
void showConfirmDialog(
|
||||
BuildContext context, String content, Function confirmCallback) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text("提示"),
|
||||
content: Text(content),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
onPressed: () {
|
||||
confirmCallback();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text("确认"),
|
||||
),
|
||||
FlatButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text("取消"),
|
||||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
32
pubspec.lock
32
pubspec.lock
|
|
@ -93,6 +93,13 @@ packages:
|
|||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
fluttertoast:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: fluttertoast
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "8.0.9"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -155,7 +162,21 @@ packages:
|
|||
name: permission_handler
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "8.3.0"
|
||||
version: "10.0.0"
|
||||
permission_handler_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_android
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "10.0.0"
|
||||
permission_handler_apple:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_apple
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "9.0.4"
|
||||
permission_handler_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -163,6 +184,13 @@ packages:
|
|||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "3.7.0"
|
||||
permission_handler_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_windows
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.1.0"
|
||||
plugin_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -240,4 +268,4 @@ packages:
|
|||
version: "2.1.2"
|
||||
sdks:
|
||||
dart: ">=2.17.0 <3.0.0"
|
||||
flutter: ">=2.5.0"
|
||||
flutter: ">=2.8.0"
|
||||
|
|
|
|||
|
|
@ -34,9 +34,10 @@ dependencies:
|
|||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.2
|
||||
agora_rtc_engine: ^5.2.0
|
||||
permission_handler: ^8.3.0
|
||||
permission_handler: ^10.0.0
|
||||
validators: ^3.0.0
|
||||
dio: ^4.0.6
|
||||
fluttertoast: ^8.0.6
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
|
|
|||
Loading…
Reference in New Issue