123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- import 'package:flutter/material.dart';
- import 'package:flutter/services.dart';
- import 'package:flutter_green/routes/routes.dart';
- /// 欢迎页面:登录、注册,忘记密码
- class WelcomePage extends StatefulWidget {
- @override
- _WelcomePageState createState() => _WelcomePageState();
- }
- class _WelcomePageState extends State<WelcomePage> {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: AnnotatedRegion<SystemUiOverlayStyle>(
- value: SystemUiOverlayStyle.light,
- child: Container(
- width: double.infinity,
- height: double.infinity,
- decoration: BoxDecoration(
- image: DecorationImage(
- fit: BoxFit.fill,
- image: AssetImage("assets/images/background.jpg"),
- ),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Expanded(
- flex: 3,
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- Container(
- width: 65,
- height: 65,
- margin: EdgeInsets.only(
- left: 30,
- ),
- padding: EdgeInsets.all(10),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(10),
- ),
- child: Image(
- image: AssetImage("assets/images/leaf.jpg"),
- ),
- ),
- ],
- ),
- ),
- Expanded(
- flex: 6,
- child: Container(
- padding: EdgeInsets.symmetric(horizontal: 28),
- child: Text(
- "Everyone should live with a little more green",
- overflow: TextOverflow.fade,
- style: TextStyle(
- color: Colors.white,
- fontSize: 41,
- fontWeight: FontWeight.bold),
- ),
- ),
- ),
- Expanded(
- flex: 3,
- child: Container(
- padding: EdgeInsets.symmetric(horizontal: 29),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- Expanded(
- flex: 4,
- child: GestureDetector(
- onTap: nextScreen,
- child: Container(
- decoration: BoxDecoration(
- color: Color(0xFf142e32).withOpacity(0.93),
- borderRadius: BorderRadius.circular(20)),
- width: double.infinity,
- child: Center(
- child: Text(
- "Sign up",
- style: TextStyle(
- color: Colors.white,
- fontSize: 30,
- fontWeight: FontWeight.bold),
- ),
- ),
- ),
- ),
- ),
- Expanded(
- flex: 2,
- child: Container(),
- ),
- Expanded(
- flex: 4,
- child: GestureDetector(
- onTap: () {
- Navigator.of(context).pushNamed(Routes.loginPage);
- },
- child: Container(
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(20)),
- width: double.infinity,
- child: Center(
- child: Text(
- "Sign in",
- style: TextStyle(
- color: Color(0xFF265e59),
- fontSize: 30,
- fontWeight: FontWeight.bold),
- ),
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- ),
- Expanded(
- flex: 2,
- child: Center(
- child: GestureDetector(
- onTap: nextScreen,
- child: Text(
- "Forgot password?",
- style: TextStyle(
- color: Colors.white,
- fontSize: 22,
- decoration: TextDecoration.underline),
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- ),
- );
- }
- nextScreen() {
- Navigator.of(context).pushNamed(Routes.homePage);
- }
- }
|