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

  1. import 'package:flutter/material.dart';
  2. import 'package:shared_preferences/shared_preferences.dart';
  3. import '/utils/storage/encryption_keys.dart';
  4. class Profile extends StatefulWidget {
  5. const Profile({Key? key}) : super(key: key);
  6. @override
  7. State<Profile> createState() => _ProfileState();
  8. }
  9. class _ProfileState extends State<Profile> {
  10. @override
  11. Widget build(BuildContext context) {
  12. return Scaffold(
  13. body: SingleChildScrollView(
  14. physics: const BouncingScrollPhysics(),
  15. child: Column(
  16. crossAxisAlignment: CrossAxisAlignment.start,
  17. children: <Widget>[
  18. SafeArea(
  19. child: Padding(
  20. padding: const EdgeInsets.only(left: 16,right: 16,top: 10),
  21. child: Row(
  22. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  23. children: <Widget>[
  24. const Text("Profile",style: TextStyle(fontSize: 32,fontWeight: FontWeight.bold),),
  25. Container(
  26. padding: const EdgeInsets.only(left: 8,right: 8,top: 2,bottom: 2),
  27. height: 30,
  28. decoration: BoxDecoration(
  29. borderRadius: BorderRadius.circular(30),
  30. color: Colors.pink[50],
  31. ),
  32. child: GestureDetector(
  33. onTap: () async {
  34. final preferences = await SharedPreferences.getInstance();
  35. preferences.setBool('islogin', false);
  36. preferences.remove(rsaPrivateKeyName);
  37. Navigator.pushNamedAndRemoveUntil(context, '/landing', ModalRoute.withName('/landing'));
  38. },
  39. child: Row(
  40. children: const <Widget>[
  41. Icon(Icons.logout, color: Colors.pink, size: 20,),
  42. SizedBox(width: 2,),
  43. Text("Logout",style: TextStyle(fontSize: 14,fontWeight: FontWeight.bold),),
  44. ],
  45. ),
  46. ),
  47. )
  48. ],
  49. ),
  50. ),
  51. ),
  52. const Padding(
  53. padding: EdgeInsets.only(top: 16,left: 16,right: 16),
  54. child: Text('Test'),
  55. ),
  56. ],
  57. ),
  58. ),
  59. );
  60. }
  61. }