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';
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<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
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: () {},
),
),
),
),
);
}

View File

@ -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);