feat(login): 更新登录页布局和跳转
This commit is contained in:
51
lib/login.dart
Normal file
51
lib/login.dart
Normal 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),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -192,11 +192,11 @@ class BistroFrameState extends State<BistroFrame> {
|
||||
_index = index;
|
||||
});
|
||||
|
||||
loginRequired.forEach((index) {
|
||||
for (var index in loginRequired) {
|
||||
if (_index == index) {
|
||||
Navigator.of(context).pushNamed(RouterTable.loginPath);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@@ -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('登录'),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user