drifter/lib/widgets/message_screen/message_screen_widget.dart

106 lines
2.6 KiB
Dart
Raw Permalink Normal View History

2023-05-03 01:32:46 +00:00
import 'package:flutter/material.dart';
import 'package:drifter/theme/app_colors.dart';
class MessageScreen extends StatefulWidget {
const MessageScreen({super.key});
@override
State<MessageScreen> createState() => _MessageScreenState();
}
class _MessageScreenState extends State<MessageScreen> {
@override
Widget build(BuildContext context) {
return Stack(
children: [
ListView(
padding: EdgeInsets.all(16),
children: [
Center(
child: Text('List of posts'),
)
],
),
MessageInput(),
],
);
}
}
class MessageInput extends StatefulWidget {
const MessageInput({
super.key,
});
@override
State<MessageInput> createState() => _MessageInputState();
}
class _MessageInputState extends State<MessageInput> {
final messageController = TextEditingController();
void submitData() {
final newMessage = messageController;
}
@override
Widget build(BuildContext context) {
return Align(
alignment: Alignment.bottomCenter,
child: Container(
padding: const EdgeInsets.only(bottom: 16, left: 8, right: 8, top: 8),
child: Row(
children: [
GestureDetector(
onTap: () {},
child: const Icon(
Icons.add_a_photo,
color: AppColors.mainDarkBlue,
size: 30,
),
),
const SizedBox(
width: 8,
),
Expanded(
child: TextField(
style: const TextStyle(fontSize: 20),
decoration: InputDecoration(
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20))),
hintText: 'What\'s new?',
hintStyle: const TextStyle(fontSize: 20),
suffixIcon: IconButton(
icon: const Icon(
Icons.send,
color: AppColors.mainDarkBlue,
size: 30,
),
onPressed: () {
submitData();
},
),
),
),
),
],
),
),
);
}
}
class NewMessage extends StatefulWidget {
const NewMessage({super.key});
@override
State<NewMessage> createState() => _NewMessageState();
}
class _NewMessageState extends State<NewMessage> {
@override
Widget build(BuildContext context) {
return const Placeholder();
}
}