diff --git a/assets/images/avatar_full.png b/assets/images/avatar_full.png new file mode 100644 index 0000000..5fb0fdd Binary files /dev/null and b/assets/images/avatar_full.png differ diff --git a/lib/main.dart b/lib/main.dart index 65208db..6e7f0a9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -4,6 +4,7 @@ import 'package:drifter/pages/create_account_screen/create_account_screen.dart'; import 'package:drifter/pages/home_screen/home_screen_widget.dart'; import 'package:drifter/pages/login_screen/login_screen.dart'; import 'package:drifter/pages/main_screen/main_screen_widget.dart'; +import 'package:drifter/pages/profile_screen/edit_profile_screen.dart'; import 'package:drifter/pages/qr_code_screen/qr_code_screen.dart'; import 'package:drifter/pages/settings_screen/settings_screen.dart'; import 'package:drifter/pages/splash_screen/splash_screen.dart'; @@ -13,6 +14,8 @@ import 'package:drifter/theme/app_colors.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'pages/profile_screen/view_profile_photo_screen/view_profile_photo_screen.dart'; + void main() { runApp(const MyApp()); } @@ -44,6 +47,8 @@ class MyApp extends StatelessWidget { '/MainScreen': (context) => const MainScreenWidget(), '/Settings': (context) => const SettingsScreen(), '/QrCodeScreen': (context) => const QrCodeScreen(), + '/EditProfileScreen': (context) => const EditProfileScreen(), + '/ViewProfilePhotoScreen': (context) => const ViewProfilePhotoScreen(), }, ); } diff --git a/lib/pages/profile_screen/edit_profile_screen.dart b/lib/pages/profile_screen/edit_profile_screen.dart new file mode 100644 index 0000000..7a6fa34 --- /dev/null +++ b/lib/pages/profile_screen/edit_profile_screen.dart @@ -0,0 +1,333 @@ +import 'package:dart_nostr/dart_nostr.dart'; +import 'package:drifter/models/models.dart'; +import 'package:drifter/pages/profile_screen/widgets/delete_keys_dialog.dart'; +import 'package:drifter/main.dart'; +import 'package:drifter/pages/profile_screen/widgets/key_exist_dialog.dart'; +import 'package:drifter/pages/profile_screen/widgets/keys_option_modal_bottom_sheet.dart'; +import 'package:drifter/pages/profile_screen/widgets/message_snack_bar.dart'; +import 'package:drifter/pages/profile_screen/widgets/user_info_widget.dart'; +import 'package:drifter/theme/app_colors.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_secure_storage/flutter_secure_storage.dart'; + +class EditProfileScreen extends StatefulWidget { + const EditProfileScreen({super.key}); + + @override + State createState() => EditProfileScreenState(); +} + +class EditProfileScreenState extends State { + final secureStorage = const FlutterSecureStorage(); + bool _toHex = false; + + TextEditingController privateKeyInput = TextEditingController(); + TextEditingController publicKeyInput = TextEditingController(); + + // final keyGenerator = KeyApi(); + // final nip19 = Nip19(); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackground, + appBar: AppBar( + actions: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + height: 40, + width: 82, + child: ElevatedButton( + style: ButtonStyle( + shape: MaterialStateProperty.all(RoundedRectangleBorder( + borderRadius: BorderRadius.circular(100))), + backgroundColor: + MaterialStateProperty.all(AppColors.buttonPrimaryDefaultBg), + ), + onPressed: () {}, + child: Text('Save'), + ), + ) + ], + leading: IconButton( + icon: Icon( + Icons.arrow_back, + color: AppColors.topNavIconPtimary, + ), + onPressed: () => Navigator.of(context).pop(), + ), + title: Text( + ('Edit profile'), + style: TextStyle( + color: AppColors.topNavText, + ), + // textAlign: TextAlign.center, + ), + backgroundColor: AppColors.mainBackground, + elevation: 0, + ), + body: ListView( + children: [ + Stack( + children: [ + Container( + width: double.infinity, + height: 70, + child: FittedBox( + child: Image.asset('assets/images/banner.png'), + fit: BoxFit.fill, + ), + ), + Row( + children: [ + Padding( + padding: + const EdgeInsets.only(top: 30, left: 16, right: 58), + child: ClipRRect( + borderRadius: BorderRadius.circular(200), + child: InkWell( + onTap: () { + Navigator.pushNamed( + context, '/ViewProfilePhotoScreen'); + }, + child: Container( + width: 80, + height: 80, + decoration: BoxDecoration( + border: Border.all( + width: 2, color: Color(0xFFF2EFFF))), + child: Image.asset('assets/images/avatar.png')), + ), + ), + ), + ], + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'User info', + style: TextStyle( + color: AppColors.label, fontWeight: FontWeight.w500), + ), + SizedBox( + height: 8, + ), + TextField( + decoration: InputDecoration( + filled: true, + fillColor: AppColors.textFieldDefaultBg, + labelText: 'Username', + labelStyle: + TextStyle(color: AppColors.textFieldDefaultText), + prefixIcon: const Icon(Icons.alternate_email), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide( + width: 0, + style: BorderStyle.none, + ), + ), + iconColor: AppColors.textFieldDefaultIconTrail), + controller: userNameController, + ), + const SizedBox(height: 8), + TextField( + decoration: InputDecoration( + filled: true, + fillColor: AppColors.textFieldDefaultBg, + labelText: 'Name', + labelStyle: + TextStyle(color: AppColors.textFieldDefaultText), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide( + width: 0, + style: BorderStyle.none, + ), + ), + iconColor: AppColors.textFieldDefaultIconTrail), + controller: nameController, + ), + const SizedBox(height: 8), + SizedBox( + height: 112, + child: TextField( + minLines: 3, + maxLines: 5, + decoration: InputDecoration( + filled: true, + fillColor: AppColors.textFieldDefaultBg, + labelText: 'Description', + alignLabelWithHint: true, + labelStyle: + TextStyle(color: AppColors.textFieldDefaultText), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide( + width: 0, + style: BorderStyle.none, + ), + ), + iconColor: AppColors.textFieldDefaultIconTrail), + controller: descriptionController, + ), + ), + const SizedBox(height: 8), + TextField( + decoration: InputDecoration( + filled: true, + fillColor: AppColors.textFieldDefaultBg, + labelText: 'Website URL', + labelStyle: + TextStyle(color: AppColors.textFieldDefaultText), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide( + width: 0, + style: BorderStyle.none, + ), + ), + iconColor: AppColors.textFieldDefaultIconTrail), + controller: nameController, + ), + ], + ), + ) + ], + ), + ); + + // return ListView( + // children: [ + // const SizedBox( + // height: 60, + // ), + // const UserInfo(), + // const SizedBox( + // height: 40, + // ), + // FormKeys(), + // const SizedBox(height: 20), + // Padding( + // padding: const EdgeInsets.all(16.0), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Keys.keysExist + // ? IconButton( + // onPressed: () { + // setState(() { + // _toHex = !_toHex; + // }); + // }, + // icon: const Icon(Icons.refresh)) + // // ElevatedButton( + // // style: ButtonStyle( + // // backgroundColor: + // // MaterialStateProperty.all(AppColors.background)), + // // onPressed: () { + // // keysExistDialog( + // // Nostr.instance.keysService + // // .encodePublicKeyToNpub(Keys.publicKey), + // // Nostr.instance.keysService + // // .encodePrivateKeyToNsec(Keys.privateKey), + // // ); + // // }, + // // child: const Text( + // // 'Keys', + // // ), + // // ) + // : Row( + // children: [ + // ElevatedButton( + // style: ButtonStyle( + // backgroundColor: MaterialStateProperty.all( + // AppColors.background)), + // onPressed: () { + // modalBottomSheet(); + // }, + // child: const Text( + // 'Generate Keys', + // ), + // ), + // SizedBox(width: 100), + // ElevatedButton( + // style: ButtonStyle( + // backgroundColor: MaterialStateProperty.all( + // AppColors.background)), + // onPressed: () { + // Navigator.pushNamed(context, '/login').then((_) { + // initState(); + // }); + // }, + // child: const Text( + // 'Login', + // ), + // ), + // ], + // ), + // Keys.keysExist + // ? Row( + // children: [ + // IconButton( + // onPressed: () { + // deleteKeysDialog(); + // }, + // icon: const Icon(Icons.delete)), + // ], + // ) + // : Container(), + // ], + // ), + // ) + // ], + // ); + } + + Form FormKeys() { + return Form( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + children: [ + TextFormField( + controller: privateKeyInput, + // _toHex ? widget.hexPriv : widget.nsecEncoded, + + decoration: const InputDecoration( + labelText: 'Private Key', + border: OutlineInputBorder(), + ), + maxLength: 64, + ), + const SizedBox( + height: 20, + ), + TextFormField( + controller: publicKeyInput, + // _toHex ? widget.hexPub : widget.npubEncoded, + decoration: const InputDecoration( + labelText: 'Public Key', + border: OutlineInputBorder(), + ), + ), + const SizedBox( + height: 40, + ), + TextFormField( + decoration: const InputDecoration( + labelText: 'Relay', + border: OutlineInputBorder(), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/profile_screen/profile_screen.dart b/lib/pages/profile_screen/profile_screen.dart index 330e025..992be47 100644 --- a/lib/pages/profile_screen/profile_screen.dart +++ b/lib/pages/profile_screen/profile_screen.dart @@ -9,6 +9,7 @@ import 'package:drifter/pages/profile_screen/widgets/user_info_widget.dart'; import 'package:drifter/theme/app_colors.dart'; import 'package:flutter/material.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; +import 'package:toggle_switch/toggle_switch.dart'; class ProfileScreen extends StatefulWidget { const ProfileScreen({super.key}); @@ -134,302 +135,390 @@ class ProfileScreenState extends State { Widget build(BuildContext context) { publicKeyInput.text = Keys.npubKey; - return Container( - color: AppColors.profileWrapperBg, - child: Column( - children: [ - Stack( + return ListView( + children: [ + Container( + color: AppColors.profileWrapperBg, + child: Column( children: [ - Container( - width: double.infinity, - height: 70, - child: FittedBox( - child: Image.asset('assets/images/banner.png'), - fit: BoxFit.fill, - ), - ), - Row( + Stack( children: [ - Padding( - padding: - const EdgeInsets.only(top: 30, left: 16, right: 58), - child: ClipRRect( - borderRadius: BorderRadius.circular(200), - child: Container( - width: 80, - height: 80, - decoration: BoxDecoration( - border: Border.all( - width: 2, color: Color(0xFFF2EFFF))), - child: Image.asset('assets/images/avatar.png')), + Container( + width: double.infinity, + height: 70, + child: FittedBox( + child: Image.asset('assets/images/banner.png'), + fit: BoxFit.fill, ), ), - Expanded( - child: Container( - margin: EdgeInsets.only(top: 74, right: 16), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - SizedBox( - width: 32, - height: 32, - child: FloatingActionButton( - backgroundColor: - AppColors.buttonSecondaryDefaultBg, - onPressed: () {}, - elevation: 0, - child: Icon( - Icons.edit, - size: 18, - color: AppColors.buttonSecondaryIcon, - ), - ), - ), - SizedBox( - width: 8, - ), - SizedBox( - width: 32, - height: 32, - child: FloatingActionButton( - backgroundColor: - AppColors.buttonSecondaryDefaultBg, - onPressed: () { - Navigator.pushNamed(context, '/QrCodeScreen'); - }, - elevation: 0, - child: Icon( - Icons.qr_code, - size: 18, - color: AppColors.buttonSecondaryIcon, - ), - ), - ), - SizedBox( - width: 8, - ), - SizedBox( - width: 32, - height: 32, - child: FloatingActionButton( - backgroundColor: - AppColors.buttonSecondaryDefaultBg, - onPressed: () {}, - elevation: 0, - child: Icon( - Icons.mail_outlined, - size: 18, - color: AppColors.buttonSecondaryIcon, - ), - ), - ), - SizedBox( - width: 8, - ), - SizedBox( - width: 100, - height: 32, - child: ElevatedButton( - onPressed: () {}, - child: Text( - 'Follow', - style: TextStyle( - color: - AppColors.buttonPrimaryDefaultText), - ), - style: ElevatedButton.styleFrom( - backgroundColor: - AppColors.buttonPrimaryDefaultBg, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(100)))), - ) - ], + Row( + children: [ + Padding( + padding: + const EdgeInsets.only(top: 30, left: 16, right: 58), + child: ClipRRect( + borderRadius: BorderRadius.circular(200), + child: Container( + width: 80, + height: 80, + decoration: BoxDecoration( + border: Border.all( + width: 2, color: Color(0xFFF2EFFF))), + child: Image.asset('assets/images/avatar.png')), + ), ), - ), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 74, right: 16), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SizedBox( + width: 32, + height: 32, + child: FloatingActionButton( + backgroundColor: + AppColors.buttonSecondaryDefaultBg, + onPressed: () { + Navigator.pushNamed( + context, '/EditProfileScreen'); + }, + elevation: 0, + child: Icon( + Icons.edit, + size: 18, + color: AppColors.buttonSecondaryIcon, + ), + ), + ), + SizedBox( + width: 8, + ), + SizedBox( + width: 32, + height: 32, + child: FloatingActionButton( + backgroundColor: + AppColors.buttonSecondaryDefaultBg, + onPressed: () { + Navigator.pushNamed( + context, '/QrCodeScreen'); + }, + elevation: 0, + child: Icon( + Icons.qr_code, + size: 18, + color: AppColors.buttonSecondaryIcon, + ), + ), + ), + SizedBox( + width: 8, + ), + SizedBox( + width: 32, + height: 32, + child: FloatingActionButton( + backgroundColor: + AppColors.buttonSecondaryDefaultBg, + onPressed: () {}, + elevation: 0, + child: Icon( + Icons.mail_outlined, + size: 18, + color: AppColors.buttonSecondaryIcon, + ), + ), + ), + SizedBox( + width: 8, + ), + SizedBox( + width: 100, + height: 32, + child: ElevatedButton( + onPressed: () {}, + child: Text( + 'Follow', + style: TextStyle( + color: AppColors + .buttonPrimaryDefaultText), + ), + style: ElevatedButton.styleFrom( + backgroundColor: + AppColors.buttonPrimaryDefaultBg, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(100)))), + ) + ], + ), + ), + ) + ], ) ], - ) + ), + Container( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Cameron Williamson', + style: TextStyle( + color: AppColors.profileFullName, + fontWeight: FontWeight.w600), + ), + SizedBox( + height: 5, + ), + Text('@cameron', + style: TextStyle( + color: AppColors.profileUserName, + )), + SizedBox( + height: 5, + ), + Text( + 'This is the description of my profile. I am a nostrich and I love cats. Follow me for fun pictures and bad jokes. I also want to be a politician.', + style: TextStyle( + color: AppColors.profileSummary, + )), + SizedBox( + height: 12, + ), + Container( + child: TextField( + style: TextStyle(color: AppColors.profileKeyText), + readOnly: true, + decoration: InputDecoration( + suffixIcon: Row( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + icon: Icon(Icons.copy), + color: AppColors.buttonSecondaryIcon, + onPressed: () {}, + ), + IconButton( + icon: Icon(Icons.qr_code), + color: AppColors.buttonSecondaryIcon, + onPressed: () {}, + ), + ], + ), + filled: true, + fillColor: AppColors.profileKeyField, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + borderSide: BorderSide( + width: 0, style: BorderStyle.none), + )), + minLines: 2, + maxLines: 2, + controller: publicKeyInput, + ), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 13), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + child: TextButton.icon( + style: TextButton.styleFrom( + padding: EdgeInsets.zero, + tapTargetSize: + MaterialTapTargetSize.shrinkWrap, + ), + // <-- TextButton + onPressed: () {}, + icon: Icon( + Icons.check_circle, + size: 15.0, + color: AppColors.profileSocialIcons, + ), + label: Text( + 'nip-05-name', + style: TextStyle( + color: AppColors.profileSocialLinks, + fontWeight: FontWeight.w500), + ), + ), + ), + SizedBox( + height: 6, + ), + SizedBox( + height: 16, + child: TextButton.icon( + style: TextButton.styleFrom( + padding: EdgeInsets.zero, + tapTargetSize: + MaterialTapTargetSize.shrinkWrap, + ), + // <-- TextButton + onPressed: () {}, + icon: Icon( + Icons.check_circle, + size: 15.0, + color: AppColors.profileSocialIcons, + ), + label: Text( + 'www.cameronforpresident.com', + style: TextStyle( + color: AppColors.profileSocialLinks, + fontWeight: FontWeight.w500), + ), + ), + ), + SizedBox( + height: 6, + ), + SizedBox( + height: 16, + child: TextButton.icon( + style: TextButton.styleFrom( + padding: EdgeInsets.zero, + tapTargetSize: + MaterialTapTargetSize.shrinkWrap, + ), + // <-- TextButton + onPressed: () {}, + icon: Icon( + Icons.score, + size: 15.0, + color: AppColors.profileSocialIcons, + ), + label: Text( + '@cameron_official', + style: TextStyle( + color: AppColors.profileSocialLinks, + fontWeight: FontWeight.w500), + ), + ), + ), + SizedBox( + height: 6, + ), + SizedBox( + height: 16, + child: TextButton.icon( + style: TextButton.styleFrom( + padding: EdgeInsets.zero, + tapTargetSize: + MaterialTapTargetSize.shrinkWrap, + ), + // <-- TextButton + onPressed: () {}, + icon: Icon( + Icons.check_circle, + size: 15.0, + color: AppColors.profileSocialIcons, + ), + label: Text( + 'cameron.williamson.com/@cameron_official', + style: TextStyle( + color: AppColors.profileSocialLinks, + fontWeight: FontWeight.w500), + ), + ), + ), + SizedBox( + height: 6, + ), + SizedBox( + height: 16, + child: TextButton.icon( + style: TextButton.styleFrom( + padding: EdgeInsets.zero, + tapTargetSize: + MaterialTapTargetSize.shrinkWrap, + ), + // <-- TextButton + onPressed: () {}, + icon: Icon( + Icons.flash_on, + size: 15.0, + color: AppColors.profileSocialIcons, + ), + label: Text( + 'whoknowswhatgoeshere', + style: TextStyle( + color: AppColors.profileSocialLinks, + fontWeight: FontWeight.w500), + ), + ), + ), + SizedBox( + height: 6, + ), + SizedBox( + height: 16, + child: TextButton.icon( + style: TextButton.styleFrom( + padding: EdgeInsets.zero, + tapTargetSize: + MaterialTapTargetSize.shrinkWrap, + ), + // <-- TextButton + onPressed: () {}, + icon: Icon( + Icons.flash_on, + size: 15.0, + color: AppColors.profileSocialIcons, + ), + label: Text( + 'cameron@satoshiwallet.com', + style: TextStyle( + color: AppColors.profileSocialLinks, + fontWeight: FontWeight.w500), + ), + ), + ), + ]), + ), + Container( + child: ProfileStats(), + ), + ]), + ), + ), ], ), - Container( - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Cameron Williamson', - style: TextStyle( - color: AppColors.profileFullName, - fontWeight: FontWeight.w600), - ), - SizedBox( - height: 5, - ), - Text('@cameron', - style: TextStyle( - color: AppColors.profileUserName, - )), - SizedBox( - height: 5, - ), - Text( - 'This is the description of my profile. I am a nostrich and I love cats. Follow me for fun pictures and bad jokes. I also want to be a politician.', - style: TextStyle( - color: AppColors.profileSummary, - )), - SizedBox( - height: 12, - ), - Container( - child: TextField( - style: TextStyle(color: AppColors.profileKeyText), - readOnly: true, - decoration: InputDecoration( - suffixIcon: Row( - mainAxisSize: MainAxisSize.min, - children: [ - IconButton( - icon: Icon(Icons.copy), - color: AppColors.buttonSecondaryIcon, - onPressed: () {}, - ), - IconButton( - icon: Icon(Icons.qr_code), - color: AppColors.buttonSecondaryIcon, - onPressed: () {}, - ), - ], - ), - filled: true, - fillColor: AppColors.profileKeyField, - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: - BorderSide(width: 0, style: BorderStyle.none), - )), - minLines: 2, - maxLines: 2, - controller: publicKeyInput, - ), - ), - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - TextButton.icon( - // <-- TextButton - onPressed: () {}, - icon: Icon( - Icons.check_circle, - size: 15.0, - color: AppColors.profileSocialIcons, - ), - label: Text( - 'nip-05-name', - style: TextStyle( - color: AppColors.profileSocialLinks, - fontWeight: FontWeight.w500), - ), - ), - SizedBox( - height: 6, - ), - TextButton.icon( - // <-- TextButton - onPressed: () {}, - icon: Icon( - Icons.check_circle, - size: 15.0, - color: AppColors.profileSocialIcons, - ), - label: Text( - 'www.cameronforpresident.com', - style: TextStyle( - color: AppColors.profileSocialLinks, - fontWeight: FontWeight.w500), - ), - ), - SizedBox( - height: 6, - ), - TextButton.icon( - // <-- TextButton - onPressed: () {}, - icon: Icon( - Icons.score, - size: 15.0, - color: AppColors.profileSocialIcons, - ), - label: Text( - '@cameron_official', - style: TextStyle( - color: AppColors.profileSocialLinks, - fontWeight: FontWeight.w500), - ), - ), - SizedBox( - height: 6, - ), - TextButton.icon( - // <-- TextButton - onPressed: () {}, - icon: Icon( - Icons.check_circle, - size: 15.0, - color: AppColors.profileSocialIcons, - ), - label: Text( - 'cameron.williamson.com/@cameron_official', - style: TextStyle( - color: AppColors.profileSocialLinks, - fontWeight: FontWeight.w500), - ), - ), - SizedBox( - height: 6, - ), - TextButton.icon( - // <-- TextButton - onPressed: () {}, - icon: Icon( - Icons.flash_on, - size: 15.0, - color: AppColors.profileSocialIcons, - ), - label: Text( - 'whoknowswhatgoeshere', - style: TextStyle( - color: AppColors.profileSocialLinks, - fontWeight: FontWeight.w500), - ), - ), - SizedBox( - height: 6, - ), - TextButton.icon( - // <-- TextButton - onPressed: () {}, - icon: Icon( - Icons.flash_on, - size: 15.0, - color: AppColors.profileSocialIcons, - ), - label: Text( - 'cameron@satoshiwallet.com', - style: TextStyle( - color: AppColors.profileSocialLinks, - fontWeight: FontWeight.w500), - ), - ), - ]), - ) - ]), - ), + ), + Padding( + padding: const EdgeInsets.only(top: 8, bottom: 4, right: 4, left: 4), + child: ToggleSwitch( + customWidths: [133, 133, 133], + // minWidth: double.infinity, + minHeight: 48, + totalSwitches: 3, + labels: ['Posts', 'Posts & Replies', 'Bookmarks'], + activeBgColor: [AppColors.toggleSwitchActiveBg], + activeFgColor: AppColors.toggleSwitchTextActive, + inactiveBgColor: AppColors.toggleSwitchBg, + inactiveFgColor: AppColors.toggleSwitchTextInactive, + activeBorders: [ + Border.all( + color: AppColors.toggleSwitchBg, + width: 4, + ), + ], + radiusStyle: true, + cornerRadius: 8, + customTextStyles: [ + TextStyle(fontSize: 12, fontWeight: FontWeight.w600) + ], + onToggle: (indexToggle) { + print(indexToggle); + }, ), - ], - ), + ), + ], ); // return ListView( // children: [ @@ -622,3 +711,35 @@ class ProfileScreenState extends State { ); } } + +class ProfileStats extends StatelessWidget { + const ProfileStats({ + super.key, + }); + + final following = '3,789'; + final followers = '2,554'; + final zaps = '1,878'; + final relays = '6'; + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + SizedBox( + child: Text('${following} Following'), + ), + SizedBox( + child: Text('${followers} Followers'), + ), + SizedBox( + child: Text('${zaps} Zaps'), + ), + SizedBox( + child: Text('${relays} Relays'), + ), + ], + ); + } +} diff --git a/lib/pages/profile_screen/view_profile_photo_screen/view_profile_photo_screen.dart b/lib/pages/profile_screen/view_profile_photo_screen/view_profile_photo_screen.dart new file mode 100644 index 0000000..0dcefc4 --- /dev/null +++ b/lib/pages/profile_screen/view_profile_photo_screen/view_profile_photo_screen.dart @@ -0,0 +1,74 @@ +import 'package:drifter/theme/app_colors.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/src/widgets/framework.dart'; +import 'package:flutter/src/widgets/placeholder.dart'; + +class ViewProfilePhotoScreen extends StatefulWidget { + const ViewProfilePhotoScreen({super.key}); + + @override + State createState() => _ViewProfilePhotoScreenState(); +} + +class _ViewProfilePhotoScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackground, + appBar: AppBar( + leading: IconButton( + icon: Icon( + Icons.arrow_back, + color: AppColors.topNavIconPtimary, + ), + onPressed: () => Navigator.of(context).pop(), + ), + title: Text( + ('View profile photo'), + style: TextStyle( + color: AppColors.topNavText, + ), + // textAlign: TextAlign.center, + ), + centerTitle: true, + backgroundColor: AppColors.mainBackground, + elevation: 0, + ), + body: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded(child: SizedBox()), + Container( + width: double.infinity, + child: FittedBox( + child: Image.asset('assets/images/avatar_full.png'), + fit: BoxFit.fill, + ), + ), + Expanded(child: SizedBox()), + Padding( + padding: const EdgeInsets.all(16.0), + child: SizedBox( + width: double.infinity, + height: 56, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(100)), + backgroundColor: AppColors.buttonSecondaryDefaultBg), + onPressed: () {}, + child: Text( + 'Edit profile photo', + style: TextStyle( + color: AppColors.buttonSecondaryText, + fontWeight: FontWeight.w600), + ), + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/qr_code_screen/qr_code_screen.dart b/lib/pages/qr_code_screen/qr_code_screen.dart index 06525c2..d729b70 100644 --- a/lib/pages/qr_code_screen/qr_code_screen.dart +++ b/lib/pages/qr_code_screen/qr_code_screen.dart @@ -71,7 +71,7 @@ class _QrCodeScreenState extends State { ), ), Text( - 'Cameron Williams on', + 'Cameron Williamson', style: TextStyle( color: Color(0xFF302F38), fontWeight: FontWeight.w600, diff --git a/lib/theme/app_colors.dart b/lib/theme/app_colors.dart index aa09de9..0100611 100644 --- a/lib/theme/app_colors.dart +++ b/lib/theme/app_colors.dart @@ -5,6 +5,8 @@ abstract class AppColors { static const mainAccent = Color(0xFFFFCC11); static const mainBackground = Color(0xFFF2EFFF); + static const label = Color(0xFF7F71C8); + // Button static const buttonPrimaryDefaultBg = Color(0xFF4F46F1); static const buttonPrimaryDefaultText = Color(0xFFFFFFFF);