From 5d65e5e1a97993727fc3026de195910e24309677 Mon Sep 17 00:00:00 2001 From: ryleedavis Date: Thu, 11 May 2023 16:52:45 -0600 Subject: [PATCH] WIP: username textfield, corrected app color --- .../user_info_widget.dart | 60 ++++++++++++++++--- lib/theme/app_colors.dart | 2 +- 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/lib/pages/profile_screen/profile_screen_widgets/user_info_widget.dart b/lib/pages/profile_screen/profile_screen_widgets/user_info_widget.dart index 134729d..53c47f4 100644 --- a/lib/pages/profile_screen/profile_screen_widgets/user_info_widget.dart +++ b/lib/pages/profile_screen/profile_screen_widgets/user_info_widget.dart @@ -1,3 +1,4 @@ +import 'package:drifter/theme/app_colors.dart'; import 'package:flutter/material.dart'; class UserInfo extends StatelessWidget { @@ -34,17 +35,62 @@ class AvatarWidget extends StatelessWidget { } } -class UserNameWidget extends StatelessWidget { +class UserNameWidget extends StatefulWidget { const UserNameWidget({super.key}); + @override + State createState() => _UserNameWidgetState(); +} + +class _UserNameWidgetState extends State { + late final TextEditingController messageController; + late final FocusNode messageFocusNode; + + @override + void initState() { + messageController = TextEditingController(); + messageFocusNode = FocusNode(); + + super.initState(); + } + + @override + void dispose() { + messageController.dispose(); + messageFocusNode.dispose(); + + super.dispose(); + } + @override Widget build(BuildContext context) { - return const Align( - alignment: Alignment.center, - // make a textfield - child: Text( - 'Username', - style: TextStyle(fontSize: 25), + return Padding( + padding: const EdgeInsets.all(4.0), + child: ClipRRect( + borderRadius: const BorderRadius.all( + Radius.circular( + 0.0, + ), + ), + child: TextField( + controller: messageController, + focusNode: messageFocusNode, + style: const TextStyle( + fontSize: 14, + ), + decoration: InputDecoration( + hintText: 'Username', + hintStyle: const TextStyle(fontSize: 14), + suffixIcon: IconButton( + icon: const Icon( + Icons.send, + color: AppColors.mainDarkBlue, + size: 30, + ), + onPressed: () {}, + ), + ), + ), ), ); } diff --git a/lib/theme/app_colors.dart b/lib/theme/app_colors.dart index f229aa9..b6c5691 100644 --- a/lib/theme/app_colors.dart +++ b/lib/theme/app_colors.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; abstract class AppColors { - static const background = const Color(0xFF673AB7); + static const background = const Color(0xFF4f46f1); static const mainAccent = const Color(0xFFFFCC11); static const mainDarkBlue = Color.fromRGBO(3, 37, 65, 1);