Create app.py
Browse files
app.py
CHANGED
|
@@ -1,19 +1,92 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import 'package:flutter/material.dart';
|
| 2 |
+
|
| 3 |
+
void main() => runApp(ServiApp());
|
| 4 |
+
|
| 5 |
+
class ServiApp extends StatelessWidget {
|
| 6 |
+
@override
|
| 7 |
+
Widget build(BuildContext context) {
|
| 8 |
+
return MaterialApp(
|
| 9 |
+
title: 'Servi',
|
| 10 |
+
home: SplashScreen(),
|
| 11 |
+
);
|
| 12 |
+
}
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
class SplashScreen extends StatefulWidget {
|
| 16 |
+
@override
|
| 17 |
+
_SplashScreenState createState() => _SplashScreenState();
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
class _SplashScreenState extends State<SplashScreen> {
|
| 21 |
+
@override
|
| 22 |
+
void initState() {
|
| 23 |
+
super.initState();
|
| 24 |
+
Future.delayed(Duration(seconds: 3), () {
|
| 25 |
+
Navigator.pushReplacement(
|
| 26 |
+
context,
|
| 27 |
+
MaterialPageRoute(builder: (context) => SignInScreen()),
|
| 28 |
+
);
|
| 29 |
+
});
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
@override
|
| 33 |
+
Widget build(BuildContext context) {
|
| 34 |
+
return Scaffold(
|
| 35 |
+
backgroundColor: Colors.orange[100],
|
| 36 |
+
body: Center(
|
| 37 |
+
child: Column(
|
| 38 |
+
mainAxisAlignment: MainAxisAlignment.center,
|
| 39 |
+
children: [
|
| 40 |
+
Text('Servi', style: TextStyle(fontSize: 48, fontWeight: FontWeight.bold, color: Colors.black)),
|
| 41 |
+
SizedBox(height: 8),
|
| 42 |
+
Text('Your service, our priority', style: TextStyle(fontSize: 16, color: Colors.grey[700])),
|
| 43 |
+
],
|
| 44 |
+
),
|
| 45 |
+
),
|
| 46 |
+
);
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
class SignInScreen extends StatelessWidget {
|
| 51 |
+
void _onGoogleSignIn() {
|
| 52 |
+
// Simulate sign-in process
|
| 53 |
+
print("Google Sign-In Clicked");
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
void _onFacebookSignIn() {
|
| 57 |
+
// Simulate sign-in process
|
| 58 |
+
print("Facebook Sign-In Clicked");
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
@override
|
| 62 |
+
Widget build(BuildContext context) {
|
| 63 |
+
return Scaffold(
|
| 64 |
+
backgroundColor: Colors.white,
|
| 65 |
+
body: Center(
|
| 66 |
+
child: Padding(
|
| 67 |
+
padding: EdgeInsets.symmetric(horizontal: 24),
|
| 68 |
+
child: Column(
|
| 69 |
+
mainAxisAlignment: MainAxisAlignment.center,
|
| 70 |
+
children: [
|
| 71 |
+
Text("Sign in to continue", style: TextStyle(fontSize: 20)),
|
| 72 |
+
SizedBox(height: 40),
|
| 73 |
+
ElevatedButton.icon(
|
| 74 |
+
icon: Icon(Icons.g_mobiledata),
|
| 75 |
+
label: Text("Continue with Google"),
|
| 76 |
+
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
|
| 77 |
+
onPressed: _onGoogleSignIn,
|
| 78 |
+
),
|
| 79 |
+
SizedBox(height: 16),
|
| 80 |
+
ElevatedButton.icon(
|
| 81 |
+
icon: Icon(Icons.facebook),
|
| 82 |
+
label: Text("Continue with Facebook"),
|
| 83 |
+
style: ElevatedButton.styleFrom(backgroundColor: Colors.blue),
|
| 84 |
+
onPressed: _onFacebookSignIn,
|
| 85 |
+
),
|
| 86 |
+
],
|
| 87 |
+
),
|
| 88 |
+
),
|
| 89 |
+
),
|
| 90 |
+
);
|
| 91 |
+
}
|
| 92 |
+
}
|