Merge branch 'feature/new-ui' into feature/file-picker
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:emojis/emoji.dart';
|
import 'package:emojis/emoji.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@@ -17,7 +16,6 @@ import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
|||||||
|
|
||||||
import 'image_group.dart';
|
import 'image_group.dart';
|
||||||
import 'message_text.dart';
|
import 'message_text.dart';
|
||||||
import 'utils.dart';
|
|
||||||
|
|
||||||
typedef AttachmentBuilder = Widget Function(BuildContext, Message, Attachment);
|
typedef AttachmentBuilder = Widget Function(BuildContext, Message, Attachment);
|
||||||
|
|
||||||
|
|||||||
+73
-82
@@ -16,97 +16,88 @@ class UrlAttachment extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Stack(
|
return GestureDetector(
|
||||||
children: [
|
onTap: () => launchURL(
|
||||||
Column(
|
context,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
urlAttachment.ogScrapeUrl,
|
||||||
children: [
|
),
|
||||||
if (urlAttachment.imageUrl != null)
|
child: Column(
|
||||||
SizedBox(
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
height: 16.0,
|
children: [
|
||||||
),
|
if (urlAttachment.imageUrl != null)
|
||||||
if (urlAttachment.imageUrl != null)
|
SizedBox(
|
||||||
Container(
|
height: 16.0,
|
||||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
),
|
||||||
margin: EdgeInsets.symmetric(horizontal: 8.0),
|
if (urlAttachment.imageUrl != null)
|
||||||
child: Stack(
|
Container(
|
||||||
children: [
|
clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||||
Center(
|
margin: EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
child: CachedNetworkImage(
|
child: Stack(
|
||||||
imageUrl: urlAttachment.imageUrl,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
left: 0.0,
|
|
||||||
bottom: -1,
|
|
||||||
child: Container(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
top: 8.0,
|
|
||||||
left: 8.0,
|
|
||||||
right: 8.0,
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
hostDisplayName,
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
color: Color(0xFF006CFF),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topRight: Radius.circular(16.0),
|
|
||||||
),
|
|
||||||
color: Color(0xFFE9F2FF),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: textPadding,
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
if (urlAttachment.title != null)
|
Center(
|
||||||
Text(
|
child: CachedNetworkImage(
|
||||||
urlAttachment.title,
|
imageUrl: urlAttachment.imageUrl,
|
||||||
maxLines: 1,
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
fontSize: 12.0,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
if (urlAttachment.text != null)
|
),
|
||||||
Text(
|
Positioned(
|
||||||
urlAttachment.text,
|
left: 0.0,
|
||||||
style: TextStyle(
|
bottom: -1,
|
||||||
fontWeight: FontWeight.w400,
|
child: Container(
|
||||||
fontSize: 12.0,
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
top: 8.0,
|
||||||
|
left: 8.0,
|
||||||
|
right: 8.0,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
hostDisplayName,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
color: Color(0xFF006CFF),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topRight: Radius.circular(16.0),
|
||||||
|
),
|
||||||
|
color: Color(0xFFE9F2FF),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
],
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
|
||||||
Positioned.fill(
|
|
||||||
child: Material(
|
|
||||||
color: Colors.transparent,
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () => launchURL(
|
|
||||||
context,
|
|
||||||
urlAttachment.ogScrapeUrl,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Padding(
|
||||||
|
padding: textPadding,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
if (urlAttachment.title != null)
|
||||||
|
Text(
|
||||||
|
urlAttachment.title,
|
||||||
|
maxLines: 1,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
fontSize: 12.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (urlAttachment.text != null)
|
||||||
|
Text(
|
||||||
|
urlAttachment.text,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
fontSize: 12.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user