Changes to the profile screen

This commit is contained in:
Alex Vasilev 2023-06-14 23:23:06 +03:00
parent c7d0a114e0
commit 83dbae8295
7 changed files with 822 additions and 287 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

View File

@ -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/home_screen/home_screen_widget.dart';
import 'package:drifter/pages/login_screen/login_screen.dart'; import 'package:drifter/pages/login_screen/login_screen.dart';
import 'package:drifter/pages/main_screen/main_screen_widget.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/qr_code_screen/qr_code_screen.dart';
import 'package:drifter/pages/settings_screen/settings_screen.dart'; import 'package:drifter/pages/settings_screen/settings_screen.dart';
import 'package:drifter/pages/splash_screen/splash_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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'pages/profile_screen/view_profile_photo_screen/view_profile_photo_screen.dart';
void main() { void main() {
runApp(const MyApp()); runApp(const MyApp());
} }
@ -44,6 +47,8 @@ class MyApp extends StatelessWidget {
'/MainScreen': (context) => const MainScreenWidget(), '/MainScreen': (context) => const MainScreenWidget(),
'/Settings': (context) => const SettingsScreen(), '/Settings': (context) => const SettingsScreen(),
'/QrCodeScreen': (context) => const QrCodeScreen(), '/QrCodeScreen': (context) => const QrCodeScreen(),
'/EditProfileScreen': (context) => const EditProfileScreen(),
'/ViewProfilePhotoScreen': (context) => const ViewProfilePhotoScreen(),
}, },
); );
} }

View File

@ -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<EditProfileScreen> createState() => EditProfileScreenState();
}
class EditProfileScreenState extends State<EditProfileScreen> {
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(),
),
),
],
),
),
);
}
}

View File

@ -9,6 +9,7 @@ import 'package:drifter/pages/profile_screen/widgets/user_info_widget.dart';
import 'package:drifter/theme/app_colors.dart'; import 'package:drifter/theme/app_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:toggle_switch/toggle_switch.dart';
class ProfileScreen extends StatefulWidget { class ProfileScreen extends StatefulWidget {
const ProfileScreen({super.key}); const ProfileScreen({super.key});
@ -134,302 +135,390 @@ class ProfileScreenState extends State<ProfileScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
publicKeyInput.text = Keys.npubKey; publicKeyInput.text = Keys.npubKey;
return Container( return ListView(
color: AppColors.profileWrapperBg, children: [
child: Column( Container(
children: [ color: AppColors.profileWrapperBg,
Stack( child: Column(
children: [ children: [
Container( Stack(
width: double.infinity,
height: 70,
child: FittedBox(
child: Image.asset('assets/images/banner.png'),
fit: BoxFit.fill,
),
),
Row(
children: [ children: [
Padding( Container(
padding: width: double.infinity,
const EdgeInsets.only(top: 30, left: 16, right: 58), height: 70,
child: ClipRRect( child: FittedBox(
borderRadius: BorderRadius.circular(200), child: Image.asset('assets/images/banner.png'),
child: Container( fit: BoxFit.fill,
width: 80,
height: 80,
decoration: BoxDecoration(
border: Border.all(
width: 2, color: Color(0xFFF2EFFF))),
child: Image.asset('assets/images/avatar.png')),
), ),
), ),
Expanded( Row(
child: Container( children: [
margin: EdgeInsets.only(top: 74, right: 16), Padding(
child: Row( padding:
mainAxisAlignment: MainAxisAlignment.end, const EdgeInsets.only(top: 30, left: 16, right: 58),
children: [ child: ClipRRect(
SizedBox( borderRadius: BorderRadius.circular(200),
width: 32, child: Container(
height: 32, width: 80,
child: FloatingActionButton( height: 80,
backgroundColor: decoration: BoxDecoration(
AppColors.buttonSecondaryDefaultBg, border: Border.all(
onPressed: () {}, width: 2, color: Color(0xFFF2EFFF))),
elevation: 0, child: Image.asset('assets/images/avatar.png')),
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)))),
)
],
), ),
), 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: <Widget>[
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(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.only(top: 8, bottom: 4, right: 4, left: 4),
child: Column( child: ToggleSwitch(
crossAxisAlignment: CrossAxisAlignment.start, customWidths: [133, 133, 133],
children: [ // minWidth: double.infinity,
Text( minHeight: 48,
'Cameron Williamson', totalSwitches: 3,
style: TextStyle( labels: ['Posts', 'Posts & Replies', 'Bookmarks'],
color: AppColors.profileFullName, activeBgColor: [AppColors.toggleSwitchActiveBg],
fontWeight: FontWeight.w600), activeFgColor: AppColors.toggleSwitchTextActive,
), inactiveBgColor: AppColors.toggleSwitchBg,
SizedBox( inactiveFgColor: AppColors.toggleSwitchTextInactive,
height: 5, activeBorders: [
), Border.all(
Text('@cameron', color: AppColors.toggleSwitchBg,
style: TextStyle( width: 4,
color: AppColors.profileUserName, ),
)), ],
SizedBox( radiusStyle: true,
height: 5, cornerRadius: 8,
), customTextStyles: [
Text( TextStyle(fontSize: 12, fontWeight: FontWeight.w600)
'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( onToggle: (indexToggle) {
color: AppColors.profileSummary, print(indexToggle);
)), },
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: <Widget>[
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),
),
),
]),
)
]),
),
), ),
], ),
), ],
); );
// return ListView( // return ListView(
// children: [ // children: [
@ -622,3 +711,35 @@ class ProfileScreenState extends State<ProfileScreen> {
); );
} }
} }
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'),
),
],
);
}
}

View File

@ -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<ViewProfilePhotoScreen> createState() => _ViewProfilePhotoScreenState();
}
class _ViewProfilePhotoScreenState extends State<ViewProfilePhotoScreen> {
@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),
),
),
),
),
],
),
);
}
}

View File

@ -71,7 +71,7 @@ class _QrCodeScreenState extends State<QrCodeScreen> {
), ),
), ),
Text( Text(
'Cameron Williams on', 'Cameron Williamson',
style: TextStyle( style: TextStyle(
color: Color(0xFF302F38), color: Color(0xFF302F38),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

View File

@ -5,6 +5,8 @@ abstract class AppColors {
static const mainAccent = Color(0xFFFFCC11); static const mainAccent = Color(0xFFFFCC11);
static const mainBackground = Color(0xFFF2EFFF); static const mainBackground = Color(0xFFF2EFFF);
static const label = Color(0xFF7F71C8);
// Button // Button
static const buttonPrimaryDefaultBg = Color(0xFF4F46F1); static const buttonPrimaryDefaultBg = Color(0xFF4F46F1);
static const buttonPrimaryDefaultText = Color(0xFFFFFFFF); static const buttonPrimaryDefaultText = Color(0xFFFFFFFF);