WIP: username textfield, corrected app color

This commit is contained in:
Rylee Davis 2023-05-11 16:52:45 -06:00
parent 6d6684a8eb
commit 5d65e5e1a9
2 changed files with 54 additions and 8 deletions

View File

@ -1,3 +1,4 @@
import 'package:drifter/theme/app_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class UserInfo extends StatelessWidget { class UserInfo extends StatelessWidget {
@ -34,17 +35,62 @@ class AvatarWidget extends StatelessWidget {
} }
} }
class UserNameWidget extends StatelessWidget { class UserNameWidget extends StatefulWidget {
const UserNameWidget({super.key}); const UserNameWidget({super.key});
@override
State<UserNameWidget> createState() => _UserNameWidgetState();
}
class _UserNameWidgetState extends State<UserNameWidget> {
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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const Align( return Padding(
alignment: Alignment.center, padding: const EdgeInsets.all(4.0),
// make a textfield child: ClipRRect(
child: Text( borderRadius: const BorderRadius.all(
'Username', Radius.circular(
style: TextStyle(fontSize: 25), 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: () {},
),
),
),
), ),
); );
} }

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
abstract class AppColors { abstract class AppColors {
static const background = const Color(0xFF673AB7); static const background = const Color(0xFF4f46f1);
static const mainAccent = const Color(0xFFFFCC11); static const mainAccent = const Color(0xFFFFCC11);
static const mainDarkBlue = Color.fromRGBO(3, 37, 65, 1); static const mainDarkBlue = Color.fromRGBO(3, 37, 65, 1);