No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

login_screen.dart 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. import 'package:flutter/material.dart';
  2. import 'package:google_fonts/google_fonts.dart';
  3. import 'package:hris_selfservice_mobile/Screens/ForgotPassword/forgotPassword_screen.dart';
  4. import 'package:hris_selfservice_mobile/Screens/Login/background.dart';
  5. import 'package:hris_selfservice_mobile/Screens/Home/home_screen.dart';
  6. import 'inputWidget.dart';
  7. class LoginView extends StatefulWidget {
  8. @override
  9. _LoginView createState() => _LoginView();
  10. }
  11. class _LoginView extends State<LoginView> {
  12. @override
  13. Widget build(BuildContext context) {
  14. return Scaffold(
  15. resizeToAvoidBottomInset: false,
  16. backgroundColor: Colors.white,
  17. body: Stack(
  18. children: <Widget>[
  19. Background(),
  20. LoginScreen(),
  21. ],
  22. ));
  23. }
  24. }
  25. class LoginScreen extends StatelessWidget {
  26. const LoginScreen({Key? key}) : super(key: key);
  27. @override
  28. Widget build(BuildContext context) {
  29. return Column(
  30. children: <Widget>[
  31. Padding(
  32. padding:
  33. EdgeInsets.only(top: MediaQuery.of(context).size.height / 2.45),
  34. ),
  35. Column(
  36. children: <Widget>[
  37. Column(
  38. crossAxisAlignment: CrossAxisAlignment.center,
  39. children: <Widget>[
  40. Padding(
  41. padding: EdgeInsets.only(top: 0),
  42. child: Text(
  43. "Login",
  44. style: GoogleFonts.knewave(
  45. color: Colors.blueAccent, fontSize: 25),
  46. ),
  47. ),
  48. ],
  49. ),
  50. Column(
  51. crossAxisAlignment: CrossAxisAlignment.start,
  52. children: <Widget>[
  53. Padding(
  54. padding: EdgeInsets.only(left: 40, bottom: 5, top: 20),
  55. child: Text(
  56. "Email",
  57. style: TextStyle(fontSize: 16, color: Colors.black87),
  58. ),
  59. ),
  60. Stack(
  61. alignment: Alignment.bottomRight,
  62. children: <Widget>[
  63. InputWidgetEmail(20.0, 20.0),
  64. Padding(
  65. padding: EdgeInsets.only(right: 50),
  66. ),
  67. ],
  68. ),
  69. ],
  70. ),
  71. Column(
  72. crossAxisAlignment: CrossAxisAlignment.start,
  73. children: <Widget>[
  74. Padding(
  75. padding: EdgeInsets.only(left: 40, bottom: 5),
  76. child: Text(
  77. "Password",
  78. style: TextStyle(fontSize: 16, color: Colors.black87),
  79. ),
  80. ),
  81. Stack(
  82. alignment: Alignment.bottomRight,
  83. children: <Widget>[
  84. InputWidgetPassword(20.0, 20.0),
  85. Padding(
  86. padding: EdgeInsets.only(right: 15),
  87. child: Row(
  88. children: <Widget>[
  89. Expanded(
  90. child: Padding(
  91. padding: EdgeInsets.only(top: 0),
  92. )),
  93. InkWell(
  94. child: Container(
  95. padding: EdgeInsets.all(10),
  96. decoration: ShapeDecoration(
  97. shape: CircleBorder(),
  98. gradient: LinearGradient(
  99. colors: Gradients2,
  100. begin: Alignment.topLeft,
  101. end: Alignment.bottomRight),
  102. ),
  103. child: ImageIcon(
  104. AssetImage("assets/images/ic_forward.png"),
  105. size: 40,
  106. color: Colors.white,
  107. ),
  108. ),
  109. onTap: () {
  110. Navigator.push(context, MaterialPageRoute(builder: (context) => HomeView()));
  111. },
  112. )
  113. ],
  114. ),
  115. ),
  116. ],
  117. ),
  118. ],
  119. ),
  120. Padding(
  121. padding: EdgeInsets.only(bottom: 10),
  122. ),
  123. InkWell(
  124. child: roundedRectButton("Forgot Password?", Gradients1, false),
  125. onTap: () {
  126. Navigator.push(context, MaterialPageRoute(builder: (context) => ForgotPasswordView()));
  127. })
  128. ],
  129. )
  130. ],
  131. );
  132. }
  133. }
  134. Widget roundedRectButton(
  135. String title, List<Color> gradient, bool isEndIconVisible) {
  136. return Builder(builder: (BuildContext mContext) {
  137. return Align(
  138. alignment: Alignment.centerLeft,
  139. child: Stack(
  140. children: <Widget>[
  141. Container(
  142. alignment: Alignment.centerRight,
  143. width: MediaQuery.of(mContext).size.width / 2.45,
  144. decoration: ShapeDecoration(
  145. shape: RoundedRectangleBorder(
  146. borderRadius: BorderRadius.only(
  147. topRight: Radius.circular(20.0),
  148. bottomRight: Radius.circular(20.0))),
  149. gradient: LinearGradient(
  150. colors: gradient,
  151. begin: Alignment.topLeft,
  152. end: Alignment.bottomRight),
  153. ),
  154. child: Text(title,
  155. style: TextStyle(
  156. color: Colors.white,
  157. fontSize: 15,
  158. fontWeight: FontWeight.w500)),
  159. padding: EdgeInsets.all(10),
  160. ),
  161. Visibility(
  162. visible: isEndIconVisible,
  163. child: Padding(
  164. padding: EdgeInsets.only(right: 10),
  165. child: ImageIcon(
  166. AssetImage("assets/images/ic_forward.png"),
  167. size: 30,
  168. color: Colors.white,
  169. )),
  170. ),
  171. ],
  172. ),
  173. );
  174. });
  175. }
  176. const List<Color> Gradients1 = [
  177. Color(0xFF0EDED2),
  178. Color(0xFF03A0FE),
  179. ];
  180. const List<Color> Gradients2 = [
  181. Color(0xFFFF9945),
  182. Color(0xFFFc6076),
  183. ];