welcome_page.dart 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_tracker/model/config.dart';
  3. import 'package:flutter_tracker/pages/login_page.dart';
  4. import 'package:flutter_tracker/pages/register_page.dart';
  5. import 'package:flutter_tracker/utils/app_util.dart';
  6. class WelComePage extends StatefulWidget {
  7. const WelComePage({Key key}) : super(key: key);
  8. @override
  9. _WelComePageState createState() => _WelComePageState();
  10. }
  11. class _WelComePageState extends State<WelComePage> {
  12. @override
  13. Widget build(BuildContext context) {
  14. return Scaffold(
  15. body: Stack(
  16. children: [
  17. Container(
  18. child: Image.asset(
  19. "assets/images/home.jpg",
  20. fit: BoxFit.cover,
  21. width: double.infinity,
  22. height: double.infinity,
  23. ),
  24. ),
  25. Positioned(
  26. bottom: 100,
  27. child: Container(
  28. width: MediaQuery.of(context).size.width,
  29. alignment: Alignment.center,
  30. child: Row(
  31. mainAxisAlignment: MainAxisAlignment.center,
  32. children: [
  33. Container(
  34. width: 150,
  35. child: InkWell(
  36. onTap: () {
  37. // 登录
  38. Navigator.of(context).push(MaterialPageRoute(
  39. builder: (context) => LoginPage()));
  40. },
  41. child: Container(
  42. width: double.infinity,
  43. height: AppUtil.height(100),
  44. padding: EdgeInsets.only(
  45. right: AppUtil.width(20), left: AppUtil.width(20)),
  46. decoration: BoxDecoration(
  47. gradient: const LinearGradient(colors: [
  48. ThemeColor.loignColor,
  49. ThemeColor.loignColor
  50. ]),
  51. borderRadius: BorderRadius.circular(10),
  52. boxShadow: const [
  53. BoxShadow(
  54. offset: Offset(1.0, 5.0),
  55. color: ThemeColor.loignColor,
  56. blurRadius: 5.0,
  57. )
  58. ]),
  59. child: const Center(
  60. child: Text(
  61. "登录",
  62. style: TextStyle(fontSize: 20, color: Colors.white),
  63. ),
  64. ),
  65. ),
  66. ),
  67. ),
  68. Container(
  69. width: 200,
  70. child: InkWell(
  71. onTap: () {
  72. //注册
  73. Navigator.of(context).push(MaterialPageRoute(
  74. builder: (context) => RegisterPage()));
  75. },
  76. child: Container(
  77. margin: EdgeInsets.only(left: 20.0),
  78. width: double.infinity,
  79. height: AppUtil.height(100),
  80. padding: EdgeInsets.only(
  81. right: AppUtil.width(20), left: AppUtil.width(20)),
  82. decoration: BoxDecoration(
  83. gradient: const LinearGradient(colors: [
  84. ThemeColor.loignColor,
  85. ThemeColor.loignColor
  86. ]),
  87. borderRadius: BorderRadius.circular(10),
  88. boxShadow: const [
  89. BoxShadow(
  90. offset: Offset(1.0, 5.0),
  91. color: ThemeColor.loignColor,
  92. blurRadius: 5.0,
  93. )
  94. ]),
  95. child: const Center(
  96. child: Text(
  97. "新用户注册",
  98. style: TextStyle(fontSize: 20, color: Colors.white),
  99. ),
  100. ),
  101. ),
  102. ),
  103. ),
  104. ],
  105. ),
  106. ),
  107. )
  108. ],
  109. ),
  110. );
  111. }
  112. }