diff --git a/images/01.png b/images/01.png new file mode 100644 index 0000000..511be2d Binary files /dev/null and b/images/01.png differ diff --git a/images/02.png b/images/02.png new file mode 100644 index 0000000..debf165 Binary files /dev/null and b/images/02.png differ diff --git a/images/03.png b/images/03.png new file mode 100644 index 0000000..3d45adc Binary files /dev/null and b/images/03.png differ diff --git a/images/04.png b/images/04.png new file mode 100644 index 0000000..253192d Binary files /dev/null and b/images/04.png differ diff --git a/images/05.png b/images/05.png new file mode 100644 index 0000000..e23fe31 Binary files /dev/null and b/images/05.png differ diff --git a/images/06.png b/images/06.png new file mode 100644 index 0000000..9e74414 Binary files /dev/null and b/images/06.png differ diff --git a/images/emergency.png b/images/emergency.png new file mode 100644 index 0000000..4eeda99 Binary files /dev/null and b/images/emergency.png differ diff --git a/images/invitations.png b/images/invitations.png new file mode 100644 index 0000000..43248d5 Binary files /dev/null and b/images/invitations.png differ diff --git a/images/medicines.png b/images/medicines.png new file mode 100644 index 0000000..8cd1f94 Binary files /dev/null and b/images/medicines.png differ diff --git a/images/mobilebg.png b/images/mobilebg.png new file mode 100644 index 0000000..b831d5a Binary files /dev/null and b/images/mobilebg.png differ diff --git a/images/prescriptions.png b/images/prescriptions.png new file mode 100644 index 0000000..a3f0b4c Binary files /dev/null and b/images/prescriptions.png differ diff --git a/images/profile_pic.png b/images/profile_pic.png new file mode 100644 index 0000000..3fd3f73 Binary files /dev/null and b/images/profile_pic.png differ diff --git a/images/reports.png b/images/reports.png new file mode 100644 index 0000000..4f4b8a6 Binary files /dev/null and b/images/reports.png differ diff --git a/images/seekopinion.png b/images/seekopinion.png new file mode 100644 index 0000000..665f8ce Binary files /dev/null and b/images/seekopinion.png differ diff --git a/lib/dashboard.dart b/lib/dashboard.dart index fc24ff3..c6fddd7 100644 --- a/lib/dashboard.dart +++ b/lib/dashboard.dart @@ -1,11 +1,16 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:healthcare_user/emergency.dart'; +import 'package:healthcare_user/invitations.dart'; +import 'package:healthcare_user/medicines.dart'; +import 'package:healthcare_user/prescriptions.dart'; +import 'package:healthcare_user/reports.dart'; +import 'package:healthcare_user/seekopinion.dart'; import 'package:healthcare_user/settings.dart'; import 'package:image_picker/image_picker.dart'; -import 'dart:io'; +import 'package:carousel_slider/carousel_slider.dart'; import 'dart:ui' as ui; - import 'login.dart'; class Dashboard extends StatefulWidget { @@ -17,34 +22,12 @@ class Dashboard extends StatefulWidget { class _DashboardState extends State { int _selectedIndex = 0; - - TextEditingController tankNameController = TextEditingController(); - TextEditingController blockNameController = TextEditingController(); - TextEditingController capacityController = TextEditingController(); - String dropdownTypeOfWater = 'General'; - String dropdownTankLocation = 'Sump'; - var typeOfWaterItems = [ - 'General', - 'Bore', - 'Tanker', - ]; - var typeOfTankLocationItems = [ - 'Sump', - 'Overhead', + final List imgList = [ + 'images/mobilebg.png', + 'images/mobilebg.png', + 'images/mobilebg.png' ]; - bool isT1Checked = false; - bool isT2Checked = false; - bool isT3Checked = false; - bool isS2T1Checked = false; - bool isS2T2Checked = false; - bool isS2T3Checked = false; - bool isS3T1Checked = false; - bool isS3T2Checked = false; - bool isS3T3Checked = false; - static const TextStyle optionStyle = - TextStyle(fontSize: 30, fontWeight: FontWeight.bold); - final ImagePicker _picker = ImagePicker(); bool isTablet = false; bool isPhone = true; @@ -67,67 +50,121 @@ class _DashboardState extends State { } } + List images = [ + "images/seekopinion.png", + "images/reports.png", + "images/prescriptions.png", + "images/medicines.png", + "images/invitations.png", + "images/emergency.png" + ]; + + gridOntap(int ind){ + + if(ind==0){ + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const SeekOpinion()), + ); + } + else if(ind==1){ + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const Reports()), + ); + } + else if(ind==2){ + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const Prescriptions()), + ); + } + else if(ind==3){ + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const Medicines()), + ); + } + else if(ind==4){ + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const Invitations()), + ); + } + else if(ind==5){ + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const Emergency()), + ); + } + + } Widget _dashBoard() { return Container( - color: screenBackgroundColor, + color: Colors.white, child: Column( children: [ - Container( + CarouselSlider( + options: CarouselOptions( height: MediaQuery.of(context).size.height * .250, - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(0), - ), - //color: Colors.red, - child: FittedBox( - child: Image( - image: isTablet - ? AssetImage('images/appbg.png') - : AssetImage('images/mobilebg.png'), - ), - fit: BoxFit.fill, - )), - SizedBox(height: 5), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: GestureDetector( - onTap: () { - /*Navigator.push( - context, - MaterialPageRoute(builder: (context) => TankLevelsNew()), - );*/ - }, - child: Container( - padding: EdgeInsets.all(05), - margin: - EdgeInsets.only(left: 15, top: 10, right: 0, bottom: 0), - //height: MediaQuery.of(context).size.height * .05, - //width: MediaQuery.of(context).size.width * .45, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12), - ), - // Change button text when light changes state. - - child: Column( - children: [ - Container( - padding: EdgeInsets.fromLTRB(35, 10, 0, 0), - child: new SvgPicture.asset( - "assets/images/tanklevels.svg")), - Text( - 'Tank Levels', - style: dashboardTextStyle(), + aspectRatio: 16 / 9, + viewportFraction: 0.8, + initialPage: 0, + enableInfiniteScroll: true, + reverse: false, + autoPlay: true, + autoPlayInterval: Duration(seconds: 3), + autoPlayAnimationDuration: Duration(milliseconds: 800), + autoPlayCurve: Curves.ease, + enlargeCenterPage: true, + enlargeFactor: 0.2, + scrollDirection: Axis.horizontal, + ), + items: imgList.map((i) { + return Builder( + builder: (BuildContext context) { + return Container( + height: MediaQuery.of(context).size.height * .250, + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(0), ), - ], - ), - ), - )), - ], + //color: Colors.red, + child: FittedBox( + child: Image( + image: AssetImage(i), + ), + fit: BoxFit.fill, + )); + }, + ); + }).toList(), ), + SizedBox(height: 5), + Expanded(child: Container( + padding: EdgeInsets.all(12.0), + child: GridView.builder( + itemCount: images.length, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + crossAxisSpacing: 4.0, + mainAxisSpacing: 4.0,), + itemBuilder: (BuildContext context, int index) { + return GestureDetector( + onTap: (){ + gridOntap(index); + }, + child: Image.asset(images[index]), + ); + }, + )),) ], ), ); @@ -175,60 +212,48 @@ class _DashboardState extends State { Widget build(BuildContext context) { return WillPopScope( onWillPop: () async { - if (_selectedIndex == 0) { - final shouldPop = await showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: const Text('Do you want to exit app?', - style: TextStyle( - color: primaryColor, - fontSize: 20, - )), - actionsAlignment: MainAxisAlignment.spaceBetween, - actions: [ - TextButton( - onPressed: () { - SystemNavigator.pop(); - }, - child: const Text('Yes', - style: TextStyle( - color: primaryColor, - fontSize: 20, - )), - ), - TextButton( - onPressed: () { - Navigator.of(context).pop(false); - }, - child: const Text('No', - style: TextStyle( - color: primaryColor, - fontSize: 20, - )), - ), - ], - ); - }, - ); - return shouldPop!; - } else { - setState(() { - _selectedIndex = 0; - }); - return false; - } + final shouldPop = await showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: const Text('Do you want to exit app?', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + actionsAlignment: MainAxisAlignment.spaceBetween, + actions: [ + TextButton( + onPressed: () { + SystemNavigator.pop(); + }, + child: const Text('Yes', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + ), + TextButton( + onPressed: () { + Navigator.of(context).pop(false); + }, + child: const Text('No', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + ), + ], + ); + }, + ); + return shouldPop!; }, child: Scaffold( resizeToAvoidBottomInset: false, - appBar: AppSettings.appBar('Arminta Water Management'), + appBar: AppSettings.appBar('Health Care'), drawer: Drawer( - // Add a ListView to the drawer. This ensures the user can scroll - // through the options in the drawer if there isn't enough vertical - // space to fit everything. - //backgroundColor: screenBackgroundColor, child: ListView( - // Important: Remove any padding from the ListView. padding: EdgeInsets.zero, children: [ DrawerHeader( @@ -249,72 +274,25 @@ class _DashboardState extends State { decoration: BoxDecoration( shape: BoxShape.circle, image: DecorationImage( - image: (AppSettings.updatedImage != - null) - ? FileImage( - AppSettings.updatedImage!) - as ImageProvider - : AssetImage( - "images/profile_pic.png"), // picked file + image: AssetImage( + "images/profile_pic.png"), // picked file fit: BoxFit.cover)), ), - onTap: () { - /*showModalBottomSheet( - context: context, - builder: (BuildContext context) { - return SizedBox( - height: 200, - child: Center( - child: Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - GestureDetector( - child: Icon( - Icons.camera_alt_outlined, - size: 100, - color: greyColor, - ), - onTap: () async { - await takeImageFromCamera(); - Navigator.pop(context); - }, - ), - SizedBox( - width: MediaQuery.of(context) - .size - .width * - .20, - ), - GestureDetector( - child: Icon( - Icons.photo, - size: 100, - color: greyColor, - ), - onTap: () async { - await pickImageFromGallery(); - Navigator.pop(context); - }, - ), - ], - ), - ), - ); - });*/ - }, + onTap: () {}, ), ), Text( - AppSettings.userName, + "Sneha", + //AppSettings.userName, style: TextStyle(color: Colors.white, fontSize: 15), ), Text( - AppSettings.phoneNumber, + '9898989898', + //AppSettings.phoneNumber, style: TextStyle(color: Colors.white, fontSize: 15), ), Text( - AppSettings.email, + 'sneha@armintasolutions.com', //AppSettings.email, style: TextStyle(color: Colors.white, fontSize: 15), ), ], @@ -322,12 +300,11 @@ class _DashboardState extends State { Container() ], )), - ListTile( title: Row( children: const [ Image( - image: const AssetImage('images/editprofileblue.png'), + image: const AssetImage('images/01.png'), height: 25, width: 25, fit: BoxFit.fill), @@ -340,37 +317,29 @@ class _DashboardState extends State { Text('Edit Profile', style: TextStyle(color: primaryColor)), ], ), - onTap: () { - /* Navigator.push( - context, - MaterialPageRoute(builder: (context) => UpdateProfile()), - );*/ - }, + onTap: () {}, ), Divider( color: Colors.grey, ), - // Add Tanks ListTile( title: Row( children: const [ Image( - image: const AssetImage('images/addtankerblue.png'), + image: const AssetImage('images/01.png'), height: 25, width: 25, fit: BoxFit.fill), const SizedBox( width: 10, ), - Text('Add Tanks', style: TextStyle(color: primaryColor)), + const SizedBox( + width: 10, + ), + Text('My Health', style: TextStyle(color: primaryColor)), ], ), - onTap: () { - /*Navigator.push( - context, - MaterialPageRoute(builder: (context) => AddTanks()), - );*/ - }, + onTap: () {}, ), Divider( color: Colors.grey, @@ -379,48 +348,42 @@ class _DashboardState extends State { title: Row( children: const [ Image( - image: const AssetImage('images/tankviewblue.png'), + image: const AssetImage('images/01.png'), height: 25, width: 25, fit: BoxFit.fill), const SizedBox( width: 10, ), - Text('Tanks View', style: TextStyle(color: primaryColor)), + const SizedBox( + width: 10, + ), + Text('Report Myself', style: TextStyle(color: primaryColor)), ], ), - onTap: () { - /*Navigator.push( - context, - MaterialPageRoute(builder: (context) => TanksView()), - );*/ - }, + onTap: () {}, ), Divider( color: Colors.grey, ), - //Add Tanker ListTile( title: Row( children: const [ Image( - image: const AssetImage('images/suppliersblue.png'), + image: const AssetImage('images/01.png'), height: 25, width: 25, fit: BoxFit.fill), const SizedBox( width: 10, ), - Text('Add Water Suppliers', - style: TextStyle(color: primaryColor)), + const SizedBox( + width: 10, + ), + Text('My Connections', style: TextStyle(color: primaryColor)), ], ), - onTap: () { - /* Navigator.push( - context, - MaterialPageRoute(builder: (context) => Suppliers()), - );*/ - }, + onTap: () {}, ), Divider( color: Colors.grey, @@ -429,22 +392,20 @@ class _DashboardState extends State { title: Row( children: const [ Image( - image: const AssetImage('images/connectionsblue.png'), + image: const AssetImage('images/01.png'), height: 25, width: 25, fit: BoxFit.fill), const SizedBox( width: 10, ), - Text('Connections', style: TextStyle(color: primaryColor)), + const SizedBox( + width: 10, + ), + Text('My Medicine Timings', style: TextStyle(color: primaryColor)), ], ), - onTap: () { - /* Navigator.push( - context, - MaterialPageRoute(builder: (context) => ConnectionsView()), - );*/ - }, + onTap: () {}, ), Divider( color: Colors.grey, @@ -453,22 +414,20 @@ class _DashboardState extends State { title: Row( children: const [ Image( - image: const AssetImage('images/resourceblue.png'), + image: const AssetImage('images/01.png'), height: 25, width: 25, fit: BoxFit.fill), const SizedBox( width: 10, ), - Text('Resources', style: TextStyle(color: primaryColor)), + const SizedBox( + width: 10, + ), + Text('Update Pin', style: TextStyle(color: primaryColor)), ], ), - onTap: () { - /*Navigator.push( - context, - MaterialPageRoute(builder: (context) => Resources()), - );*/ - }, + onTap: () {}, ), Divider( color: Colors.grey, @@ -477,22 +436,20 @@ class _DashboardState extends State { title: Row( children: const [ Image( - image: const AssetImage('images/customercareblue.png'), + image: const AssetImage('images/01.png'), height: 25, width: 25, fit: BoxFit.fill), const SizedBox( width: 10, ), - Text('Accounts', style: TextStyle(color: primaryColor)), + const SizedBox( + width: 10, + ), + Text('Update Mobile Number', style: TextStyle(color: primaryColor)), ], ), - onTap: () { - /*Navigator.push( - context, - MaterialPageRoute(builder: (context) => UserAccounts()), - );*/ - }, + onTap: () {}, ), Divider( color: Colors.grey, @@ -501,15 +458,17 @@ class _DashboardState extends State { title: Row( children: const [ Image( - image: const AssetImage('images/customercareblue.png'), + image: const AssetImage('images/01.png'), height: 25, width: 25, fit: BoxFit.fill), const SizedBox( width: 10, ), - Text('Customer Support', - style: TextStyle(color: primaryColor)), + const SizedBox( + width: 10, + ), + Text('Update My Location', style: TextStyle(color: primaryColor)), ], ), onTap: () {}, @@ -521,58 +480,26 @@ class _DashboardState extends State { title: Row( children: const [ Image( - image: const AssetImage('images/logoutblue.png'), + image: const AssetImage('images/01.png'), height: 25, width: 25, fit: BoxFit.fill), const SizedBox( width: 10, ), + const SizedBox( + width: 10, + ), Text('Logout', style: TextStyle(color: primaryColor)), ], ), - onTap: () async { - showLogoutAlertDialog(context); - }, + onTap: () {}, ), + ], ), ), body: _dashBoard(), - /*body: IndexedStack( - index: _selectedIndex, - children: screens, - ),*/ - /* bottomNavigationBar: Container( - //height: MediaQuery.of(context).size.height, - child: BottomNavigationBar( - items: const [ - BottomNavigationBarItem( - icon: Icon( - Icons.home, - ), - label: 'Home', - ), - BottomNavigationBarItem( - icon: Icon(Icons.propane_tank), - label: 'Add Tanks', - ), - */ /*BottomNavigationBarItem( - icon: Icon(Icons.private_connectivity_outlined), - label: 'CreateConnections', - ),*/ /* - BottomNavigationBarItem( - icon: Icon(Icons.list_alt), - label: 'Add Tanker', - ), - ], - currentIndex: _selectedIndex, - selectedItemColor: primaryColor, - unselectedItemColor: greyColor, - showUnselectedLabels: true, - onTap: _onItemTapped, - ), - ),*/ ), ); } diff --git a/lib/emergency.dart b/lib/emergency.dart new file mode 100644 index 0000000..2f944ac --- /dev/null +++ b/lib/emergency.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; +import 'package:healthcare_user/settings.dart'; + +class Emergency extends StatefulWidget { + const Emergency({Key? key}) : super(key: key); + + @override + State createState() => _EmergencyState(); +} + +class _EmergencyState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Emergency'), + body: Container(), + ); + } +} diff --git a/lib/invitations.dart b/lib/invitations.dart new file mode 100644 index 0000000..936a0b7 --- /dev/null +++ b/lib/invitations.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; +import 'package:healthcare_user/settings.dart'; + +class Invitations extends StatefulWidget { + const Invitations({Key? key}) : super(key: key); + + @override + State createState() => _InvitationsState(); +} + +class _InvitationsState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Invitations'), + body: Container(), + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index c13a338..66bcfac 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,11 +1,12 @@ import 'package:flutter/material.dart'; +import 'package:healthcare_user/dashboard.dart'; import 'package:healthcare_user/splash_screen.dart'; import 'package:sizer/sizer.dart'; import 'package:flutter/services.dart'; void main () async { // Set default home. - Widget _defaultHome = Splash(); + Widget _defaultHome = Dashboard(); WidgetsFlutterBinding.ensureInitialized(); SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]) .then((_) { diff --git a/lib/medicines.dart b/lib/medicines.dart new file mode 100644 index 0000000..1b47663 --- /dev/null +++ b/lib/medicines.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; +import 'package:healthcare_user/settings.dart'; + +class Medicines extends StatefulWidget { + const Medicines({Key? key}) : super(key: key); + + @override + State createState() => _MedicinesState(); +} + +class _MedicinesState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Medicines'), + body: Container(), + ); + } +} diff --git a/lib/prescriptions.dart b/lib/prescriptions.dart new file mode 100644 index 0000000..0c1cc52 --- /dev/null +++ b/lib/prescriptions.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; +import 'package:healthcare_user/settings.dart'; + +class Prescriptions extends StatefulWidget { + const Prescriptions({Key? key}) : super(key: key); + + @override + State createState() => _PrescriptionsState(); +} + +class _PrescriptionsState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Prescriptions'), + body: Container(), + ); + } +} diff --git a/lib/reports.dart b/lib/reports.dart new file mode 100644 index 0000000..b59994d --- /dev/null +++ b/lib/reports.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; +import 'package:healthcare_user/settings.dart'; + +class Reports extends StatefulWidget { + const Reports({Key? key}) : super(key: key); + + @override + State createState() => _ReportsState(); +} + +class _ReportsState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Reports'), + body: Container(), + ); + } +} diff --git a/lib/seekopinion.dart b/lib/seekopinion.dart new file mode 100644 index 0000000..57a7ac7 --- /dev/null +++ b/lib/seekopinion.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; +import 'package:healthcare_user/settings.dart'; + +class SeekOpinion extends StatefulWidget { + const SeekOpinion({Key? key}) : super(key: key); + + @override + State createState() => _SeekOpinionState(); +} + +class _SeekOpinionState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Seek Opinion'), + body: Container(), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index ccc3789..cf67ec6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -43,6 +43,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.4" + carousel_slider: + dependency: "direct dev" + description: + name: carousel_slider + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.1" characters: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index ebd5493..5d3be5a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -59,6 +59,7 @@ dev_dependencies: location: ^4.4.0 permission_handler: ^10.2.0 cloudinary_public: ^0.21.0 + carousel_slider: ^4.2.1 flutter_icons: