login.dart 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. import 'package:flutter/material.dart';
  2. import 'package:go_router/go_router.dart';
  3. import 'package:namer_app/lang.dart';
  4. class LoginPage extends StatelessWidget {
  5. const LoginPage({Key? key}) : super(key: key);
  6. @override
  7. Widget build(BuildContext context) {
  8. return Scaffold(
  9. backgroundColor: Theme.of(context).colorScheme.primaryContainer,
  10. body: Container(
  11. decoration: BoxDecoration(
  12. image: DecorationImage(
  13. image: AssetImage("assets/images/building.jpg"),
  14. fit: BoxFit.cover,
  15. )),
  16. child: Column(
  17. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  18. children: [
  19. // BackButton(),
  20. Lang(),
  21. Expanded(
  22. child: Center(
  23. child: Text(
  24. 'telnow',
  25. style: TextStyle(color: Colors.orange, fontSize: 48),
  26. )),
  27. ),
  28. Expanded(
  29. child: Column(
  30. children: [
  31. Padding(
  32. padding: const EdgeInsets.all(8.0),
  33. child: TextField(
  34. decoration: InputDecoration(
  35. border: OutlineInputBorder(),
  36. labelText: 'Nama Pengguna',
  37. ),
  38. ),
  39. ),
  40. Padding(
  41. padding: const EdgeInsets.all(8.0),
  42. child: TextField(
  43. obscureText: true,
  44. decoration: InputDecoration(
  45. border: OutlineInputBorder(),
  46. labelText: 'Kata Sandi',
  47. ),
  48. ),
  49. ),
  50. Padding(
  51. padding: const EdgeInsets.all(8.0),
  52. child: ElevatedButton(
  53. onPressed: () => context.go('/list'),
  54. style: ButtonStyle(
  55. padding: MaterialStateProperty.all<EdgeInsets>(
  56. EdgeInsets.only(
  57. left: 260, right: 260, bottom: 25, top: 25)),
  58. backgroundColor: MaterialStateProperty.all(
  59. Color.fromARGB(0, 7, 140, 132)),
  60. foregroundColor:
  61. MaterialStateProperty.all<Color>(Colors.black),
  62. shape:
  63. MaterialStateProperty.all<RoundedRectangleBorder>(
  64. RoundedRectangleBorder(
  65. borderRadius: BorderRadius.circular(10),
  66. ))),
  67. child: Text(
  68. 'Masuk',
  69. style: TextStyle(color: Colors.white),
  70. ),
  71. ),
  72. ),
  73. Text(
  74. 'Frisian Flag Indonesia, Tbk.',
  75. style: TextStyle(color: Colors.white),
  76. ),
  77. ],
  78. )),
  79. Column(
  80. children: [
  81. Text('Kebijakan Privasi',
  82. style: TextStyle(
  83. fontSize: 16,
  84. decoration: TextDecoration.underline,
  85. fontWeight: FontWeight.w800,
  86. color: Colors.white)),
  87. Text('Versi 4.0.0.0',
  88. style: TextStyle(
  89. fontSize: 16,
  90. fontWeight: FontWeight.w800,
  91. color: Colors.white,
  92. ))
  93. ],
  94. ),
  95. Container(
  96. color: Theme.of(context).colorScheme.primaryContainer,
  97. )
  98. ],
  99. ),
  100. ),
  101. );
  102. }
  103. }
  104. // class Lang extends StatefulWidget {
  105. // const Lang({
  106. // Key? key,
  107. // }) : super(key: key);
  108. // @override
  109. // State<Lang> createState() => _LangState();
  110. // }
  111. // class _LangState extends State<Lang> {
  112. // var selectedIndex = 0;
  113. // @override
  114. // Widget build(BuildContext context) {
  115. // return Padding(
  116. // padding: const EdgeInsets.all(8.0),
  117. // child: Row(
  118. // children: [
  119. // BackButton(),
  120. // Padding(
  121. // padding: const EdgeInsets.only(right: 0),
  122. // child: Text(
  123. // 'Kembali Pindai QR',
  124. // softWrap: true,
  125. // textAlign: TextAlign.left,
  126. // ),
  127. // ),
  128. // Expanded(child: Container()),
  129. // ElevatedButton(
  130. // onPressed: () {
  131. // print('EN');
  132. // },
  133. // style: ButtonStyle(
  134. // foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
  135. // backgroundColor:
  136. // MaterialStateProperty.all<Color>(Colors.white70),
  137. // shape: MaterialStateProperty.all<RoundedRectangleBorder>(
  138. // RoundedRectangleBorder(
  139. // borderRadius: BorderRadius.only(
  140. // topLeft: Radius.circular(20),
  141. // bottomLeft: Radius.circular(20)),
  142. // ))),
  143. // child: Text('EN'),
  144. // ),
  145. // ElevatedButton(
  146. // onPressed: () {
  147. // print('ID');
  148. // },
  149. // style: ButtonStyle(
  150. // foregroundColor:
  151. // MaterialStateProperty.all<Color>(Colors.white),
  152. // backgroundColor: MaterialStateProperty.all<Color>(Colors.red),
  153. // shape: MaterialStateProperty.all<RoundedRectangleBorder>(
  154. // RoundedRectangleBorder(
  155. // borderRadius: BorderRadius.only(
  156. // topRight: Radius.circular(20),
  157. // bottomRight: Radius.circular(20)),
  158. // side: BorderSide(color: Colors.red),
  159. // ))),
  160. // child: Text('ID'))
  161. // ],
  162. // ),
  163. // );
  164. // }
  165. // }