移除oktoast 添加bot_toast

hmxc
张萌 4 years ago
parent 0769137eb9
commit 0655d1fd20

@ -1 +1 @@
36d97e3e1483892c0e0296e4c06bf36f 1639ba717cd75e55d448599066f95969

@ -6,6 +6,8 @@
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>

@ -2,6 +2,7 @@ import 'package:akuCommunity/pages/tab_navigator.dart';
import 'package:akuCommunity/provider/user_provider.dart'; import 'package:akuCommunity/provider/user_provider.dart';
import 'package:amap_map_fluttify/amap_map_fluttify.dart'; import 'package:amap_map_fluttify/amap_map_fluttify.dart';
import 'package:ani_route/ani_route.dart'; import 'package:ani_route/ani_route.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:fluwx/fluwx.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:flutter_picker/flutter_picker.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:oktoast/oktoast.dart';
import 'package:akuCommunity/routers/router_init.dart'; import 'package:akuCommunity/routers/router_init.dart';
void main() { void main() {
@ -43,38 +43,31 @@ class _MyAppState extends State<MyApp> {
ChangeNotifierProvider(create: (context) => CartProvidde()), ChangeNotifierProvider(create: (context) => CartProvidde()),
ChangeNotifierProvider(create: (context) => UserProvider()), ChangeNotifierProvider(create: (context) => UserProvider()),
], ],
child: OKToast( child: GetMaterialApp(
textStyle: TextStyle(fontSize: 19.0, color: Colors.white), title: '智慧社区',
backgroundColor: Colors.grey, // builder: BotToastInit(),
radius: 10.0, // navigatorObservers: [BotToastNavigatorObserver()],
animationCurve: Curves.easeIn, navigatorKey: RouterInit.navigatorKey,
animationBuilder: Miui10AnimBuilder(), onGenerateRoute: RouterInit.router.generator,
animationDuration: Duration(milliseconds: 200), debugShowCheckedModeBanner: false,
duration: Duration(seconds: 3), theme: ThemeData(
child: GetMaterialApp( primarySwatch: Colors.yellow,
title: '智慧社区', visualDensity: VisualDensity.adaptivePlatformDensity,
// 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'),
), ),
// 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()],
), ),
); );
} }

