Commit 3f11b019 authored by Budi Prasetyo's avatar Budi Prasetyo

demo user + logout firebase

parent dfc1191d
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:medapp_eksad/firebase/firebase_auth_methods.dart';
import 'package:medapp_eksad/widget/button_appbar.dart'; import 'package:medapp_eksad/widget/button_appbar.dart';
import 'package:medapp_eksad/register.dart'; import 'package:medapp_eksad/register.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:medapp_eksad/firebase/firebase_auth_methods.dart';
AppBar AppbarHomeLarge(Size screenSize, BuildContext context, Color home, AppBar AppbarHomeLarge(Size screenSize, BuildContext context, Color home,
......
...@@ -6,6 +6,8 @@ import 'package:medapp_eksad/dashboard/admin/admin_setting.dart'; ...@@ -6,6 +6,8 @@ import 'package:medapp_eksad/dashboard/admin/admin_setting.dart';
import 'package:medapp_eksad/dashboard/admin/admin_sosmed.dart'; import 'package:medapp_eksad/dashboard/admin/admin_sosmed.dart';
import 'package:medapp_eksad/dashboard/admin/admin_userControl.dart'; import 'package:medapp_eksad/dashboard/admin/admin_userControl.dart';
import 'package:medapp_eksad/dashboard/admin/admin_whatsapp.dart'; import 'package:medapp_eksad/dashboard/admin/admin_whatsapp.dart';
import 'package:provider/provider.dart';
import 'package:medapp_eksad/firebase/firebase_auth_methods.dart';
class DashboardAdmin extends StatefulWidget { class DashboardAdmin extends StatefulWidget {
const DashboardAdmin({Key? key}) : super(key: key); const DashboardAdmin({Key? key}) : super(key: key);
......
...@@ -6,6 +6,8 @@ import '../appbar/appbar_home.dart'; ...@@ -6,6 +6,8 @@ import '../appbar/appbar_home.dart';
import '../widget/drawer.dart'; import '../widget/drawer.dart';
import '../widget/responsive.dart'; import '../widget/responsive.dart';
import '../widget/whatsapp.dart'; import '../widget/whatsapp.dart';
import 'package:provider/provider.dart';
import 'package:medapp_eksad/firebase/firebase_auth_methods.dart';
void setPageTitle(String title, BuildContext context) { void setPageTitle(String title, BuildContext context) {
SystemChrome.setApplicationSwitcherDescription(ApplicationSwitcherDescription( SystemChrome.setApplicationSwitcherDescription(ApplicationSwitcherDescription(
...@@ -22,11 +24,17 @@ class DemoUser extends StatefulWidget { ...@@ -22,11 +24,17 @@ class DemoUser extends StatefulWidget {
} }
class _DemoUserState extends State<DemoUser> { class _DemoUserState extends State<DemoUser> {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setPageTitle('Free Demo Medapp', context); setPageTitle('Free Demo Medapp', context);
var screenSize = MediaQuery.of(context).size; var screenSize = MediaQuery.of(context).size;
final user = context.read<FirebaseAuthMethods>().user;
final String mail = user.email!;
return Scaffold( return Scaffold(
key: _scaffoldKey, key: _scaffoldKey,
floatingActionButton: WAChat(), floatingActionButton: WAChat(),
...@@ -38,70 +46,76 @@ class _DemoUserState extends State<DemoUser> { ...@@ -38,70 +46,76 @@ class _DemoUserState extends State<DemoUser> {
body: Container( body: Container(
width: screenSize.width, width: screenSize.width,
height: screenSize.height, height: screenSize.height,
child: Row( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Box( Center(child: Text('Welcome, $mail',style: GoogleFonts.poppins(fontSize: 25),),),
wijet: ElevatedButton.icon( Row(
onPressed: () {}, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
icon: Icon( children: [
Icons.download, Box(
size: 40, wijet: ElevatedButton.icon(
onPressed: () {},
icon: Icon(
Icons.download,
size: 40,
),
label: Text(
'Download APK',
style: GoogleFonts.poppins(
fontSize: 20, fontWeight: FontWeight.w600),
textAlign: TextAlign.center,
),
),
), ),
label: Text( Box(
'Download APK', wijet: ElevatedButton.icon(
style: GoogleFonts.poppins( onPressed: () {},
fontSize: 20, fontWeight: FontWeight.w600), icon: Icon(
textAlign: TextAlign.center, Icons.tv,
size: 40,
),
label: Text(
'TV Display',
style: GoogleFonts.poppins(
fontSize: 20, fontWeight: FontWeight.w600),
textAlign: TextAlign.center,
),
),
), ),
), Box(
), wijet: ElevatedButton.icon(
Box( onPressed: () {},
wijet: ElevatedButton.icon( icon: Icon(
onPressed: () {}, Icons.phone_android,
icon: Icon( size: 40,
Icons.tv, ),
size: 40, label: Text(
), 'Kiosk',
label: Text( style: GoogleFonts.poppins(
'TV Display', fontSize: 20, fontWeight: FontWeight.w600),
style: GoogleFonts.poppins( textAlign: TextAlign.center,
fontSize: 20, fontWeight: FontWeight.w600), ),
textAlign: TextAlign.center, ),
), ),
), Box(
), wijet: ElevatedButton.icon(
Box( onPressed: () {},
wijet: ElevatedButton.icon( icon: Icon(
onPressed: () {}, Icons.browser_updated,
icon: Icon( size: 40,
Icons.phone_android, ),
size: 40, label: Text(
'Web Admin',
style: GoogleFonts.poppins(
fontSize: 20, fontWeight: FontWeight.w600),
textAlign: TextAlign.center,
),
),
), ),
label: Text(
'Kiosk',
style: GoogleFonts.poppins(
fontSize: 20, fontWeight: FontWeight.w600),
textAlign: TextAlign.center,
),
),
),
Box(
wijet: ElevatedButton.icon(
onPressed: () {},
icon: Icon(
Icons.browser_updated,
size: 40,
),
label: Text(
'Web Admin',
style: GoogleFonts.poppins(
fontSize: 20, fontWeight: FontWeight.w600),
textAlign: TextAlign.center,
),
),
),
],
),
], ],
), ),
), ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment