Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions lib/control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,45 @@ class _ControlState extends State<Control> {
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(

appBar: AppBar(
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Home page",
),
TextButton.icon(
label: Text("Exit"),
icon: Icon(
Icons.exit_to_app,
color: Colors.white,
),
onPressed: () {
Navigator.pop(context);
},
)
],
),
),
backgroundColor: Colors.white,
body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.home,
size: 250.0,
color: Colors.grey,
),
Text(
'Home',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 40.0,
color: Colors.grey,


appBar: AppBar(
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand Down Expand Up @@ -69,8 +108,30 @@ class _ControlState extends State<Control> {
icon: Icon(Icons.school),
label: 'School',
),

),
],
),
bottomNavigationBar: BottomNavigationBar(
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.business),
label: 'Business',
),
BottomNavigationBarItem(
icon: Icon(Icons.school),
label: 'School',
),
],
),

],
)

),
);
}
Expand Down
62 changes: 33 additions & 29 deletions lib/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class _LoginState extends State<Login> {
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.blue,
appBar: AppBar(
title: Text("Login page"),
),
Expand All @@ -43,36 +42,41 @@ class _LoginState extends State<Login> {
obscureText: true, //text hiding
),
SizedBox(height: 45.0),
TextButton(
style: TextButton.styleFrom(
primary: Colors.white,
backgroundColor: Colors.blue,
shadowColor: Colors.grey,
elevation: 5.0,
),
onPressed: () {
if (emailController.text == 'anant1234@gmail.com' &&
passwordController.text ==
'anant') // email and password static
{
Navigator.pushNamed(
context, '/control'); //push to next route
Fluttertoast.showToast(
msg: 'Login successfull',
textColor: Colors.red,
backgroundColor: Colors.grey,
gravity: ToastGravity.BOTTOM,
);
} else {
Fluttertoast.showToast(
msg: 'Login unsuccessfull',
Container(
width: double.infinity,
height: 40,
child: TextButton(
style: TextButton.styleFrom(
primary: Colors.white,
backgroundColor: Theme.of(context).primaryColor,
shadowColor: Colors.grey,
elevation: 5.0,
),
onPressed: () {
if (emailController.text ==
'anant1234@gmail.com' &&
passwordController.text ==
'anant') // email and password static
{
Navigator.pushNamed(
context, '/control'); //push to next route
Fluttertoast.showToast(
msg: 'Login successfull',
textColor: Colors.red,
backgroundColor: Colors.grey,
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM);
}
},
child: Text('Login'),
gravity: ToastGravity.BOTTOM,
);
} else {
Fluttertoast.showToast(
msg: 'Login unsuccessfull',
textColor: Colors.red,
backgroundColor: Colors.grey,
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM);
}
},
child: Text('Login'),
),
)
]
)
Expand Down
12 changes: 12 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
import 'package:flutter/material.dart';

import './control.dart';
import './login.dart';
import './splash.dart';

import 'control.dart';
import 'login.dart';
import 'splash.dart';


void main() {
runApp(
MaterialApp(
theme: ThemeData(
primaryColor: Colors.pink,
accentColor: Colors.amber,
canvasColor: Color.fromRGBO(255, 254, 229, 1),
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: Splash(),
routes: {
'/control': (context) => Control(),
Expand Down