login.dart 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. Container(),
  43. Padding(
  44. padding: const EdgeInsets.all(8.0),
  45. child: ElevatedButton(
  46. onPressed: () => context.go('/list'), child: Text('Masuk')),
  47. )
  48. ],
  49. )),
  50. Text('Kebijakan Privasi'),
  51. Text('Versi 4.0.0.0'),
  52. Container(
  53. color: Theme.of(context).colorScheme.primaryContainer,
  54. )
  55. ],
  56. ),
  57. );
  58. }
  59. }
  60. class Lang extends StatefulWidget {
  61. const Lang({
  62. Key? key,
  63. }) : super(key: key);
  64. @override
  65. State<Lang> createState() => _LangState();
  66. }
  67. class _LangState extends State<Lang> {
  68. var selectedIndex = 0;
  69. @override
  70. Widget build(BuildContext context) {
  71. return Padding(
  72. padding: const EdgeInsets.all(8.0),
  73. child: Row(
  74. children: [
  75. Expanded(child: Container()),
  76. ElevatedButton(
  77. onPressed: () {
  78. print('EN');
  79. },
  80. style: ButtonStyle(
  81. foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
  82. backgroundColor:
  83. MaterialStateProperty.all<Color>(Colors.white70),
  84. shape: MaterialStateProperty.all<RoundedRectangleBorder>(
  85. RoundedRectangleBorder(
  86. borderRadius: BorderRadius.only(
  87. topLeft: Radius.circular(20),
  88. bottomLeft: Radius.circular(20)),
  89. //side: BorderSide(color: Colors.red),
  90. ))),
  91. child: Text('EN'),
  92. ),
  93. ElevatedButton(
  94. onPressed: () {
  95. print('ID');
  96. },
  97. style: ButtonStyle(
  98. foregroundColor:
  99. MaterialStateProperty.all<Color>(Colors.white),
  100. backgroundColor: MaterialStateProperty.all<Color>(Colors.red),
  101. shape: MaterialStateProperty.all<RoundedRectangleBorder>(
  102. RoundedRectangleBorder(
  103. borderRadius: BorderRadius.only(
  104. topRight: Radius.circular(20),
  105. bottomRight: Radius.circular(20)),
  106. side: BorderSide(color: Colors.red),
  107. ))),
  108. child: Text('ID'))
  109. ],
  110. ),
  111. );
  112. }
  113. }