athrainsky 2 years ago
parent
commit
2a3e335883
4 changed files with 124 additions and 86 deletions
  1. BIN
      assets/images/building.jpg
  2. 1 1
      lib/list.dart
  3. 64 56
      lib/login.dart
  4. 59 29
      lib/main.dart

BIN
assets/images/building.jpg


+ 1 - 1
lib/list.dart

@@ -8,7 +8,7 @@ class ListPage extends StatelessWidget {
     return Scaffold(
         resizeToAvoidBottomInset: false,
         backgroundColor: Theme.of(context).colorScheme.primaryContainer,
-        body: Column(
+        body: ListView(
           children: [
             Row(
               children: [

+ 64 - 56
lib/login.dart

@@ -8,67 +8,75 @@ class LoginPage extends StatelessWidget {
   Widget build(BuildContext context) {
     return Scaffold(
       backgroundColor: Theme.of(context).colorScheme.primaryContainer,
-      body: Column(
-        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
-        children: [
-          Lang(),
-          Expanded(
-            child: Center(
-                child: Text(
-              'TelNow',
-              style: TextStyle(color: Colors.orange, fontSize: 48),
-            )),
-          ),
-          Expanded(
-              child: Column(
-            children: [
-              Padding(
-                padding: const EdgeInsets.all(8.0),
-                child: TextField(
-                  decoration: InputDecoration(
-                    border: OutlineInputBorder(),
-                    labelText: 'Nama Pengguna',
+      body: Container(
+        decoration: BoxDecoration(
+            image: DecorationImage(
+          image: AssetImage("assets/images/building.jpg"),
+          fit: BoxFit.cover,
+        )),
+        child: Column(
+          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+          children: [
+            Lang(),
+            Expanded(
+              child: Center(
+                  child: Text(
+                'TelNow',
+                style: TextStyle(color: Colors.orange, fontSize: 48),
+              )),
+            ),
+            Expanded(
+                child: Column(
+              children: [
+                Padding(
+                  padding: const EdgeInsets.all(8.0),
+                  child: TextField(
+                    decoration: InputDecoration(                      
+                      border: OutlineInputBorder(),
+                      labelText: 'Nama Pengguna',
+                    ),
                   ),
                 ),
-              ),
-              Padding(
-                padding: const EdgeInsets.all(8.0),
-                child: TextField(
-                  obscureText: true,
-                  decoration: InputDecoration(
-                    border: OutlineInputBorder(),
-                    labelText: 'Kata Sandi',
+                Padding(
+                  padding: const EdgeInsets.all(8.0),
+                  child: TextField(
+                    obscureText: true,
+                    decoration: InputDecoration(
+                      border: OutlineInputBorder(),
+                      labelText: 'Kata Sandi',
+                    ),
                   ),
                 ),
-              ),
-              Padding(
-                padding: const EdgeInsets.all(8.0),
-                child: ElevatedButton(
-                  onPressed: () => context.go('/list'),
-                  style: ButtonStyle(
-                      padding: MaterialStateProperty.all<EdgeInsets>(
-                          EdgeInsets.only(
-                              left: 260, right: 260, bottom: 25, top: 25)),
-                      backgroundColor: MaterialStateProperty.all(
-                          Color.fromARGB(255, 0, 255, 255)),
-                      foregroundColor:
-                          MaterialStateProperty.all<Color>(Colors.black),
-                      shape: MaterialStateProperty.all<RoundedRectangleBorder>(
-                          RoundedRectangleBorder(
-                        borderRadius: BorderRadius.circular(10),
-                      ))),
-                  child: Text('Masuk'),
+                Padding(
+                  padding: const EdgeInsets.all(8.0),
+                  child: ElevatedButton(
+                    onPressed: () => context.go('/list'),
+                    style: ButtonStyle(
+                        padding: MaterialStateProperty.all<EdgeInsets>(
+                            EdgeInsets.only(
+                                left: 260, right: 260, bottom: 25, top: 25)),
+                        backgroundColor: MaterialStateProperty.all(
+                            Color.fromARGB(255, 0, 255, 255)),
+                        foregroundColor:
+                            MaterialStateProperty.all<Color>(Colors.black),
+                        shape:
+                            MaterialStateProperty.all<RoundedRectangleBorder>(
+                                RoundedRectangleBorder(
+                          borderRadius: BorderRadius.circular(10),
+                        ))),
+                    child: Text('Masuk'),
+                  ),
                 ),
-              ),
-              Text('Frisian Flag Indonesia, Tbk.'),
-            ],
-          )),
-          Text('Kebijakan Privasi'),
-          Text('Versi 4.0.0.0'),
-          Container(
-            color: Theme.of(context).colorScheme.primaryContainer,
-          )
-        ],
+                Text('Frisian Flag Indonesia, Tbk.'),
+              ],
+            )),
+            Text('Kebijakan Privasi'),
+            Text('Versi 4.0.0.0'),
+            Container(
+              color: Theme.of(context).colorScheme.primaryContainer,
+            )
+          ],
+        ),
       ),
     );
   }

+ 59 - 29
lib/main.dart

@@ -44,35 +44,53 @@ class MyHomePage extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     return Scaffold(
-      backgroundColor: Theme.of(context).colorScheme.primaryContainer,
-      body: Column(
-        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
-        children: [
-          Lang(),
-          Expanded(
-            child: Center(
-                child: Text(
-              'TelNow',
-              style: TextStyle(color: Colors.orange, fontSize: 48),
-            )),
-          ),
-          Padding(
-            padding: const EdgeInsets.only(left: 120, right: 120),
-            child: Text(
-              'Silakan pindai QR terlebih dulu untuk mulai menggunakan aplikasi.',
-              softWrap: true,
-              textAlign: TextAlign.center,
+      //backgroundColor: Theme.of(context).colorScheme.primaryContainer,
+      body: Container(
+        decoration: BoxDecoration(
+            image: DecorationImage(
+          image: AssetImage("assets/images/building.jpg"),
+          fit: BoxFit.cover,
+        )),
+        child: Column(
+          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+          children: [
+            Lang(),
+            Expanded(
+              child: Center(
+                  child: Text(
+                'TelNow',
+                style: TextStyle(color: Colors.orange, fontSize: 48),
+              )),
             ),
-          ),
-          Expanded(
-            child: Center(child: Pindai()),
-          ),
-          Text('Kebijakan Privasi'),
-          Text('Versi 4.0.0.0'),
-          Container(
-            color: Theme.of(context).colorScheme.primaryContainer,
-          )
-        ],
+            Padding(
+              padding: const EdgeInsets.only(left: 120, right: 120),
+              child: Text(
+                'Silakan pindai QR terlebih dulu untuk mulai menggunakan aplikasi.',
+                softWrap: true,
+                textAlign: TextAlign.center,
+                style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.white),
+              ),
+            ),
+            Expanded(
+              child: Center(child: Pindai()),
+            ),
+            Column(
+              children: [
+                Text('Kebijakan Privasi',
+                    style:
+                        TextStyle(fontSize: 15, fontWeight: FontWeight.w800, color: Colors.white)),
+                Text('Versi 4.0.0.0',
+                style:
+                        TextStyle(fontSize: 15, fontWeight: FontWeight.w800, color: Colors.white))
+              ],
+            ),
+            // Text('Kebijakan Privasi'),
+            // Text('Versi 4.0.0.0'),
+            Container(
+              color: Theme.of(context).colorScheme.primaryContainer,
+            )
+          ],
+        ),
       ),
     );
   }
@@ -90,6 +108,16 @@ class Lang extends StatefulWidget {
 class _LangState extends State<Lang> {
   var selectedIndex = 0;
 
+  // void _changeLang() {
+  //   setState(() {
+  //     if (selectedIndex == 0) {
+
+  //     } else {
+
+  //     }
+  //   });
+  // }
+
   @override
   Widget build(BuildContext context) {
     return Padding(
@@ -149,11 +177,13 @@ class Pindai extends StatelessWidget {
         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'),
+        child: Text('Pindai QR', style: TextStyle(color: Colors.white),),
       )),
     );
   }