From 0655d1fd20b6f2f827d98ec6d887269b56d8d3cf Mon Sep 17 00:00:00 2001
From: zhang <494089941@qq.com>
Date: Tue, 12 Jan 2021 14:30:17 +0800
Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4oktoast=20=20=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0bot=5Ftoast?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ios/Flutter/.last_build_id | 2 +-
ios/Runner/Info.plist | 2 +
lib/main.dart | 57 ++++++++-----------
.../feedback_page/feedback_page.dart | 6 +-
lib/pages/sign/sign_in_page.dart | 15 +++--
lib/utils/toast.dart | 11 ++--
pubspec.lock | 9 +--
pubspec.yaml | 4 +-
8 files changed, 45 insertions(+), 61 deletions(-)
diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id
index 23e945dc..ad3dfad9 100644
--- a/ios/Flutter/.last_build_id
+++ b/ios/Flutter/.last_build_id
@@ -1 +1 @@
-36d97e3e1483892c0e0296e4c06bf36f
\ No newline at end of file
+1639ba717cd75e55d448599066f95969
\ No newline at end of file
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index d34d3df7..dc2cdc5d 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -6,6 +6,8 @@
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
+ CFBundleVersion
+ $(FLUTTER_BUILD_NUMBER)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
diff --git a/lib/main.dart b/lib/main.dart
index dfd25aa9..fbd43304 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -2,6 +2,7 @@ import 'package:akuCommunity/pages/tab_navigator.dart';
import 'package:akuCommunity/provider/user_provider.dart';
import 'package:amap_map_fluttify/amap_map_fluttify.dart';
import 'package:ani_route/ani_route.dart';
+import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:fluwx/fluwx.dart';
@@ -11,7 +12,6 @@ import 'package:akuCommunity/provider/cart.dart';
import 'package:flutter_picker/flutter_picker.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
-import 'package:oktoast/oktoast.dart';
import 'package:akuCommunity/routers/router_init.dart';
void main() {
@@ -43,38 +43,31 @@ class _MyAppState extends State {
ChangeNotifierProvider(create: (context) => CartProvidde()),
ChangeNotifierProvider(create: (context) => UserProvider()),
],
- child: OKToast(
- textStyle: TextStyle(fontSize: 19.0, color: Colors.white),
- backgroundColor: Colors.grey,
- radius: 10.0,
- animationCurve: Curves.easeIn,
- animationBuilder: Miui10AnimBuilder(),
- animationDuration: Duration(milliseconds: 200),
- duration: Duration(seconds: 3),
- child: GetMaterialApp(
- title: '智慧社区',
- // builder: BotToastInit(),
- // navigatorObservers: [BotToastNavigatorObserver()],
- navigatorKey: RouterInit.navigatorKey,
- onGenerateRoute: RouterInit.router.generator,
- debugShowCheckedModeBanner: false,
- theme: ThemeData(
- primarySwatch: Colors.yellow,
- visualDensity: VisualDensity.adaptivePlatformDensity,
- ),
- // home: TabNavigator(),
- home: TabNavigator(),
- //国际化支持
- localizationsDelegates: [
- PickerLocalizationsDelegate.delegate,
- RefreshLocalizations.delegate,
- GlobalMaterialLocalizations.delegate,
- GlobalWidgetsLocalizations.delegate,
- GlobalCupertinoLocalizations.delegate,
- ],
- supportedLocales: [const Locale('zh', 'CH')],
- locale: Locale('zh'),
+ child: GetMaterialApp(
+ title: '智慧社区',
+ // builder: BotToastInit(),
+ // navigatorObservers: [BotToastNavigatorObserver()],
+ navigatorKey: RouterInit.navigatorKey,
+ onGenerateRoute: RouterInit.router.generator,
+ debugShowCheckedModeBanner: false,
+ theme: ThemeData(
+ primarySwatch: Colors.yellow,
+ visualDensity: VisualDensity.adaptivePlatformDensity,
),
+ // home: TabNavigator(),
+ home: TabNavigator(),
+ //国际化支持
+ localizationsDelegates: [
+ PickerLocalizationsDelegate.delegate,
+ RefreshLocalizations.delegate,
+ GlobalMaterialLocalizations.delegate,
+ GlobalWidgetsLocalizations.delegate,
+ GlobalCupertinoLocalizations.delegate,
+ ],
+ supportedLocales: [const Locale('zh', 'CH')],
+ locale: Locale('zh'),
+ builder: BotToastInit(),
+ navigatorObservers: [BotToastNavigatorObserver()],
),
);
}
diff --git a/lib/pages/setting_page/feedback_page/feedback_page.dart b/lib/pages/setting_page/feedback_page/feedback_page.dart
index 99941fe5..cf0c3e6c 100644
--- a/lib/pages/setting_page/feedback_page/feedback_page.dart
+++ b/lib/pages/setting_page/feedback_page/feedback_page.dart
@@ -1,12 +1,12 @@
import 'dart:math';
+import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:akuCommunity/utils/screenutil.dart';
import 'package:akuCommunity/widget/common_app_bar.dart';
import 'package:akuCommunity/widget/common_image_picker.dart';
-import 'package:oktoast/oktoast.dart';
class FeedBackPage extends StatefulWidget {
FeedBackPage({Key key}) : super(key: key);
@@ -61,7 +61,7 @@ class _FeedBackPageState extends State {
return InkWell(
onTap: () {
if (TextUtil.isEmpty(_ideaContent.text))
- showToast('意见不能为空');
+ BotToast.showText(text:'意见不能为空');
else {
showDialog(
context: context,
@@ -71,7 +71,7 @@ class _FeedBackPageState extends State {
);
Future.delayed(Duration(milliseconds: 1000 + Random().nextInt(1000)),
() {
- showToast('意见提交成功');
+ BotToast.showText(text:'提交成功');
Navigator.pop(context);
Navigator.pop(context);
});
diff --git a/lib/pages/sign/sign_in_page.dart b/lib/pages/sign/sign_in_page.dart
index 2714553f..48348af7 100644
--- a/lib/pages/sign/sign_in_page.dart
+++ b/lib/pages/sign/sign_in_page.dart
@@ -5,13 +5,13 @@ import 'package:akuCommunity/pages/setting_page/agreement_page/agreement_page.da
import 'package:akuCommunity/pages/setting_page/agreement_page/privacy_page.dart';
import 'package:akuCommunity/pages/sign/user_authentication_page.dart';
import 'package:ani_route/ani_route.dart';
+import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart' show TextUtil;
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:akuCommunity/utils/screenutil.dart';
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/base/assets_image.dart';
-import 'package:oktoast/oktoast.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class SignInPage extends StatefulWidget {
@@ -131,9 +131,9 @@ class _SignInPageState extends State {
return InkWell(
onTap: () {
if (TextUtil.isEmpty(_phone.text))
- showToast('手机号不能为空');
+ BotToast.showText(text: '手机号不能为空');
else if (TextUtil.isEmpty(_code.text))
- showToast('验证码不能为空');
+ BotToast.showText(text: '验证码不能为空');
else {
showCupertinoDialog(
context: context,
@@ -153,7 +153,7 @@ class _SignInPageState extends State {
(_phone.text == '18067170899') &&
(_code.text == '123456')
? ARoute.push(context, UserAuthenticationPage())
- : showToast('账号或密码错误!');
+ : BotToast.showText(text: '账号或密码错误!');
},
);
},
@@ -174,8 +174,7 @@ class _SignInPageState extends State {
alignment: Alignment.center,
height: 89.w,
width: 586.w,
- padding: EdgeInsets.only(
- top: 25.w, bottom: 24.w),
+ padding: EdgeInsets.only(top: 25.w, bottom: 24.w),
margin: EdgeInsets.symmetric(horizontal: 82.w),
decoration: BoxDecoration(
color: Color(0xffffc40c),
@@ -237,7 +236,7 @@ class _SignInPageState extends State {
mainAxisAlignment: MainAxisAlignment.center,
children: [
FlatButton(
- padding: EdgeInsets.zero,
+ padding: EdgeInsets.zero,
onPressed: () {
ARoute.push(context, AgreementPage());
},
@@ -249,7 +248,7 @@ class _SignInPageState extends State {
)),
SizedBox(width: 15.w),
FlatButton(
- padding: EdgeInsets.zero,
+ padding: EdgeInsets.zero,
onPressed: () {
ARoute.push(context, PrivacyPage());
},
diff --git a/lib/utils/toast.dart b/lib/utils/toast.dart
index 6ecced28..302b15cb 100644
--- a/lib/utils/toast.dart
+++ b/lib/utils/toast.dart
@@ -1,16 +1,15 @@
-import 'package:oktoast/oktoast.dart';
+
+import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class Toast {
- static ToastFuture globalToast(String text) {
- return showToast(
+ static globalToast(String text) {
+ return BotToast.showText(text:
text,
duration: Duration(milliseconds: 2000),
- // position: ToastPosition.top,
- radius: 3.0,
+ borderRadius: BorderRadius.circular(3.w),
backgroundColor: Color(0xff000000).withOpacity(0.85),
- animationBuilder: Miui10AnimBuilder(),
textStyle: TextStyle(fontSize: ScreenUtil().setSp(34)),
);
}
diff --git a/pubspec.lock b/pubspec.lock
index d339c9cc..b2ad4e5a 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -112,7 +112,7 @@ packages:
name: bot_toast
url: "https://pub.flutter-io.cn"
source: hosted
- version: "3.0.4"
+ version: "3.0.5"
cached_network_image:
dependency: "direct main"
description:
@@ -665,13 +665,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.1"
- oktoast:
- dependency: "direct main"
- description:
- name: oktoast
- url: "https://pub.flutter-io.cn"
- source: hosted
- version: "2.3.2"
open_iconic_flutter:
dependency: transitive
description:
diff --git a/pubspec.yaml b/pubspec.yaml
index fed12789..4fdcc0fc 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -32,8 +32,6 @@ dependencies:
permission_handler: ^5.0.1+1
# 版本信息
package_info: 0.4.1
- # toast提示
- oktoast: ^2.1.6
#上拉加载
pull_to_refresh: ^1.6.2
# 状态管理
@@ -69,7 +67,7 @@ dependencies:
#头像层叠
image_stack: ^1.1.0
#弹窗
- bot_toast: ^3.0.4
+ bot_toast: ^3.0.5
#加载html
flutter_html: ^1.0.2
#图片多选