Skip to content

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Nov 15, 2022

When an application has nested scaffolds, the top scaffold will consume all of the insets to provide a safe area, making the media query inset worthless. Instead, re-rasterize anytime the mediaquery updates.

b/250815292

This works now.

// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';

void main() {
  timeDilation = 10;
  runApp(MaterialApp(
    home: Scaffold(body: Example()),
    routes: {
      '/b': (context) => Scaffold(body: B()),
    },
  ));
}

class Example extends StatefulWidget {
  const Example({super.key});

  @override
  State<Example> createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        color: Colors.red,
        child: Center(
          child: TextButton(
            child: Text('Forward'),
            onPressed: () {
              Navigator.of(context).pushNamed('/b');
            },
          ),
        ),
      ),
    );
  }
}

class B extends StatelessWidget {
  const B({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        color: Colors.blue,
        child: Column(
          children: [
            TextField(),
            TextButton(
              child: Text('BACK', style: TextStyle(color: Colors.black),),
              onPressed: () {
                Navigator.of(context).pop();
              },
            )
          ],
        ),
      ),
    );
  }
}

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Nov 15, 2022
jonahwilliams added 3 commits November 15, 2022 09:23
@jonahwilliams jonahwilliams changed the title [framework] autoresize on snapshot widget [framework] re-rasterize page transition when any media query properties change Nov 15, 2022
@jonahwilliams jonahwilliams marked this pull request as ready for review November 15, 2022 18:22
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #115371 at sha 3d2a2f7

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Nov 15, 2022
@jonahwilliams jonahwilliams marked this pull request as draft November 16, 2022 04:27
@jonahwilliams jonahwilliams removed the request for review from dnfield November 16, 2022 04:30
@jonahwilliams
Copy link
Contributor Author

actually this is caused by the avoidResizetoBottomLogic

@jonahwilliams jonahwilliams changed the title [framework] re-rasterize page transition when any media query properties change [framework] re-rasterize page transition when layout size changes Nov 16, 2022
@jonahwilliams jonahwilliams marked this pull request as ready for review November 16, 2022 17:54
@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 16, 2022
@auto-submit auto-submit bot merged commit d01874d into flutter:master Nov 16, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 17, 2022
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Nov 17, 2022
* d359af2 a062a2063 [macOS] Merge FlutterMetalCompositor, superclass (flutter/engine#37648) (flutter/flutter#115474)

* cacf1d2 Roll Flutter Engine from a062a20638d1 to 97974ebb5ff8 (3 revisions) (flutter/flutter#115478)

* 490fe28 Updated instructions for adding new localized messages. (flutter/flutter#115390)

* 84357cb re-enable firebase release smoke test since infra outage is over (flutter/flutter#115402)

* f205471 Use concrete factory constructor for DomXMLHttpRequest (flutter/flutter#115094)

* 55927d8 3c83b275a [Impeller] Reland: Refactor color source resolution to use explicit factory types (flutter/engine#37677) (flutter/flutter#115482)

* 829e44d Fixed label alignment (flutter/flutter#115409)

* b579109 Roll Flutter Engine from 3c83b275a511 to 35ecb2bf4139 (2 revisions) (flutter/flutter#115495)

* d01874d [framework] re-rasterize page transition when layout size changes (flutter/flutter#115371)

* 68740a2 fee463552 Roll Fuchsia Linux SDK from T7_W8eoMNuMdG-5R9... to haqxMhaSf7-4ZeVL8... (flutter/engine#37684) (flutter/flutter#115498)

* 26a990f Roll Flutter Engine from fee463552a93 to c5e6a38dd0bc (2 revisions) (flutter/flutter#115504)

* f255390 Remove redundant arguments passed to redirecting factory constructors (flutter/flutter#115497)

* 20139c6 4f3f45617 Move windows engine_v2 to prod. (flutter/engine#37680) (flutter/flutter#115508)

* 2ad4dc5 dcdb96e9d Roll Skia from 1dfecd7cd478 to 7f385b0ae434 (9 revisions) (flutter/engine#37693) (flutter/flutter#115512)

* 9c54635 Bump codecov/codecov-action from 3.1.0 to 3.1.1 (flutter/flutter#113126)

* fafa11d Roll Flutter Engine from dcdb96e9db6b to cb403c1feaee (2 revisions) (flutter/flutter#115516)

* 59f389d Remove unneeded comparison to `double.nan` (flutter/flutter#115470)

* c071950 d422023f3 Migrate const_finder tests to be null safe (flutter/engine#37683) (flutter/flutter#115524)

* bf6d0f3 5bbf070c3 Roll Skia from 7f385b0ae434 to 8589c8ac6ee6 (1 revision) (flutter/engine#37702) (flutter/flutter#115531)

* 83d205e 7156b87c7 Roll Skia from 8589c8ac6ee6 to 68784d303cd6 (4 revisions) (flutter/engine#37705) (flutter/flutter#115538)

* 7e8568b 83c2482d7 [Impeller] Add Impeller scene (flutter/engine#37694) (flutter/flutter#115541)

* 07de108 ad3038c25 Roll Skia from 68784d303cd6 to 95ac3b53be37 (1 revision) (flutter/engine#37706) (flutter/flutter#115548)

* 1b23ad6 Roll Flutter Engine from ad3038c25cfa to 832aae2f850a (2 revisions) (flutter/flutter#115552)

* e8cbd44 Added Badge.isLabelVisible flag (flutter/flutter#115292)

* e9622ce Added Badge.count constructor (flutter/flutter#115297)

* 537f89c Revert "Added Badge.count constructor (#115297)" (flutter/flutter#115564)
@jonahwilliams jonahwilliams deleted the re-rasterize-on-size branch November 17, 2022 18:57
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Nov 17, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Nov 18, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Nov 18, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Nov 18, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Nov 18, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Nov 18, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Nov 18, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Nov 18, 2022
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
…utter#115371)

* [framework] autoresize on snapshot widget

* ++

* ++

* ++

* use layout to resize
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…utter#115371)

* [framework] autoresize on snapshot widget

* ++

* ++

* ++

* use layout to resize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants