Commit 8b2658ed authored by Wilko Manger's avatar Wilko Manger

Always use white for image bubble time

parent 90afdb5e
......@@ -105,7 +105,6 @@ class _ImagePageState extends State<ImagePage> {
context: context,
url: event.content.url,
),
heroTag: _current.event.id,
minScale: PhotoViewComputedScale.contained,
);
},
......
......@@ -15,10 +15,13 @@
// You should have received a copy of the GNU Affero General Public License
// along with Pattle. If not, see <https://www.gnu.org/licenses/>.
import 'package:animations/animations.dart';
import 'package:flutter/material.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import '../../../../../../../app.dart';
import 'package:provider/provider.dart';
import '../../../../image/page.dart';
import '../../message.dart';
import '../../../../util/image_provider.dart';
......@@ -38,15 +41,6 @@ class _ImageContentState extends State<ImageContent> {
static const double _minHeight = 72;
static const double _maxHeight = 292;
void _onTap(BuildContext context) {
final bubble = MessageBubble.of(context);
Navigator.pushNamed(
context,
Routes.image,
arguments: [bubble.chat.room.id, bubble.message.event.id],
);
}
bool get _isFile => _fileUri != null;
Uri _fileUri;
......@@ -76,37 +70,52 @@ class _ImageContentState extends State<ImageContent> {
final bubble = MessageBubble.of(context);
final event = bubble.message.event as ImageMessageEvent;
return Container(
width: _width,
height: _height,
decoration: BoxDecoration(borderRadius: bubble.borderRadius),
child: Stack(
children: <Widget>[
Positioned.fill(
child: ClipRRect(
borderRadius: bubble.borderRadius,
child: Hero(
tag: event.id,
child: Image(
image: imageProvider(
context: context,
url: _isFile ? _fileUri : event.content.url,
return OpenContainer(
closedElevation: 0,
closedShape: RoundedRectangleBorder(borderRadius: bubble.borderRadius),
closedBuilder: (_, void Function() action) {
// Reprovide the MessageBubble
return Provider<MessageBubble>.value(
value: bubble,
child: Container(
width: _width,
height: _height,
decoration: BoxDecoration(borderRadius: bubble.borderRadius),
child: Stack(
children: <Widget>[
Positioned.fill(
child: ClipRRect(
borderRadius: bubble.borderRadius,
child: Image(
image: imageProvider(
context: context,
url: _isFile ? _fileUri : event.content.url,
),
fit: BoxFit.cover,
),
),
fit: BoxFit.cover,
),
),
),
),
if (MessageInfo.necessary(context)) _MessageInfo(),
if (Sender.necessary(context)) _Sender(),
Positioned.fill(
child: Clickable(
extraMaterial: true,
onTap: () => _onTap(context),
if (MessageInfo.necessary(context)) _MessageInfo(),
if (Sender.necessary(context)) _Sender(),
Positioned.fill(
child: Clickable(
extraMaterial: true,
onTap: () => action(),
),
),
],
),
),
],
),
);
},
openBuilder: (_, void Function() action) {
final bubble = MessageBubble.of(context);
return ImagePage.withBloc(
bubble.chat.room.id,
bubble.message.event.id,
);
},
);
}
}
......@@ -138,7 +147,7 @@ class _MessageInfo extends StatelessWidget {
padding: EdgeInsets.all(4),
child: DefaultTextStyle(
style: DefaultTextStyle.of(context).style.copyWith(
color: !bubble.message.isMine ? Colors.white : null,
color: Colors.white,
),
child: MessageInfo(),
),
......
......@@ -22,6 +22,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.39.4"
animations:
dependency: "direct main"
description:
name: animations
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0+5"
archive:
dependency: transitive
description:
......
......@@ -51,6 +51,7 @@ dependencies:
mdi: ^0.2.1
shimmer: ^1.1.0
flutter_svg: ^0.17.3+1
animations: ^1.0.0+5
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment