athrainsky 2 years ago
parent
commit
2aebbe87d5
3 changed files with 139 additions and 99 deletions
  1. 17 7
      lib/lang.dart
  2. 91 69
      lib/login.dart
  3. 31 23
      lib/main.dart

+ 17 - 7
lib/lang.dart

@@ -28,6 +28,15 @@ class _LangState extends State<Lang> {
       padding: const EdgeInsets.all(8.0),
       child: Row(
         children: [
+          // BackButton(),
+          // Padding(
+          //   padding: const EdgeInsets.only(right: 0),
+          //   child: Text(
+          //     'Kembali Pindai QR',
+          //     softWrap: true,
+          //     textAlign: TextAlign.left,
+          //   ),
+          // ),
           Expanded(child: Container()),
           ElevatedButton(
             onPressed: () {
@@ -40,8 +49,8 @@ class _LangState extends State<Lang> {
                 shape: MaterialStateProperty.all<RoundedRectangleBorder>(
                     RoundedRectangleBorder(
                   borderRadius: BorderRadius.only(
-                      topLeft: Radius.circular(20),
-                      bottomLeft: Radius.circular(20)),
+                      topLeft: Radius.circular(16),
+                      bottomLeft: Radius.circular(16)),
                 ))),
             child: Text('EN'),
           ),
@@ -52,17 +61,18 @@ class _LangState extends State<Lang> {
               style: ButtonStyle(
                   foregroundColor:
                       MaterialStateProperty.all<Color>(Colors.white),
-                  backgroundColor: MaterialStateProperty.all<Color>(Colors.red),
+                  backgroundColor:
+                      MaterialStateProperty.all<Color>(Colors.orange),
                   shape: MaterialStateProperty.all<RoundedRectangleBorder>(
                       RoundedRectangleBorder(
                     borderRadius: BorderRadius.only(
-                        topRight: Radius.circular(20),
-                        bottomRight: Radius.circular(20)),
-                    side: BorderSide(color: Colors.red),
+                        topRight: Radius.circular(16),
+                        bottomRight: Radius.circular(16)),
+                    side: BorderSide(color: Color.fromARGB(164, 255, 164, 1)),
                   ))),
               child: Text('ID'))
         ],
       ),
     );
   }
-}
+}

+ 91 - 69
lib/login.dart

@@ -1,5 +1,6 @@
 import 'package:flutter/material.dart';
 import 'package:go_router/go_router.dart';
+import 'package:namer_app/lang.dart';
 
 class LoginPage extends StatelessWidget {
   const LoginPage({Key? key}) : super(key: key);
@@ -17,11 +18,12 @@ class LoginPage extends StatelessWidget {
         child: Column(
           mainAxisAlignment: MainAxisAlignment.spaceEvenly,
           children: [
+            // BackButton(),
             Lang(),
             Expanded(
               child: Center(
                   child: Text(
-                'TelNow',
+                'telnow',
                 style: TextStyle(color: Colors.orange, fontSize: 48),
               )),
             ),
@@ -31,7 +33,7 @@ class LoginPage extends StatelessWidget {
                 Padding(
                   padding: const EdgeInsets.all(8.0),
                   child: TextField(
-                    decoration: InputDecoration(                      
+                    decoration: InputDecoration(
                       border: OutlineInputBorder(),
                       labelText: 'Nama Pengguna',
                     ),
@@ -56,7 +58,7 @@ class LoginPage extends StatelessWidget {
                             EdgeInsets.only(
                                 left: 260, right: 260, bottom: 25, top: 25)),
                         backgroundColor: MaterialStateProperty.all(
-                            Color.fromARGB(255, 0, 255, 255)),
+                            Color.fromARGB(0, 7, 140, 132)),
                         foregroundColor:
                             MaterialStateProperty.all<Color>(Colors.black),
                         shape:
@@ -64,14 +66,34 @@ class LoginPage extends StatelessWidget {
                                 RoundedRectangleBorder(
                           borderRadius: BorderRadius.circular(10),
                         ))),
-                    child: Text('Masuk'),
+                    child: Text(
+                      'Masuk',
+                      style: TextStyle(color: Colors.white),
+                    ),
                   ),
                 ),
-                Text('Frisian Flag Indonesia, Tbk.'),
+                Text(
+                  'Frisian Flag Indonesia, Tbk.',
+                  style: TextStyle(color: Colors.white),
+                ),
               ],
             )),
-            Text('Kebijakan Privasi'),
-            Text('Versi 4.0.0.0'),
+            Column(
+              children: [
+                Text('Kebijakan Privasi',
+                    style: TextStyle(
+                        fontSize: 16,
+                        decoration: TextDecoration.underline,
+                        fontWeight: FontWeight.w800,
+                        color: Colors.white)),
+                Text('Versi 4.0.0.0',
+                    style: TextStyle(
+                      fontSize: 16,
+                      fontWeight: FontWeight.w800,
+                      color: Colors.white,
+                    ))
+              ],
+            ),
             Container(
               color: Theme.of(context).colorScheme.primaryContainer,
             )
@@ -82,68 +104,68 @@ class LoginPage extends StatelessWidget {
   }
 }
 
