together_mobile/lib/screens/message/components/message_input_box.dart

93 lines
3.1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:together_mobile/common/constants.dart';
import 'input_icon_button.dart';
class MessageInputBox extends StatefulWidget {
const MessageInputBox({super.key});
@override
State<MessageInputBox> createState() => _MessageInputBoxState();
}
class _MessageInputBoxState extends State<MessageInputBox> {
@override
Widget build(BuildContext context) => Container(
padding: const EdgeInsets.only(top: 6),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
const SizedBox(
width: 10,
),
Expanded(
child: Container(
padding: const EdgeInsets.all(10),
constraints: const BoxConstraints(maxHeight: 120),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
// Container color will be imply to its child
color: Theme.of(context).brightness == Brightness.dark
? const Color.fromARGB(255, 61, 61, 61)
: kPrimaryColor.withOpacity(0.2),
),
child: const TextField(
minLines: null,
maxLines: null,
decoration: InputDecoration(
isCollapsed: true,
border: UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
),
),
),
const SizedBox(
width: 10,
),
FilledButton(
onPressed: () {},
style: FilledButton.styleFrom(
padding: const EdgeInsets.all(0),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
child: const Text('发送'),
),
const SizedBox(
width: 10,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InputIconButton(
onPressed: () {},
icon: const Icon(Icons.insert_photo),
),
InputIconButton(
onPressed: () {},
icon: const Icon(Icons.call),
),
InputIconButton(
onPressed: () {},
icon: const Icon(Icons.mic),
),
InputIconButton(
onPressed: () {},
icon: const Icon(Icons.emoji_emotions),
),
InputIconButton(
onPressed: () {},
icon: const Icon(Icons.add_box_rounded),
),
],
),
],
),
);
}