Joy / app.py
TutorPal's picture
Create app.py
ccef8ca verified
import 'package:flutter/material.dart';
void main() => runApp(ServiApp());
class ServiApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Servi',
home: SplashScreen(),
);
}
}
class SplashScreen extends StatefulWidget {
@override
_SplashScreenState createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
@override
void initState() {
super.initState();
Future.delayed(Duration(seconds: 3), () {
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => SignInScreen()),
);
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.orange[100],
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Servi', style: TextStyle(fontSize: 48, fontWeight: FontWeight.bold, color: Colors.black)),
SizedBox(height: 8),
Text('Your service, our priority', style: TextStyle(fontSize: 16, color: Colors.grey[700])),
],
),
),
);
}
}
class SignInScreen extends StatelessWidget {
void _onGoogleSignIn() {
// Simulate sign-in process
print("Google Sign-In Clicked");
}
void _onFacebookSignIn() {
// Simulate sign-in process
print("Facebook Sign-In Clicked");
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("Sign in to continue", style: TextStyle(fontSize: 20)),
SizedBox(height: 40),
ElevatedButton.icon(
icon: Icon(Icons.g_mobiledata),
label: Text("Continue with Google"),
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
onPressed: _onGoogleSignIn,
),
SizedBox(height: 16),
ElevatedButton.icon(
icon: Icon(Icons.facebook),
label: Text("Continue with Facebook"),
style: ElevatedButton.styleFrom(backgroundColor: Colors.blue),
onPressed: _onFacebookSignIn,
),
],
),
),
),
);
}
}