summaryrefslogtreecommitdiff
path: root/lib/main.dart
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2023-11-20 13:45:39 +0200
committeromagdy7 <omar.professional8777@gmail.com>2023-11-20 13:45:39 +0200
commit868ac401d5e0a45d6b66bea813dda4241d93dbcc (patch)
treedecf5408061888b906fbd8d3014d488143008a5b /lib/main.dart
parenta15bf522340de49118b0a88369a6cc892dfee9d0 (diff)
downloadcarpool-868ac401d5e0a45d6b66bea813dda4241d93dbcc.tar.xz
carpool-868ac401d5e0a45d6b66bea813dda4241d93dbcc.zip
Added login and routes page
Diffstat (limited to 'lib/main.dart')
-rw-r--r--lib/main.dart62
1 files changed, 11 insertions, 51 deletions
diff --git a/lib/main.dart b/lib/main.dart
index d5f9762..dc8ba74 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -1,6 +1,10 @@
import 'package:flutter/material.dart';
+import 'routes.dart';
+import 'login.dart';
-void main() => runApp(MyApp());
+void main() {
+ runApp(MyApp());
+}
class MyApp extends StatelessWidget {
@override
@@ -9,57 +13,13 @@ class MyApp extends StatelessWidget {
title: 'Carpool App',
theme: ThemeData(
primarySwatch: Colors.blue,
+ visualDensity: VisualDensity.adaptivePlatformDensity,
),
- home: LoginPage(),
- );
- }
-}
-
-class LoginPage extends StatelessWidget {
- final TextEditingController emailController = TextEditingController();
- final TextEditingController passwordController = TextEditingController();
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text('Login'),
- ),
- body: Padding(
- padding: const EdgeInsets.all(16.0),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- TextField(
- controller: emailController,
- keyboardType: TextInputType.emailAddress,
- decoration: InputDecoration(labelText: 'Email'),
- ),
- SizedBox(height: 16.0),
- TextField(
- controller: passwordController,
- obscureText: true,
- decoration: InputDecoration(labelText: 'Password'),
- ),
- SizedBox(height: 32.0),
- ElevatedButton(
- onPressed: () {
- // Handle login button press
- // Add your authentication logic here
- },
- child: Text('Login'),
- ),
- SizedBox(height: 16.0),
- TextButton(
- onPressed: () {
- // Navigate to the sign-up page
- // Add your navigation logic here
- },
- child: Text('Don\'t have an account? Sign up'),
- ),
- ],
- ),
- ),
+ initialRoute: '/routes', // Set the initial route to the login page
+ routes: {
+ '/login': (context) => LoginPage(),
+ '/routes': (context) => RoutesPage(),
+ },
);
}
}