import 'package:flutter/material.dart'; import 'package:flutter_tracker/model/config.dart'; import 'package:flutter_tracker/pages/login_page.dart'; import 'package:flutter_tracker/pages/register_page.dart'; import 'package:flutter_tracker/utils/app_util.dart'; 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 Stack( children: [ Container( child: Image.asset( "assets/images/home.jpg", fit: BoxFit.cover, width: double.infinity, height: double.infinity, ), ), Positioned( bottom: 80, 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: LinearGradient(colors: [ ThemeColor.loignColor, ThemeColor.loignColor ]), borderRadius: BorderRadius.circular(10), boxShadow: [ BoxShadow( offset: Offset(1.0, 5.0), color: ThemeColor.loignColor, blurRadius: 5.0, ) ]), child: Center( child: Text( "登录", style: TextStyle(fontSize: 20, color: Colors.white), ), ), ), ), ), Container( width: 150, 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: LinearGradient(colors: [ ThemeColor.loignColor, ThemeColor.loignColor ]), borderRadius: BorderRadius.circular(10), boxShadow: [ BoxShadow( offset: Offset(1.0, 5.0), color: ThemeColor.loignColor, blurRadius: 5.0, ) ]), child: Center( child: Text( "注册", style: TextStyle(fontSize: 20, color: Colors.white), ), ), ), ), ), ], ), ), ) ], ); } }