-class Lang extends StatefulWidget {
-  const Lang({
-    Key? key,
-  }) : super(key: key);
+// class Lang extends StatefulWidget {
+//   const Lang({
+//     Key? key,
+//   }) : super(key: key);
 
-  @override
-  State<Lang> createState() => _LangState();
-}
+//   @override
+//   State<Lang> createState() => _LangState();
+// }
 
-class _LangState extends State<Lang> {
-  var selectedIndex = 0;
+// class _LangState extends State<Lang> {
+//   var selectedIndex = 0;
 
-  @override
-  Widget build(BuildContext context) {
-    return Padding(
-      padding: const EdgeInsets.all(8.0),
-      child: Row(
-        children: [
-          BackButton(),
-          Padding(
-            padding: const EdgeInsets.only(right: 0),
-            child: Text(
-              'Kembali Pindai QR',
-              softWrap: true,
-              textAlign: TextAlign.left,
-            ),
-          ),
-          Expanded(child: Container()),
-          ElevatedButton(
-            onPressed: () {
-              print('EN');
-            },
-            style: ButtonStyle(
-                foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
-                backgroundColor:
-                    MaterialStateProperty.all<Color>(Colors.white70),
-                shape: MaterialStateProperty.all<RoundedRectangleBorder>(
-                    RoundedRectangleBorder(
-                  borderRadius: BorderRadius.only(
-                      topLeft: Radius.circular(20),
-                      bottomLeft: Radius.circular(20)),
-                ))),
-            child: Text('EN'),
-          ),
-          ElevatedButton(
-              onPressed: () {
-                print('ID');
-              },
-              style: ButtonStyle(
-                  foregroundColor:
-                      MaterialStateProperty.all<Color>(Colors.white),
-                  backgroundColor: MaterialStateProperty.all<Color>(Colors.red),
-                  shape: MaterialStateProperty.all<RoundedRectangleBorder>(
-                      RoundedRectangleBorder(
-                    borderRadius: BorderRadius.only(
-                        topRight: Radius.circular(20),
-                        bottomRight: Radius.circular(20)),
-                    side: BorderSide(color: Colors.red),
-                  ))),
-              child: Text('ID'))
-        ],
-      ),
-    );
-  }
-}
+//   @override
+//   Widget build(BuildContext context) {
+//     return Padding(
+//       padding: const EdgeInsets.all(8.0),
+//       child: Row(
+//         children: [
+//           BackButton(),
+//           Padding(
+//             padding: const EdgeInsets.only(right: 0),
+//             child: Text(
+//               'Kembali Pindai QR',
+//               softWrap: true,
+//               textAlign: TextAlign.left,
+//             ),
+//           ),
+//           Expanded(child: Container()),
+//           ElevatedButton(
+//             onPressed: () {
+//               print('EN');
+//             },
+//             style: ButtonStyle(
+//                 foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
+//                 backgroundColor:
+//                     MaterialStateProperty.all<Color>(Colors.white70),
+//                 shape: MaterialStateProperty.all<RoundedRectangleBorder>(
+//                     RoundedRectangleBorder(
+//                   borderRadius: BorderRadius.only(
+//                       topLeft: Radius.circular(20),
+//                       bottomLeft: Radius.circular(20)),
+//                 ))),
+//             child: Text('EN'),
+//           ),
+//           ElevatedButton(
+//               onPressed: () {
+//                 print('ID');
+//               },
+//               style: ButtonStyle(
+//                   foregroundColor:
+//                       MaterialStateProperty.all<Color>(Colors.white),
+//                   backgroundColor: MaterialStateProperty.all<Color>(Colors.red),
+//                   shape: MaterialStateProperty.all<RoundedRectangleBorder>(
+//                       RoundedRectangleBorder(
+//                     borderRadius: BorderRadius.only(
+//                         topRight: Radius.circular(20),
+//                         bottomRight: Radius.circular(20)),
+//                     side: BorderSide(color: Colors.red),
+//                   ))),
+//               child: Text('ID'))
+//         ],
+//       ),
+//     );
+//   }
+// }

