添加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/cupertino.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:provider/provider.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:pull_to_refresh/pull_to_refresh.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
@ -43,7 +43,8 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.yellow,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: TabNavigator(),
// home: TabNavigator(),
home: SignInPage(),
//
localizationsDelegates: [
PickerLocalizationsDelegate.delegate,

@ -1,3 +1,4 @@
import 'package:akuCommunity/routers/page_routers.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.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)),
InkWell(

@ -1,5 +1,6 @@
import 'dart:async';
import 'dart:io';
import 'package:akuCommunity/pages/sign/sign_in_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_icons/flutter_icons.dart';
@ -130,9 +131,19 @@ class _SettingPageState extends State<SettingPage> {
/// 使
Future<int> showPayActionSheets(
{@required BuildContext context, String title, String subtitle}) {
return showCustomBottomSheet(context: context, title: title, children: [
actionItem(context: context, index: 1, title: subtitle, isLastOne: true),
]);
return showCustomBottomSheet(
context: context,
title: title,
children: [
actionItem(
context: context,
index: 1,
title: subtitle,
isLastOne: true,
onTap: () {},
),
],
);
}
Widget _inkWellListTile(String title, bool isSwitch) {
@ -152,7 +163,40 @@ class _SettingPageState extends State<SettingPage> {
_showDialog('是否清除缓存?');
break;
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;
case '用户协议和隐私政策':
Navigator.pushNamed(context, PageName.agreement_page.toString(),
@ -212,7 +256,40 @@ class _SettingPageState extends State<SettingPage> {
Widget _containerQuit() {
return InkWell(
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(
color: Colors.white,

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

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

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

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

Loading…
Cancel
Save