import 'package:desa_wisata/data.dart'; import 'package:desa_wisata/signinsignup.dart'; import 'package:desa_wisata/signinsignup2.dart'; import 'package:desa_wisata/theme.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:shared_preferences/shared_preferences.dart'; class AkunUser3 extends StatefulWidget { const AkunUser3({Key? key}) : super(key: key); @override _AkunUser3State createState() => _AkunUser3State(); } class _AkunUser3State extends State { @override Widget build(BuildContext context) { return Scaffold( // key: scaffoldKey, backgroundColor: primaryBackground, appBar: AppBar( backgroundColor: Colors.white, automaticallyImplyLeading: false, title: Text( 'Profile', style: title1.copyWith( color: Colors.black ), ), actions: [], centerTitle: false, elevation: 0, ), body: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, children: [ Container( width: MediaQuery.of(context).size.width, decoration: BoxDecoration( color: Colors.white, boxShadow: [ BoxShadow( blurRadius: 1, color: primaryBackground, offset: Offset(0, 0), ) ], ), child: Padding( padding: EdgeInsetsDirectional.fromSTEB(24, 12, 24, 12), child: Row( mainAxisSize: MainAxisSize.max, children: [ Container( width: 80, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12), ), child:Container( width: 120, height: 120, clipBehavior: Clip.antiAlias, decoration: BoxDecoration( shape: BoxShape.circle, ), child: Image.asset( 'assets/image/profil-admin.jpg', ), ), ), Padding( padding: EdgeInsetsDirectional.fromSTEB(16, 0, 0, 0), child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsetsDirectional.fromSTEB(0, 8, 0, 0), child: Text( 'Hello Guest', style: GoogleFonts.montserrat( color: Color(0xFF090F13), fontSize: 20, fontWeight: FontWeight.bold, ), ), ), ], ), ), ], ), ), ), ], ), Column( mainAxisSize: MainAxisSize.max, children: [ Padding( padding: EdgeInsetsDirectional.fromSTEB(0, 20, 0, 20), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox( width: 80, height: 40, child: TextButton( onPressed: () { Navigator.pushNamed(context, '/signinsignup'); }, child: Text('Log In', style: bodyText2.copyWith( fontFamily: 'Lexend Deca', color: Colors.white, fontSize: 14, fontWeight: FontWeight.normal, ),), style: TextButton.styleFrom( backgroundColor: Colors.green, elevation: 1, side: BorderSide( color: Colors.transparent, width: 1, ), ), ), ), ], ), ), ], ), ], ), ); } String email = ""; logOut() async { SharedPreferences prefs = await SharedPreferences.getInstance(); setState(() { prefs.remove("isLoggedIn"); prefs.remove("loginRole"); prefs.remove("loginId"); prefs.remove("loginName"); prefs.remove("loginEmail"); prefs.remove("loginTelp"); }); Navigator.pushAndRemoveUntil( context, MaterialPageRoute( builder: (BuildContext context) => const SignInSignUp2(), ), (route) => false, ); ScaffoldMessenger.of(context).showSnackBar( const SnackBar( content: Text( "Berhasil logout", style: TextStyle(fontSize: 16), )), ); } @override dispose() { super.dispose(); } }