welcome_page.dart 4.4 KB

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