import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; import '/utils/storage/encryption_keys.dart'; import '/utils/storage/database.dart'; class Profile extends StatefulWidget { const Profile({Key? key}) : super(key: key); @override State createState() => _ProfileState(); } class _ProfileState extends State { @override Widget build(BuildContext context) { return Scaffold( body: SingleChildScrollView( physics: const BouncingScrollPhysics(), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SafeArea( child: Padding( padding: const EdgeInsets.only(left: 16,right: 16,top: 10), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ const Text("Profile",style: TextStyle(fontSize: 32,fontWeight: FontWeight.bold),), Container( padding: const EdgeInsets.only(left: 8,right: 8,top: 2,bottom: 2), height: 30, decoration: BoxDecoration( borderRadius: BorderRadius.circular(30), color: Colors.pink[50], ), child: GestureDetector( onTap: () async { deleteDb(); final preferences = await SharedPreferences.getInstance(); preferences.setBool('islogin', false); preferences.remove(rsaPrivateKeyName); Navigator.pushNamedAndRemoveUntil(context, '/landing', ModalRoute.withName('/landing')); }, child: Row( children: const [ Icon(Icons.logout, color: Colors.pink, size: 20,), SizedBox(width: 2,), Text("Logout",style: TextStyle(fontSize: 14,fontWeight: FontWeight.bold),), ], ), ), ) ], ), ), ), const Padding( padding: EdgeInsets.only(top: 16,left: 16,right: 16), child: Text('Test'), ), ], ), ), ); } }