82 lines
2.5 KiB
Dart
82 lines
2.5 KiB
Dart
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
import 'package:together_mobile/common/constants.dart';
|
||
|
|
||
|
class MessageBubble extends StatelessWidget {
|
||
|
const MessageBubble({super.key});
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Container(
|
||
|
padding: const EdgeInsets.symmetric(
|
||
|
vertical: kDefaultPadding / 2,
|
||
|
horizontal: kDefaultPadding,
|
||
|
),
|
||
|
child: Column(
|
||
|
children: [
|
||
|
const SizedBox(
|
||
|
height: 40.0,
|
||
|
child: Text('2023-06-01 11:11'),
|
||
|
),
|
||
|
Row(
|
||
|
textDirection: TextDirection.rtl,
|
||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
children: [
|
||
|
CircleAvatar(
|
||
|
child: Image.asset('assets/images/user_2.png'),
|
||
|
),
|
||
|
const SizedBox(
|
||
|
width: 10,
|
||
|
),
|
||
|
Expanded(
|
||
|
child: Column(
|
||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||
|
children: [
|
||
|
Text('123'),
|
||
|
const SizedBox(
|
||
|
height: 5,
|
||
|
),
|
||
|
Container(
|
||
|
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
|
||
|
decoration: BoxDecoration(
|
||
|
color: kPrimaryColor,
|
||
|
borderRadius: BorderRadius.circular(10.0),
|
||
|
),
|
||
|
child: Column(
|
||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
children: [
|
||
|
Text(
|
||
|
'hello world',
|
||
|
textWidthBasis: TextWidthBasis.longestLine,
|
||
|
),
|
||
|
const SizedBox(
|
||
|
height: 10,
|
||
|
),
|
||
|
Container(
|
||
|
height: 60,
|
||
|
margin: const EdgeInsets.only(
|
||
|
bottom: 10,
|
||
|
),
|
||
|
decoration: BoxDecoration(
|
||
|
borderRadius: BorderRadius.circular(10),
|
||
|
color: Colors.red,
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
TextButton(
|
||
|
onPressed: () {},
|
||
|
child: const Text('显示信息'),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|