Skip to content

store: Move PerAccountStoreWidget down into individual routes #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 24, 2023

Conversation

gnprice
Copy link
Member

@gnprice gnprice commented Mar 24, 2023

Fixes: #21


For combining this with #29, the diff looks like:

diff --git a/lib/widgets/content.dart b/lib/widgets/content.dart
index e970e4760..9998ab8d8 100644
--- a/lib/widgets/content.dart
+++ b/lib/widgets/content.dart
@@ -196,3 +196,4 @@ class MessageImage extends StatelessWidget {
       onTap: () {
-        Navigator.of(context).push(getLightboxRoute(message: message, src: resolvedSrc));
+        Navigator.of(context).push(getLightboxRoute(
+            context: context, message: message, src: resolvedSrc));
       },
diff --git a/lib/widgets/lightbox.dart b/lib/widgets/lightbox.dart
index bddbf6f38..c2d790591 100644
--- a/lib/widgets/lightbox.dart
+++ b/lib/widgets/lightbox.dart
@@ -7,2 +7,3 @@ import '../api/model/model.dart';
 import 'content.dart';
+import 'page.dart';
 import 'store.dart';
@@ -176,4 +177,9 @@ class _PageState extends State<_Page> {
 
-Route getLightboxRoute({required Message message, required String src}) {
-  return PageRouteBuilder(
+Route getLightboxRoute({
+  required BuildContext context,
+  required Message message,
+  required String src,
+}) {
+  return AccountPageRouteBuilder(
+    context: context,
     fullscreenDialog: true,

(This is also why this PR includes a PageRouteBuilder version of making a route, as well as a MaterialPageRoute version.)

gnprice added 4 commits March 23, 2023 17:24
I don't understand why a mere `flutter pub get` causes this update,
but it does.  (Which means that `flutter run` does too.)
Much of this code was written before I had a firm grasp on how
indentation in Dart code is supposed to work.  Among other things,
this meant I often let the auto-formatting in Android Studio do
what it seemed to want, even when it was confused.

This diff should be empty under `git diff -b`.  I'll make
small other tweaks as a separate commit.
Following up on the pure-indentation changes from the previous commit.
@chrisbobbe chrisbobbe merged commit 8b86961 into zulip:main Mar 24, 2023
@chrisbobbe
Copy link
Collaborator

Thanks, LGTM! Merging.

@gnprice gnprice deleted the pr-page-data branch March 25, 2023 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Push PerAccountRoot under MaterialApp, into each individual page widget
2 participants