fix: Navigator context

This commit is contained in:
Christian Pauly 2021-05-26 09:35:00 +02:00
parent efcf94edd7
commit 1e5393a9e1
4 changed files with 11 additions and 9 deletions

View File

@ -483,7 +483,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 0.30.3;
MARKETING_VERSION = 0.31.0;
PRODUCT_BUNDLE_IDENTIFIER = im.fluffychat.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@ -623,7 +623,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 0.30.3;
MARKETING_VERSION = 0.31.0;
PRODUCT_BUNDLE_IDENTIFIER = im.fluffychat.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@ -657,7 +657,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 0.30.3;
MARKETING_VERSION = 0.31.0;
PRODUCT_BUNDLE_IDENTIFIER = im.fluffychat.app;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@ -687,7 +687,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 0.30.3;
MARKETING_VERSION = 0.31.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "im.fluffychat.app.FluffyChat-Share";
@ -721,7 +721,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 0.30.3;
MARKETING_VERSION = 0.31.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "im.fluffychat.app.FluffyChat-Share";
PRODUCT_NAME = "$(TARGET_NAME)";
@ -752,7 +752,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 0.30.3;
MARKETING_VERSION = 0.31.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "im.fluffychat.app.FluffyChat-Share";
PRODUCT_NAME = "$(TARGET_NAME)";

View File

@ -5,12 +5,13 @@ import 'package:flutter/material.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'matrix_file_extension.dart';
import '../../pages/image_viewer.dart';
import '../../widgets/matrix.dart';
extension LocalizedBody on Event {
void openFile(BuildContext context, {bool downloadOnly = false}) async {
if (!downloadOnly &&
[MessageTypes.Image, MessageTypes.Sticker].contains(messageType)) {
await Navigator.of(context, rootNavigator: true).push(
await Navigator.of(Matrix.of(context).navigatorContext).push(
MaterialPageRoute(builder: (_) => ImageViewer(this)),
);
return;

View File

@ -7,6 +7,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../../utils/matrix_sdk_extensions.dart/event_extension.dart';
import '../matrix.dart';
class ImageBubble extends StatefulWidget {
final Event event;
@ -237,7 +238,7 @@ class _ImageBubbleState extends State<ImageBubble> {
child: InkWell(
onTap: () {
if (!widget.tapToView) return;
Navigator.of(context, rootNavigator: true).push(
Navigator.of(Matrix.of(context).navigatorContext).push(
MaterialPageRoute(
builder: (_) => ImageViewer(widget.event, onLoaded: () {
// If the original file didn't load yet, we want to do that now.

View File

@ -1,7 +1,7 @@
name: fluffychat
description: Chat with your friends.
publish_to: none
version: 0.31.0+0
version: 0.31.1+0
environment:
sdk: ">=2.6.0 <3.0.0"