Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() {
- runApp(MessageApp());
- }
- class MessageApp extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- title: 'Message App',
- theme: ThemeData(primarySwatch: Colors.blue),
- home: MessageScreen(),
- );
- }
- }
- class MessageScreen extends StatelessWidget {
- final TextEditingController _messageController = TextEditingController();
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(title: Text('Message App')),
- body: Padding(
- padding: const EdgeInsets.all(16.0),
- child: Column(
- children: [
- Expanded(
- child: TextField(
- controller: _messageController,
- maxLines: null,
- decoration: InputDecoration(
- hintText: 'Write your message...',
- ),
- ),
- ),
- SizedBox(height: 16.0),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- IconButton(
- icon: Icon(Icons.open_in_new),
- onPressed: () {
- // Navigate to another page
- // Implement navigation logic here
- },
- ),
- ElevatedButton.icon(
- onPressed: () {
- // Implement message sending logic here
- String message = _messageController.text;
- print('Sending message: $message');
- },
- icon: Icon(Icons.send),
- label: Text('Send'),
- ),
- ],
- ),
- ],
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement