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,7 +46,11 @@ class _DemoUserState extends State<DemoUser> { ...@@ -38,7 +46,11 @@ 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,
children: [
Center(child: Text('Welcome, $mail',style: GoogleFonts.poppins(fontSize: 25),),),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Box( Box(
...@@ -104,6 +116,8 @@ class _DemoUserState extends State<DemoUser> { ...@@ -104,6 +116,8 @@ class _DemoUserState extends State<DemoUser> {
], ],
), ),
],
),
), ),
); );
} }
......
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