athrainsky 2 years ago
parent
commit
74c6605805
2 changed files with 29 additions and 28 deletions
  1. 2 2
      lib/login.dart
  2. 27 26
      lib/main.dart

+ 2 - 2
lib/login.dart

@@ -1,8 +1,8 @@
 import 'package:flutter/material.dart';
 
-class login extends StatelessWidget {
+class Login extends StatelessWidget {
   /// Constructs a [DetailsScreen]
-  const login({Key? key}) : super(key: key);
+  const Login({Key? key}) : super(key: key);
 
   @override
   Widget build(BuildContext context) {

+ 27 - 26
lib/main.dart

@@ -1,5 +1,6 @@
 import 'package:flutter/material.dart';
 import 'package:go_router/go_router.dart';
+import 'package:namer_app/login.dart';
 
 void main() {
   runApp(MyApp());
@@ -10,11 +11,11 @@ final _router = GoRouter(
     GoRoute(
       path: '/',
       builder: (context, state) => MyHomePage(),
-      // routes: [
-      //   GoRoute(
-      //     path: '/login',
-      //     builder: (context, state) => Placeholder(),)
-      // ]
+      routes: [
+        GoRoute(
+          path: '/login',
+          builder: (context, state) => const Login(),)
+      ]
     ),
   ],
 );
@@ -193,25 +194,25 @@ class Pindai extends StatelessWidget {
 //   }
 // }
 
-class login extends StatelessWidget {
-  /// Constructs a [DetailsScreen]
-  const login({Key? key}) : super(key: key);
+// class Login extends StatelessWidget {
+//   /// Constructs a [DetailsScreen]
+//   const Login({Key? key}) : super(key: key);
 
-  @override
-  Widget build(BuildContext context) {
-    return Scaffold(
-      appBar: AppBar(title: const Text('Details Screen')),
-      body: Center(
-        child: Column(
-          mainAxisAlignment: MainAxisAlignment.center,
-          children: <ElevatedButton>[
-            ElevatedButton(
-              onPressed: () {print('x');},
-              child: const Text('Go back to the Home screen'),
-            ),
-          ],
-        ),
-      ),
-    );
-  }
-}
+//   @override
+//   Widget build(BuildContext context) {
+//     return Scaffold(
+//       appBar: AppBar(title: const Text('Details Screen')),
+//       body: Center(
+//         child: Column(
+//           mainAxisAlignment: MainAxisAlignment.center,
+//           children: <ElevatedButton>[
+//             ElevatedButton(
+//               onPressed: () {print('x');},
+//               child: const Text('Go back to the Home screen'),
+//             ),
+//           ],
+//         ),
+//       ),
+//     );
+//   }
+// }