login.dart 4.9 KB

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