+ 31 - 23
lib/main.dart

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
 import 'package:go_router/go_router.dart';
 import 'package:namer_app/list.dart';
 import 'package:namer_app/login.dart';
+import 'package:namer_app/lang.dart';
 
 void main() {
   runApp(MyApp());
@@ -58,7 +59,7 @@ class MyHomePage extends StatelessWidget {
             Expanded(
               child: Center(
                   child: Text(
-                'TelNow',
+                'telnow',
                 style: TextStyle(color: Colors.orange, fontSize: 48),
               )),
             ),
@@ -68,7 +69,10 @@ class MyHomePage extends StatelessWidget {
                 'Silakan pindai QR terlebih dulu untuk mulai menggunakan aplikasi.',
                 softWrap: true,
                 textAlign: TextAlign.center,
-                style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.white),
+                style: TextStyle(
+                    fontSize: 16,
+                    fontWeight: FontWeight.bold,
+                    color: Colors.white),
               ),
             ),
             Expanded(
@@ -77,15 +81,19 @@ class MyHomePage extends StatelessWidget {
             Column(
               children: [
                 Text('Kebijakan Privasi',
-                    style:
-                        TextStyle(fontSize: 15, fontWeight: FontWeight.w800, color: Colors.white)),
+                    style: TextStyle(
+                        fontSize: 16,
+                        decoration: TextDecoration.underline,
+                        fontWeight: FontWeight.w800,
+                        color: Colors.white)),
                 Text('Versi 4.0.0.0',
-                style:
-                        TextStyle(fontSize: 15, fontWeight: FontWeight.w800, color: Colors.white))
+                    style: TextStyle(
+                      fontSize: 16,
+                      fontWeight: FontWeight.w800,
+                      color: Colors.white,
+                    ))
               ],
             ),
-            // Text('Kebijakan Privasi'),
-            // Text('Versi 4.0.0.0'),
             Container(
               color: Theme.of(context).colorScheme.primaryContainer,
             )
@@ -103,21 +111,21 @@ class Pindai extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
-    return Expanded(
-      child: Center(
-          child: ElevatedButton(
-        onPressed: () => context.go('/login'),
-        style: ButtonStyle(
-            padding: MaterialStateProperty.all<EdgeInsets>(EdgeInsets.all(50)),
-            foregroundColor: MaterialStateProperty.all<Color>(Colors.black),
-            backgroundColor:
-                MaterialStateProperty.all(Color.fromARGB(255, 0, 255, 255)),
-            shape: MaterialStateProperty.all<RoundedRectangleBorder>(
-                RoundedRectangleBorder(
-              borderRadius: BorderRadius.circular(18.0),
-            ))),
-        child: Text('Pindai QR', style: TextStyle(color: Colors.white),),
-      )),
+    return ElevatedButton(
+      onPressed: () => context.go('/login'),
+      style: ButtonStyle(
+          padding: MaterialStateProperty.all<EdgeInsets>(EdgeInsets.all(50)),
+          foregroundColor: MaterialStateProperty.all<Color>(Colors.black),
+          backgroundColor:
+              MaterialStateProperty.all(Color.fromARGB(1, 7, 140, 132)),
+          shape: MaterialStateProperty.all<RoundedRectangleBorder>(
+              RoundedRectangleBorder(
+            borderRadius: BorderRadius.circular(18.0),
+          ))),
+      child: Text(
+        'Pindai QR',
+        style: TextStyle(color: Colors.white),
+      ),
     );
   }
 }