login.dart 4.5 KB

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