aboutsummaryrefslogtreecommitdiff
path: root/lib/widgets/chat_bottom_sheet.dart
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2023-05-22 00:09:43 -0600
committerIván Ávalos <avalos@disroot.org>2023-05-22 00:09:43 -0600
commit786267d0ebb337ad5b4f1e528fdd4c23731e0606 (patch)
tree6e696aeae7fe14244b555da9815ecd19d0b92b14 /lib/widgets/chat_bottom_sheet.dart
parent41b1ed94d6964e3fcedf427bbd323861b03fd1de (diff)
downloadlinkchat-786267d0ebb337ad5b4f1e528fdd4c23731e0606.tar.gz
linkchat-786267d0ebb337ad5b4f1e528fdd4c23731e0606.tar.bz2
linkchat-786267d0ebb337ad5b4f1e528fdd4c23731e0606.zip
Se implementa funcionalidad básica de chat
Diffstat (limited to 'lib/widgets/chat_bottom_sheet.dart')
-rw-r--r--lib/widgets/chat_bottom_sheet.dart52
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/widgets/chat_bottom_sheet.dart b/lib/widgets/chat_bottom_sheet.dart
new file mode 100644
index 0000000..f1124cf
--- /dev/null
+++ b/lib/widgets/chat_bottom_sheet.dart
@@ -0,0 +1,52 @@
+import 'package:flutter/material.dart';
+
+class ChatBottomSheet extends StatelessWidget {
+ final Function(String msg) onPressed;
+ final TextEditingController _controller = TextEditingController();
+
+ ChatBottomSheet({super.key, required this.onPressed});
+
+ @override
+ Widget build(BuildContext context) {
+ return Container(
+ height: 55,
+ decoration: BoxDecoration(boxShadow: [
+ BoxShadow(
+ color: Colors.grey.withOpacity(0.5),
+ spreadRadius: 2,
+ blurRadius: 10,
+ offset: const Offset(0, 3),
+ ),
+ ]),
+ child: Row(
+ children: [
+ Padding(
+ padding: const EdgeInsets.only(left: 10),
+ child: Container(
+ alignment: Alignment.centerRight,
+ width: 270,
+ child: TextFormField(
+ controller: _controller,
+ decoration: const InputDecoration(
+ hintText: "Escribe algo",
+ border: InputBorder.none,
+ ),
+ ),
+ ),
+ ),
+ const Spacer(),
+ Padding(
+ padding: const EdgeInsets.only(right: 10),
+ child: IconButton(
+ icon: const Icon(Icons.send),
+ onPressed: () {
+ onPressed(_controller.value.text);
+ _controller.clear();
+ },
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+}