welcome_page.dart 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. /// 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. _WelComePageState 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. Container(
  21. child: Image.asset(
  22. "assets/images/home.jpg",
  23. fit: BoxFit.cover,
  24. width: double.infinity,
  25. height: double.infinity,
  26. ),
  27. ),
  28. Positioned(
  29. bottom: 100,
  30. child: Container(
  31. width: MediaQuery.of(context).size.width,
  32. alignment: Alignment.center,
  33. child: Row(
  34. mainAxisAlignment: MainAxisAlignment.center,
  35. children: [
  36. Container(
  37. width: 150,
  38. child: InkWell(
  39. onTap: () {
  40. // 登录
  41. Navigator.of(context).push(MaterialPageRoute(
  42. builder: (context) => LoginPage()));
  43. },
  44. child: Container(
  45. width: double.infinity,
  46. height: AppUtil.height(100),
  47. padding: EdgeInsets.only(
  48. right: AppUtil.width(20), left: AppUtil.width(20)),
  49. decoration: BoxDecoration(
  50. gradient: const LinearGradient(colors: [
  51. ThemeColor.loignColor,
  52. ThemeColor.loignColor
  53. ]),
  54. borderRadius: BorderRadius.circular(10),
  55. boxShadow: const [
  56. BoxShadow(
  57. offset: Offset(1.0, 5.0),
  58. color: ThemeColor.loignColor,
  59. blurRadius: 5.0,
  60. )
  61. ]),
  62. child: const Center(
  63. child: Text(
  64. "登录",
  65. style: TextStyle(fontSize: 20, color: Colors.white),
  66. ),
  67. ),
  68. ),
  69. ),
  70. ),
  71. Container(
  72. width: 200,
  73. child: InkWell(
  74. onTap: () {
  75. //注册
  76. Navigator.of(context).push(MaterialPageRoute(
  77. builder: (context) => RegisterPage()));
  78. },
  79. child: Container(
  80. margin: EdgeInsets.only(left: 20.0),
  81. width: double.infinity,
  82. height: AppUtil.height(100),
  83. padding: EdgeInsets.only(
  84. right: AppUtil.width(20), left: AppUtil.width(20)),
  85. decoration: BoxDecoration(
  86. gradient: const LinearGradient(colors: [
  87. ThemeColor.loignColor,
  88. ThemeColor.loignColor
  89. ]),
  90. borderRadius: BorderRadius.circular(10),
  91. boxShadow: const [
  92. BoxShadow(
  93. offset: Offset(1.0, 5.0),
  94. color: ThemeColor.loignColor,
  95. blurRadius: 5.0,
  96. )
  97. ]),
  98. child: const Center(
  99. child: Text(
  100. "新用户注册",
  101. style: TextStyle(fontSize: 20, color: Colors.white),
  102. ),
  103. ),
  104. ),
  105. ),
  106. ),
  107. ],
  108. ),
  109. ),
  110. )
  111. ],
  112. ),
  113. );
  114. }
  115. }