@ -1,12 +1,12 @@
import 'dart:math'; import 'dart:math';
import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart'; import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:akuCommunity/utils/screenutil.dart'; import 'package:akuCommunity/utils/screenutil.dart';
import 'package:akuCommunity/widget/common_app_bar.dart'; import 'package:akuCommunity/widget/common_app_bar.dart';
import 'package:akuCommunity/widget/common_image_picker.dart'; import 'package:akuCommunity/widget/common_image_picker.dart';
import 'package:oktoast/oktoast.dart';
class FeedBackPage extends StatefulWidget { class FeedBackPage extends StatefulWidget {
FeedBackPage({Key key}) : super(key: key); FeedBackPage({Key key}) : super(key: key);
@ -61,7 +61,7 @@ class _FeedBackPageState extends State<FeedBackPage> {
return InkWell( return InkWell(
onTap: () { onTap: () {
if (TextUtil.isEmpty(_ideaContent.text)) if (TextUtil.isEmpty(_ideaContent.text))
showToast('意见不能为空'); BotToast.showText(text:'意见不能为空');
else { else {
showDialog( showDialog(
context: context, context: context,
@ -71,7 +71,7 @@ class _FeedBackPageState extends State<FeedBackPage> {
); );
Future.delayed(Duration(milliseconds: 1000 + Random().nextInt(1000)), Future.delayed(Duration(milliseconds: 1000 + Random().nextInt(1000)),
() { () {
showToast('意见提交成功'); BotToast.showText(text:'提交成功');
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
}); });

@ -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/setting_page/agreement_page/privacy_page.dart';
import 'package:akuCommunity/pages/sign/user_authentication_page.dart'; import 'package:akuCommunity/pages/sign/user_authentication_page.dart';
import 'package:ani_route/ani_route.dart'; import 'package:ani_route/ani_route.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart' show TextUtil; import 'package:flustars/flustars.dart' show TextUtil;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:akuCommunity/utils/screenutil.dart'; import 'package:akuCommunity/utils/screenutil.dart';
import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/base/assets_image.dart'; import 'package:akuCommunity/base/assets_image.dart';
import 'package:oktoast/oktoast.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class SignInPage extends StatefulWidget { class SignInPage extends StatefulWidget {
@ -131,9 +131,9 @@ class _SignInPageState extends State<SignInPage> {
return InkWell( return InkWell(
onTap: () { onTap: () {
if (TextUtil.isEmpty(_phone.text)) if (TextUtil.isEmpty(_phone.text))
showToast('手机号不能为空'); BotToast.showText(text: '手机号不能为空');
else if (TextUtil.isEmpty(_code.text)) else if (TextUtil.isEmpty(_code.text))
showToast('验证码不能为空'); BotToast.showText(text: '验证码不能为空');
else { else {
showCupertinoDialog( showCupertinoDialog(
context: context, context: context,
@ -153,7 +153,7 @@ class _SignInPageState extends State<SignInPage> {
(_phone.text == '18067170899') && (_phone.text == '18067170899') &&
(_code.text == '123456') (_code.text == '123456')
? ARoute.push(context, UserAuthenticationPage()) ? ARoute.push(context, UserAuthenticationPage())
: showToast('账号或密码错误!'); : BotToast.showText(text: '账号或密码错误!');
}, },
); );
}, },
@ -174,8 +174,7 @@ class _SignInPageState extends State<SignInPage> {
alignment: Alignment.center, alignment: Alignment.center,
height: 89.w, height: 89.w,
width: 586.w, width: 586.w,
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 25.w, bottom: 24.w),
top: 25.w, bottom: 24.w),
margin: EdgeInsets.symmetric(horizontal: 82.w), margin: EdgeInsets.symmetric(horizontal: 82.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xffffc40c), color: Color(0xffffc40c),
@ -237,7 +236,7 @@ class _SignInPageState extends State<SignInPage> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
FlatButton( FlatButton(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
onPressed: () { onPressed: () {
ARoute.push(context, AgreementPage()); ARoute.push(context, AgreementPage());
}, },
@ -249,7 +248,7 @@ class _SignInPageState extends State<SignInPage> {
)), )),
SizedBox(width: 15.w), SizedBox(width: 15.w),
FlatButton( FlatButton(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
onPressed: () { onPressed: () {
ARoute.push(context, PrivacyPage()); ARoute.push(context, PrivacyPage());
}, },

@ -1,16 +1,15 @@
import 'package:oktoast/oktoast.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class Toast { class Toast {
static ToastFuture globalToast(String text) { static globalToast(String text) {
return showToast( return BotToast.showText(text:
text, text,
duration: Duration(milliseconds: 2000), duration: Duration(milliseconds: 2000),
// position: ToastPosition.top, borderRadius: BorderRadius.circular(3.w),
radius: 3.0,
backgroundColor: Color(0xff000000).withOpacity(0.85), backgroundColor: Color(0xff000000).withOpacity(0.85),
animationBuilder: Miui10AnimBuilder(),
textStyle: TextStyle(fontSize: ScreenUtil().setSp(34)), textStyle: TextStyle(fontSize: ScreenUtil().setSp(34)),
); );
} }

@ -112,7 +112,7 @@ packages:
name: bot_toast name: bot_toast
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "3.0.4" version: "3.0.5"
cached_network_image: cached_network_image:
dependency: "direct main" dependency: "direct main"
description: description:
@ -665,13 +665,6 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.2.1" 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: open_iconic_flutter:
dependency: transitive dependency: transitive
description: description:

@ -32,8 +32,6 @@ dependencies:
permission_handler: ^5.0.1+1 permission_handler: ^5.0.1+1
# 版本信息 # 版本信息
package_info: 0.4.1 package_info: 0.4.1
# toast提示
oktoast: ^2.1.6
#上拉加载 #上拉加载
pull_to_refresh: ^1.6.2 pull_to_refresh: ^1.6.2
# 状态管理 # 状态管理
@ -69,7 +67,7 @@ dependencies:
#头像层叠 #头像层叠
image_stack: ^1.1.0 image_stack: ^1.1.0
#弹窗 #弹窗
bot_toast: ^3.0.4 bot_toast: ^3.0.5
#加载html #加载html
flutter_html: ^1.0.2 flutter_html: ^1.0.2
#图片多选 #图片多选

Loading…
Cancel
Save