From c3661d4caae7b716d3146e0d8a7fd5ef34ecbfd2 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 8 Mar 2022 10:55:31 -0800 Subject: [PATCH] Using build context instead of inherited context when building file bubble popout Fix: #394 --- lib/cwtch/cwtchNotifier.dart | 1 - lib/widgets/filebubble.dart | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/cwtch/cwtchNotifier.dart b/lib/cwtch/cwtchNotifier.dart index 7fbf4022..dbeb6c7a 100644 --- a/lib/cwtch/cwtchNotifier.dart +++ b/lib/cwtch/cwtchNotifier.dart @@ -153,7 +153,6 @@ class CwtchNotifier { } break; case "NewMessageFromPeer": - var identifier = int.parse(data["ConversationID"]); var messageID = int.parse(data["Index"]); var timestamp = DateTime.tryParse(data['TimestampReceived'])!; diff --git a/lib/widgets/filebubble.dart b/lib/widgets/filebubble.dart index 624f8067..0c944c13 100644 --- a/lib/widgets/filebubble.dart +++ b/lib/widgets/filebubble.dart @@ -356,7 +356,7 @@ class FileBubbleState extends State { void pop(context, File myFile, Widget meta) async { await showDialog( context: context, - builder: (_) => Dialog( + builder: (bcontext) => Dialog( alignment: Alignment.center, child: Container( padding: EdgeInsets.all(10), @@ -365,16 +365,16 @@ class FileBubbleState extends State { title: meta, trailing: IconButton( icon: Icon(Icons.close), - color: Provider.of(context, listen: false).theme.toolbarIconColor, + color: Provider.of(bcontext, listen: false).theme.toolbarIconColor, iconSize: 32, onPressed: () { - Navigator.pop(context, true); + Navigator.pop(bcontext, true); })), Image.file( myFile, - cacheWidth: (MediaQuery.of(context).size.width * 0.6).floor(), - width: (MediaQuery.of(context).size.width * 0.6), - height: (MediaQuery.of(context).size.height * 0.6), + cacheWidth: (MediaQuery.of(bcontext).size.width * 0.6).floor(), + width: (MediaQuery.of(bcontext).size.width * 0.6), + height: (MediaQuery.of(bcontext).size.height * 0.6), fit: BoxFit.scaleDown, ), SizedBox(