main.dart 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. import 'package:flutter/material.dart';
  2. import 'package:go_router/go_router.dart';
  3. void main() {
  4. runApp(MyApp());
  5. }
  6. class MyApp extends StatelessWidget {
  7. const MyApp({super.key});
  8. @override
  9. Widget build(BuildContext context) {
  10. return MaterialApp(
  11. title: 'TelNow Lat',
  12. theme: ThemeData(
  13. useMaterial3: true,
  14. colorScheme: ColorScheme.fromSeed(seedColor: Color.fromARGB(255, 0, 255, 255)),
  15. ),
  16. home: MyHomePage(),
  17. );
  18. }
  19. }
  20. class MyHomePage extends StatelessWidget {
  21. @override
  22. Widget build(BuildContext context) {
  23. return Scaffold(
  24. backgroundColor: Theme.of(context).colorScheme.primaryContainer,
  25. body: Column(
  26. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  27. children: [
  28. Lang(),
  29. //Expanded(child: Column(
  30. // mainAxisAlignment: MainAxisAlignment.center,
  31. // children: [
  32. // Judul(),
  33. // ],
  34. //),),
  35. Expanded(child: Center(child: Text('TelNow'))),
  36. Padding(
  37. padding: const EdgeInsets.only(left: 100, right: 100),
  38. child: Text('Silakan pindai QR terlebih dulu untuk mulai menggunakan aplikasi.',
  39. softWrap: true,),
  40. ),
  41. Expanded(child:
  42. // child: Column(
  43. // mainAxisAlignment: MainAxisAlignment.center,
  44. // children: [
  45. Center(child: Pindai()),
  46. // ],
  47. // ),
  48. ),
  49. Text('Kebijakan Privasi'),
  50. Text('Versi 4.0.0.0'),
  51. Container(
  52. color: Theme.of(context).colorScheme.primaryContainer,
  53. )
  54. ],
  55. ),
  56. );
  57. }
  58. }
  59. class Lang extends StatefulWidget {
  60. const Lang({
  61. Key? key,
  62. }) : super(key: key);
  63. @override
  64. State<Lang> createState() => _LangState();
  65. }
  66. class _LangState extends State<Lang> {
  67. var selectedIndex = 0;
  68. @override
  69. Widget build(BuildContext context) {
  70. return Padding(
  71. padding: const EdgeInsets.all(8.0),
  72. child: Row(
  73. children: [
  74. Expanded(child: Container()),
  75. ElevatedButton
  76. (onPressed: (){print('EN');},
  77. child: Text('EN'),),
  78. ElevatedButton
  79. (onPressed: (){print('ID');},
  80. child: Text('ID'))
  81. ],
  82. ),
  83. );
  84. }
  85. }
  86. class Judul extends StatelessWidget {
  87. const Judul({
  88. Key? key,
  89. }) : super(key: key);
  90. @override
  91. Widget build(BuildContext context) {
  92. var theme = Theme.of(context);
  93. var style = theme.textTheme.displayMedium!.copyWith(
  94. color: Colors.orange,
  95. );
  96. return Column(
  97. children: [
  98. Text('TelNow', style: style),
  99. ],
  100. );
  101. }
  102. }
  103. class Pindai extends StatelessWidget {
  104. const Pindai({
  105. Key? key,
  106. }) : super(key: key);
  107. @override
  108. Widget build(BuildContext context) {
  109. return Card(
  110. child: Padding(
  111. padding: const EdgeInsets.all(20),
  112. child: TextButton(
  113. onPressed: () {
  114. print('QR pressed!');
  115. },
  116. child: Text('Pindai QR'),
  117. ),
  118. ),
  119. );
  120. }
  121. }
  122. class Footer extends StatelessWidget {
  123. const Footer({
  124. Key? key,
  125. }) : super(key: key);
  126. @override
  127. Widget build(BuildContext context) {
  128. return Column(
  129. children: [
  130. Text('Kebijakan Privasi'),
  131. Text('Versi 4.0.0.0'),
  132. ],
  133. );
  134. }
  135. }