import 'package:flutter/material.dart'; import 'package:flutter_tracker/model/config.dart'; import 'package:flutter_tracker/pages/login/login_page.dart'; import 'package:flutter_tracker/pages/login/register_page.dart'; import 'package:flutter_tracker/utils/app_util.dart'; /// Description: /// Time : 2021年12月03日 Friday /// Author : liuyuqi.gov@msncn class WelComePage extends StatefulWidget { const WelComePage({Key? key}) : super(key: key); @override _WelComePageState createState() => _WelComePageState(); } class _WelComePageState extends State { @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ Container( child: Image.asset( "assets/images/home.jpg", fit: BoxFit.cover, width: double.infinity, height: double.infinity, ), ), Positioned( bottom: 100, child: Container( width: MediaQuery.of(context).size.width, alignment: Alignment.center, child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Container( width: 150, child: InkWell( onTap: () { // 登录 Navigator.of(context).push(MaterialPageRoute( builder: (context) => LoginPage())); }, child: Container( width: double.infinity, height: AppUtil.height(100), padding: EdgeInsets.only( right: AppUtil.width(20), left: AppUtil.width(20)), decoration: BoxDecoration( gradient: const LinearGradient(colors: [ ThemeColor.loignColor, ThemeColor.loignColor ]), borderRadius: BorderRadius.circular(10), boxShadow: const [ BoxShadow( offset: Offset(1.0, 5.0), color: ThemeColor.loignColor, blurRadius: 5.0, ) ]), child: const Center( child: Text( "登录", style: TextStyle(fontSize: 20, color: Colors.white), ), ), ), ), ), Container( width: 200, child: InkWell( onTap: () { //注册 Navigator.of(context).push(MaterialPageRoute( builder: (context) => RegisterPage())); }, child: Container( margin: EdgeInsets.only(left: 20.0), width: double.infinity, height: AppUtil.height(100), padding: EdgeInsets.only( right: AppUtil.width(20), left: AppUtil.width(20)), decoration: BoxDecoration( gradient: const LinearGradient(colors: [ ThemeColor.loignColor, ThemeColor.loignColor ]), borderRadius: BorderRadius.circular(10), boxShadow: const [ BoxShadow( offset: Offset(1.0, 5.0), color: ThemeColor.loignColor, blurRadius: 5.0, ) ]), child: const Center( child: Text( "新用户注册", style: TextStyle(fontSize: 20, color: Colors.white), ), ), ), ), ), ], ), ), ) ], ), ); } }