main.dart 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. import 'package:english_words/english_words.dart';
  2. import 'package:flutter/material.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. Text('Silakan pindai QR terlebih dulu untuk mulai menggunakan aplikasi.', softWrap: true,),
  36. Expanded(
  37. child: Column(
  38. mainAxisAlignment: MainAxisAlignment.center,
  39. children: [
  40. Pindai(),
  41. ],
  42. ),
  43. ),
  44. Footer(),
  45. Container(
  46. color: Theme.of(context).colorScheme.primaryContainer,
  47. )
  48. ],
  49. ),
  50. );
  51. }
  52. }
  53. class Lang extends StatefulWidget {
  54. const Lang({
  55. Key? key,
  56. }) : super(key: key);
  57. @override
  58. State<Lang> createState() => _LangState();
  59. }
  60. class _LangState extends State<Lang> {
  61. var selectedIndex = 0;
  62. @override
  63. Widget build(BuildContext context) {
  64. return Padding(
  65. padding: const EdgeInsets.all(8.0),
  66. child: Row(
  67. children: [
  68. Expanded(child: SizedBox(width: 1,)),
  69. ElevatedButton(onPressed: (){print('EN');}, child: Text('EN')),
  70. ElevatedButton(onPressed: (){print('ID');}, child: Text('ID'))
  71. ],
  72. ),
  73. );
  74. }
  75. }
  76. class Judul extends StatelessWidget {
  77. const Judul({
  78. Key? key,
  79. }) : super(key: key);
  80. @override
  81. Widget build(BuildContext context) {
  82. var theme = Theme.of(context);
  83. var style = theme.textTheme.displayMedium!.copyWith(
  84. color: Colors.orange,
  85. );
  86. return Column(
  87. children: [
  88. Text('TelNow', style: style),
  89. ],
  90. );
  91. }
  92. }
  93. class Pindai extends StatelessWidget {
  94. const Pindai({
  95. Key? key,
  96. }) : super(key: key);
  97. @override
  98. Widget build(BuildContext context) {
  99. return Card(
  100. child: Padding(
  101. padding: const EdgeInsets.all(20),
  102. child: TextButton(
  103. onPressed: () {
  104. print('QR pressed!');
  105. },
  106. child: Text('Pindai QR'),
  107. ),
  108. ),
  109. );
  110. }
  111. }
  112. class Footer extends StatelessWidget {
  113. const Footer({
  114. Key? key,
  115. }) : super(key: key);
  116. @override
  117. Widget build(BuildContext context) {
  118. return Column(
  119. children: [
  120. Text('Kebijakan Privasi'),
  121. Text('Versi 4.0.0.0'),
  122. ],
  123. );
  124. }
  125. }