| .. | .. |
|---|
| 214 | 214 | : message.imageBase64!, |
|---|
| 215 | 215 | ); |
|---|
| 216 | 216 | |
|---|
| 217 | | - return GestureDetector( |
|---|
| 218 | | - onTap: () { |
|---|
| 219 | | - Navigator.of(context).push( |
|---|
| 220 | | - MaterialPageRoute( |
|---|
| 221 | | - builder: (_) => ImageViewer(imageBytes: bytes), |
|---|
| 222 | | - ), |
|---|
| 223 | | - ); |
|---|
| 224 | | - }, |
|---|
| 225 | | - child: ClipRRect( |
|---|
| 226 | | - borderRadius: BorderRadius.circular(8), |
|---|
| 227 | | - child: Image.memory( |
|---|
| 228 | | - bytes, |
|---|
| 229 | | - width: 260, |
|---|
| 230 | | - height: 180, |
|---|
| 231 | | - fit: BoxFit.cover, |
|---|
| 232 | | - errorBuilder: (_, e, st) => const SizedBox( |
|---|
| 233 | | - width: 260, |
|---|
| 234 | | - height: 60, |
|---|
| 235 | | - child: Center(child: Text('Image decode error')), |
|---|
| 217 | + return Column( |
|---|
| 218 | + crossAxisAlignment: CrossAxisAlignment.start, |
|---|
| 219 | + children: [ |
|---|
| 220 | + GestureDetector( |
|---|
| 221 | + onTap: () { |
|---|
| 222 | + Navigator.of(context).push( |
|---|
| 223 | + MaterialPageRoute( |
|---|
| 224 | + builder: (_) => ImageViewer(imageBytes: bytes), |
|---|
| 225 | + ), |
|---|
| 226 | + ); |
|---|
| 227 | + }, |
|---|
| 228 | + child: ClipRRect( |
|---|
| 229 | + borderRadius: BorderRadius.circular(8), |
|---|
| 230 | + child: Image.memory( |
|---|
| 231 | + bytes, |
|---|
| 232 | + width: 260, |
|---|
| 233 | + height: 180, |
|---|
| 234 | + fit: BoxFit.cover, |
|---|
| 235 | + errorBuilder: (_, e, st) => const SizedBox( |
|---|
| 236 | + width: 260, |
|---|
| 237 | + height: 60, |
|---|
| 238 | + child: Center(child: Text('Image decode error')), |
|---|
| 239 | + ), |
|---|
| 240 | + ), |
|---|
| 236 | 241 | ), |
|---|
| 237 | 242 | ), |
|---|
| 238 | | - ), |
|---|
| 243 | + if (message.content.isNotEmpty) ...[ |
|---|
| 244 | + const SizedBox(height: 6), |
|---|
| 245 | + Text( |
|---|
| 246 | + message.content, |
|---|
| 247 | + style: TextStyle( |
|---|
| 248 | + fontSize: 14, |
|---|
| 249 | + color: _isUser ? Colors.white.withAlpha(220) : null, |
|---|
| 250 | + height: 1.3, |
|---|
| 251 | + ), |
|---|
| 252 | + ), |
|---|
| 253 | + ], |
|---|
| 254 | + ], |
|---|
| 239 | 255 | ); |
|---|
| 240 | 256 | } |
|---|
| 241 | 257 | |
|---|