feat(login): 更新登录页布局和跳转

This commit is contained in:
李东云
2023-03-29 15:58:59 +08:00
parent 6738f0bfde
commit 49620390db
3 changed files with 53 additions and 36 deletions

51
lib/login.dart Normal file
View File

@@ -0,0 +1,51 @@
import 'package:flutter/material.dart';
///
/// 登录页
///
class Login extends StatefulWidget {
final Function? successCallback;
const Login({
Key? key,
this.successCallback,
}) : super(key: key);
@override
LoginState createState() => LoginState();
}
class LoginState extends State<Login> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
// title: Text(''),
backgroundColor: Theme.of(context).colorScheme.background,
centerTitle: false,
),
body: SafeArea(
child: Column(
children: const [
Text(
'和数以千计的同好一起,',
style: TextStyle(
fontSize: 24,
),
),
Text(
'创造,改变',
style: TextStyle(
fontSize: 28,
),
),
Text(
'广阔九州,大有可为!',
style: TextStyle(fontSize: 22),
)
],
),
),
);
}
}

View File

@@ -192,11 +192,11 @@ class BistroFrameState extends State<BistroFrame> {
_index = index; _index = index;
}); });
loginRequired.forEach((index) { for (var index in loginRequired) {
if (_index == index) { if (_index == index) {
Navigator.of(context).pushNamed(RouterTable.loginPath); Navigator.of(context).pushNamed(RouterTable.loginPath);
} }
}); }
}, },
), ),
); );

View File

@@ -1,34 +0,0 @@
import 'package:flutter/material.dart';
///
/// 登录页
///
class Login extends StatefulWidget {
final Function successCallback;
const Login({
required Key key,
required this.successCallback,
}) : super(key: key);
@override
LoginState createState() => LoginState();
}
class LoginState extends State<Login> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text(
'登录',
style: TextStyle(
fontSize: 30,
),
),
centerTitle: true,
),
body: const Text('登录'),
);
}
}