更新路由

hmxc
小赖 4 years ago
parent d07da527cc
commit 80ca5b741e

@ -1,17 +1,19 @@
import 'dart:io';
import 'package:akuCommunity/pages/sign/sign_in_page.dart'; import 'package:akuCommunity/pages/sign/sign_in_page.dart';
import 'package:ani_route/ani_route.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: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:oktoast/oktoast.dart';
import 'package:akuCommunity/pages/tab_navigator.dart';
import 'package:akuCommunity/routers/router_init.dart'; import 'package:akuCommunity/routers/router_init.dart';
void main() { void main() {
ARoute.init(true);
runApp(MyApp()); runApp(MyApp());
} }

@ -3,6 +3,7 @@ import 'dart:io';
import 'package:akuCommunity/pages/sign/user_authentication_page.dart'; import 'package:akuCommunity/pages/sign/user_authentication_page.dart';
import 'package:akuCommunity/routers/page_routers.dart'; import 'package:akuCommunity/routers/page_routers.dart';
import 'package:ani_route/ani_route.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';
@ -129,10 +130,7 @@ class _SignInPageState extends State<SignInPage> {
InkWell _inkWellLogin() { InkWell _inkWellLogin() {
return InkWell( return InkWell(
onTap: () { onTap: () {
Navigator.pushReplacement( ARoute.push(context, UserAuthenticationPage());
context,
CupertinoPageRoute(builder: (context) => UserAuthenticationPage()),
);
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -190,7 +188,7 @@ class _SignInPageState extends State<SignInPage> {
double _statusHeight = MediaQuery.of(context).padding.top; double _statusHeight = MediaQuery.of(context).padding.top;
ScreenUtil.init(context, width: 750, height: 1334, allowFontScaling: true); ScreenUtil.init(context, width: 750, height: 1334, allowFontScaling: true);
return Scaffold( return Scaffold(
backgroundColor: Colors.white, backgroundColor: Colors.white,
appBar: _appBar(), appBar: _appBar(),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(

@ -1,13 +1,14 @@
import 'package:akuCommunity/pages/tab_navigator.dart'; import 'package:akuCommunity/pages/tab_navigator.dart';
import 'package:ani_route/ani_route.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';
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';
class UserAuthenticationPage extends StatefulWidget { class UserAuthenticationPage extends StatefulWidget {
UserAuthenticationPage({Key key}) : super(key: key); final BuildContext context;
UserAuthenticationPage({Key key, this.context}) : super(key: key);
@override @override
_UserAuthenticationPageState createState() => _UserAuthenticationPageState(); _UserAuthenticationPageState createState() => _UserAuthenticationPageState();
@ -38,10 +39,8 @@ class _UserAuthenticationPageState extends State<UserAuthenticationPage> {
MaterialButton( MaterialButton(
child: Text('跳过'), child: Text('跳过'),
onPressed: () { onPressed: () {
Navigator.pushReplacement( ARoute.pop(context);
context, ARoute.pushReplace(context, TabNavigator());
CupertinoPageRoute(builder: (context) => TabNavigator()),
);
}, },
), ),
], ],

@ -21,7 +21,7 @@ packages:
name: ani_route name: ani_route
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.0.1" version: "0.0.2"
animate_do: animate_do:
dependency: "direct main" dependency: "direct main"
description: description:

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

Loading…
Cancel
Save