Encrypted messaging app
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
4.3 KiB

import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '/utils/storage/encryption_keys.dart';
class Profile extends StatefulWidget {
const Profile({Key? key}) : super(key: key);
@override
State<Profile> createState() => _ProfileState();
}
class _ProfileState extends State<Profile> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SafeArea(
child: Padding(
padding: const EdgeInsets.only(left: 16,right: 16,top: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
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 {
final preferences = await SharedPreferences.getInstance();
preferences.setBool('islogin', false);
preferences.remove(rsaPrivateKeyName);
Navigator.pushNamedAndRemoveUntil(context, '/landing', ModalRoute.withName('/landing'));
},
child: Row(
children: const <Widget>[
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'),
),
],
),
),
);
}
}