-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopc: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: cupertinoflutter/packages/flutter/cupertino repositoryflutter/packages/flutter/cupertino repositoryf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.32Found to occur in 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33Found to occur in 3.33frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-linuxBuilding on or for Linux specificallyBuilding on or for Linux specificallyplatform-macBuilding on or for macOS specificallyBuilding on or for macOS specificallyplatform-webWeb applications specificallyWeb applications specificallyplatform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Steps to reproduce
after upgrade flutter version to 3.32.1,i found some error about page route and AppBar of Scaffold.
test on Windows
steps:
- use CupertinoPageRoute to Page2
- use MaterialPageRoute to Page3
- tap back button of AppBar on Page3, the error occurs
if use same PageRoute,both MaterialPageRoute or CupertinoPageRoute ,there is no error happen
Expected results
no error occurs
Actual results
======== Exception caught by widgets library =======================================================
The following assertion was thrown building Builder(dirty):
RenderBox was not laid out: RenderFractionalTranslation#2c647 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2251 pos 12: 'hasSize'
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=02_bug.yml
The relevant error-causing widget was:
AppBar AppBar:file:///D:/tempWorks/pro_iot_sports/lib/main.dart:61:15
Code sample
Code sample
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'PageRouteErrorDemo',
home: Page1(),
);
}
}
class Page1 extends StatefulWidget {
const Page1({super.key});
@override
State<Page1> createState() => _Page1State();
}
class _Page1State extends State<Page1> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Page1'),
),
body: Center(
child: TextButton(
onPressed: () {
Navigator.of(context).push(
CupertinoPageRoute(
builder: (context) => const Page2(),
),
);
},
child: const Text('CupertinoPageRoute to Page2'),
),
),
);
}
}
class Page2 extends StatefulWidget {
const Page2({super.key});
@override
State<Page2> createState() => _Page2State();
}
class _Page2State extends State<Page2> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Page2'),
),
body: Center(
child: TextButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) {
return const Page3();
},
),
);
},
child: const Text('MaterialPageRoute to Page3'),
),
),
);
}
}
class Page3 extends StatefulWidget {
const Page3({super.key});
@override
State<Page3> createState() => _Page3State();
}
class _Page3State extends State<Page3> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Page3'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Center(
child: Text(
"now,click Top-Left button back to Page2, it will error\nbut click button below, it works fine",
),
),
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: const Text('Back to Page2'),
),
],
),
);
}
}
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
======== Exception caught by widgets library =======================================================
The following assertion was thrown building Builder(dirty):
RenderBox was not laid out: RenderFractionalTranslation#2c647 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2251 pos 12: 'hasSize'
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=02_bug.yml
The relevant error-causing widget was:
AppBar AppBar:file:///D:/tempWorks/pro_iot_sports/lib/main.dart:61:15
When the exception was thrown, this was the stack:
#2 RenderBox.size (package:flutter/src/rendering/box.dart:2251:12)
#3 RenderFractionalTranslation.applyPaintTransform (package:flutter/src/rendering/proxy_box.dart:3081:42)
#4 RenderObject.getTransformTo (package:flutter/src/rendering/object.dart:3633:25)
#5 RenderBox.localToGlobal (package:flutter/src/rendering/box.dart:3094:39)
#6 TooltipState._buildTooltipOverlay (package:flutter/src/material/tooltip.dart:825:31)
#7 Builder.build (package:flutter/src/widgets/basic.dart:7919:48)
#8 StatelessElement.build (package:flutter/src/widgets/framework.dart:5781:49)
#9 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5715:15)
#10 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#11 StatelessElement.update (package:flutter/src/widgets/framework.dart:5787:5)
#12 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#13 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:7015:14)
#14 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#15 _OverlayPortalElement.update (package:flutter/src/widgets/overlay.dart:2258:21)
#16 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#17 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5738:16)
#18 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5874:11)
#19 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#20 StatefulElement.update (package:flutter/src/widgets/framework.dart:5899:5)
#21 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#22 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5738:16)
#23 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5874:11)
#24 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#25 StatefulElement.update (package:flutter/src/widgets/framework.dart:5899:5)
#26 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#27 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5738:16)
#28 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#29 ProxyElement.update (package:flutter/src/widgets/framework.dart:6041:5)
#30 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#31 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5738:16)
#32 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5874:11)
#33 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#34 StatefulElement.update (package:flutter/src/widgets/framework.dart:5899:5)
#35 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#36 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:7015:14)
#37 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#38 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5738:16)
#39 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#40 ProxyElement.update (package:flutter/src/widgets/framework.dart:6041:5)
#41 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#42 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:7015:14)
#43 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#44 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5738:16)
#45 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#46 StatelessElement.update (package:flutter/src/widgets/framework.dart:5787:5)
#47 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#48 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:7015:14)
#49 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#50 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5738:16)
#51 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5874:11)
#52 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#53 StatefulElement.update (package:flutter/src/widgets/framework.dart:5899:5)
#54 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#55 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5738:16)
#56 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5874:11)
#57 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#58 StatefulElement.update (package:flutter/src/widgets/framework.dart:5899:5)
#59 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#60 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:7015:14)
#61 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#62 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:7015:14)
#63 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#64 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:7015:14)
#65 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#66 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5738:16)
#67 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5874:11)
#68 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#69 StatefulElement.update (package:flutter/src/widgets/framework.dart:5899:5)
#70 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#71 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5738:16)
#72 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5874:11)
#73 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#74 StatefulElement.update (package:flutter/src/widgets/framework.dart:5899:5)
#75 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#76 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5738:16)
#77 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#78 StatelessElement.update (package:flutter/src/widgets/framework.dart:5787:5)
#79 Element.updateChild (package:flutter/src/widgets/framework.dart:3982:15)
#80 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5738:16)
#81 Element.rebuild (package:flutter/src/widgets/framework.dart:5427:7)
#82 BuildScope._tryRebuild (package:flutter/src/widgets/framework.dart:2694:15)
#83 BuildScope._flushDirtyElements (package:flutter/src/widgets/framework.dart:2752:11)
#84 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:3056:18)
#85 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1240:21)
#86 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:495:5)
#87 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1438:15)
#88 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1351:9)
#89 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1204:5)
#90 _invoke (dart:ui/hooks.dart:331:13)
#91 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:444:5)
#92 _drawFrame (dart:ui/hooks.dart:303:31)
(elided 2 frames from class _AssertionError)
====================================================================================================
Flutter Doctor output
Doctor output
PS D:\tempWorks\pro_iot_sports> flutter doctor
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.32.1, on Microsoft Windows [版本 10.0.22631.5335], locale zh-CN)
[√] Windows Version (11 专业版 64-bit, 23H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.13.2)
[√] Android Studio (version 2024.1)
[√] IntelliJ IDEA Ultimate Edition (version 2025.1)
[√] Connected device (3 available)
[√] Network resources
• No issues found!
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopc: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: cupertinoflutter/packages/flutter/cupertino repositoryflutter/packages/flutter/cupertino repositoryf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.32Found to occur in 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33Found to occur in 3.33frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-linuxBuilding on or for Linux specificallyBuilding on or for Linux specificallyplatform-macBuilding on or for macOS specificallyBuilding on or for macOS specificallyplatform-webWeb applications specificallyWeb applications specificallyplatform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team