diff --git a/lib/control.dart b/lib/control.dart index f59e8b0..beec5e1 100644 --- a/lib/control.dart +++ b/lib/control.dart @@ -20,6 +20,45 @@ class _ControlState extends State { 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, @@ -69,8 +108,30 @@ class _ControlState extends State { icon: Icon(Icons.school), label: 'School', ), + + ), + ], + ), + bottomNavigationBar: BottomNavigationBar( + items: const [ + BottomNavigationBarItem( + icon: Icon(Icons.home), + label: 'Home', + ), + BottomNavigationBarItem( + icon: Icon(Icons.business), + label: 'Business', + ), + BottomNavigationBarItem( + icon: Icon(Icons.school), + label: 'School', + ), + ], + ), + ], ) + ), ); } diff --git a/lib/login.dart b/lib/login.dart index 786b3ea..aef6630 100644 --- a/lib/login.dart +++ b/lib/login.dart @@ -16,7 +16,6 @@ class _LoginState extends State { Widget build(BuildContext context) { return MaterialApp( home: Scaffold( - backgroundColor: Colors.blue, appBar: AppBar( title: Text("Login page"), ), @@ -43,36 +42,41 @@ class _LoginState extends State { 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'), + ), ) ] ) diff --git a/lib/main.dart b/lib/main.dart index 904f2b9..e14cc66 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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(),