添加FAKE账号退出的功能

hmxc
小赖 4 years ago
parent 7a1b507801
commit d77d17dfb8

@ -1,9 +1,9 @@
import 'package:akuCommunity/pages/sign/sign_in_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:akuCommunity/provider/cart.dart'; import 'package:akuCommunity/provider/cart.dart';
import 'package:fluro/fluro.dart';
import 'package:bot_toast/bot_toast.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';
@ -43,7 +43,8 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.yellow, primarySwatch: Colors.yellow,
visualDensity: VisualDensity.adaptivePlatformDensity, visualDensity: VisualDensity.adaptivePlatformDensity,
), ),
home: TabNavigator(), // home: TabNavigator(),
home: SignInPage(),
// //
localizationsDelegates: [ localizationsDelegates: [
PickerLocalizationsDelegate.delegate, PickerLocalizationsDelegate.delegate,

@ -1,3 +1,4 @@
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_icons/flutter_icons.dart';
@ -97,7 +98,10 @@ class _GoodsDetailsBottomBarState extends State<GoodsDetailsBottomBar> {
) )
], ],
), ),
onTap: () {}, onTap: () {
Navigator.pushNamed(
context, PageName.market_cart_page.toString());
},
), ),
SizedBox(width: ScreenUtil().setWidth(53)), SizedBox(width: ScreenUtil().setWidth(53)),
InkWell( InkWell(

@ -1,5 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'package:akuCommunity/pages/sign/sign_in_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_icons/flutter_icons.dart';
@ -130,9 +131,19 @@ class _SettingPageState extends State<SettingPage> {
/// 使 /// 使
Future<int> showPayActionSheets( Future<int> showPayActionSheets(
{@required BuildContext context, String title, String subtitle}) { {@required BuildContext context, String title, String subtitle}) {
return showCustomBottomSheet(context: context, title: title, children: [ return showCustomBottomSheet(
actionItem(context: context, index: 1, title: subtitle, isLastOne: true), context: context,
]); title: title,
children: [
actionItem(
context: context,
index: 1,
title: subtitle,
isLastOne: true,
onTap: () {},
),
],
);
} }
Widget _inkWellListTile(String title, bool isSwitch) { Widget _inkWellListTile(String title, bool isSwitch) {
@ -152,7 +163,40 @@ class _SettingPageState extends State<SettingPage> {
_showDialog('是否清除缓存?'); _showDialog('是否清除缓存?');
break; break;
case '账号管理': case '账号管理':
_selectAction('确定注销吗?', '注销'); showCupertinoModalPopup(
context: context,
builder: (context) {
return CupertinoActionSheet(
message: Text('退出注销当前账号'),
actions: [
CupertinoButton(
child: Text(
'确定',
style: TextStyle(
color: Colors.red.withOpacity(0.7),
),
),
onPressed: () {
Navigator.popUntil(context, (route) {
return !Navigator.canPop(context);
});
Navigator.pushReplacement(
context,
CupertinoPageRoute(
builder: (context) => SignInPage(),
));
},
),
],
cancelButton: CupertinoButton(
child: Text('取消'),
onPressed: () {
Navigator.pop(context);
},
),
);
},
);
break; break;
case '用户协议和隐私政策': case '用户协议和隐私政策':
Navigator.pushNamed(context, PageName.agreement_page.toString(), Navigator.pushNamed(context, PageName.agreement_page.toString(),
@ -212,7 +256,40 @@ class _SettingPageState extends State<SettingPage> {
Widget _containerQuit() { Widget _containerQuit() {
return InkWell( return InkWell(
onTap: () { onTap: () {
_selectAction('确定退出吗?', '退出'); showCupertinoModalPopup(
context: context,
builder: (context) {
return CupertinoActionSheet(
message: Text('退出当前账号'),
actions: [
CupertinoButton(
child: Text(
'确定',
style: TextStyle(
color: Colors.red.withOpacity(0.7),
),
),
onPressed: () {
Navigator.popUntil(context, (route) {
return !Navigator.canPop(context);
});
Navigator.pushReplacement(
context,
CupertinoPageRoute(
builder: (context) => SignInPage(),
));
},
),
],
cancelButton: CupertinoButton(
child: Text('取消'),
onPressed: () {
Navigator.pop(context);
},
),
);
},
);
}, },
child: Container( child: Container(
color: Colors.white, color: Colors.white,

@ -1,10 +1,10 @@
import 'package:akuCommunity/pages/sign/user_authentication_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_icons/flutter_icons.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:akuCommunity/routers/page_routers.dart'; import 'package:flutter_screenutil/screenutil.dart';
class SignInPage extends StatefulWidget { class SignInPage extends StatefulWidget {
SignInPage({Key key}) : super(key: key); SignInPage({Key key}) : super(key: key);
@ -22,12 +22,12 @@ class _SignInPageState extends State<SignInPage> {
return AppBar( return AppBar(
elevation: 0, elevation: 0,
backgroundColor: Colors.white, backgroundColor: Colors.white,
leading: IconButton( // leading: IconButton(
icon: Icon(AntDesign.left, size: Screenutil.size(40)), // icon: Icon(AntDesign.left, size: Screenutil.size(40)),
onPressed: () { // onPressed: () {
Navigator.pop(context); // Navigator.pop(context);
}, // },
), // ),
); );
} }
@ -120,8 +120,11 @@ class _SignInPageState extends State<SignInPage> {
InkWell _inkWellLogin() { InkWell _inkWellLogin() {
return InkWell( return InkWell(
onTap: (){ onTap: () {
Navigator.pushNamed(context, PageName.user_authentication_page.toString()); Navigator.pushReplacement(
context,
CupertinoPageRoute(builder: (context) => UserAuthenticationPage()),
);
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -149,6 +152,7 @@ class _SignInPageState extends State<SignInPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double _statusHeight = MediaQuery.of(context).padding.top; double _statusHeight = MediaQuery.of(context).padding.top;
ScreenUtil.init(context, width: 750, height: 1334, allowFontScaling: true);
return Scaffold( return Scaffold(
appBar: _appBar(), appBar: _appBar(),
body: SingleChildScrollView( body: SingleChildScrollView(

@ -1,3 +1,4 @@
import 'package:akuCommunity/pages/tab_navigator.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_icons/flutter_icons.dart'; import 'package:flutter_icons/flutter_icons.dart';
@ -33,6 +34,17 @@ class _UserAuthenticationPageState extends State<UserAuthenticationPage> {
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
actions: [
MaterialButton(
child: Text('跳过'),
onPressed: () {
Navigator.pushReplacement(
context,
CupertinoPageRoute(builder: (context) => TabNavigator()),
);
},
),
],
); );
} }
@ -130,9 +142,15 @@ class _UserAuthenticationPageState extends State<UserAuthenticationPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
List<Map<String, dynamic>> _listWidget = [ List<Map<String, dynamic>> _listWidget = [
{'title': '请输入您的昵称', 'widget': _containerTextField(_userNickName, '为保护个人隐私,在与邻居交流时将显示昵称')}, {
'title': '请输入您的昵称',
'widget': _containerTextField(_userNickName, '为保护个人隐私,在与邻居交流时将显示昵称')
},
{'title': '请输入您的姓名', 'widget': _containerTextField(_userName, '请输入您的姓名')}, {'title': '请输入您的姓名', 'widget': _containerTextField(_userName, '请输入您的姓名')},
{'title': '请输入您的身份证', 'widget': _containerTextField(_userIDCard, '请输入您的身份证号')}, {
'title': '请输入您的身份证',
'widget': _containerTextField(_userIDCard, '请输入您的身份证号')
},
]; ];
List<Widget> _listView() { List<Widget> _listView() {
return _listWidget return _listWidget
@ -162,6 +180,7 @@ class _UserAuthenticationPageState extends State<UserAuthenticationPage> {
)) ))
.toList(); .toList();
} }
return Scaffold( return Scaffold(
appBar: _appBar(), appBar: _appBar(),
body: SingleChildScrollView( body: SingleChildScrollView(

@ -95,12 +95,14 @@ Widget actionItem({
bool isLastOne = false, // bool isLastOne = false, //
double height = 45, double height = 45,
double fontSize = 15, double fontSize = 15,
VoidCallback onTap,
}) { }) {
assert(context != null); assert(context != null);
assert(title != null); assert(title != null);
assert(index > 0); assert(index > 0);
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
onTap();
Navigator.pop(context, index); Navigator.pop(context, index);
}, },
child: Column( child: Column(

@ -116,7 +116,6 @@ dependencies:
flutter_pdfview: ^1.0.3+5 flutter_pdfview: ^1.0.3+5
#用户存储路径 #用户存储路径
path_provider: ^1.6.18 path_provider: ^1.6.18
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter

Loading…
Cancel
Save