import 'package:flutter/material.dart'; import 'package:drifter/theme/app_colors.dart'; class MessageScreen extends StatefulWidget { const MessageScreen({super.key}); @override State createState() => _MessageScreenState(); } class _MessageScreenState extends State { @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 createState() => _MessageInputState(); } class _MessageInputState extends State { 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 createState() => _NewMessageState(); } class _NewMessageState extends State { @override Widget build(BuildContext context) { return const Placeholder(); } }