Closed Wouter12 closed 7 months ago
Hi @Wouter12
Can you please provide your flutter doctor -v
, your flutter run --verbose
and a minimal complete reproducible code sample?
Thank you
This issue is reproducible. Notes that the issue does not reproduce if we run the Flutter module as standalone project.
Some previously submitted issues related: https://github.com/flutter/flutter/issues?q=is%3Aissue+tileWidth+%21%3D+leadingSize.width+is%3Aclosed
Adding engine
because the issue does not reproduce in standalone mode.
I suspect this is actually a framework bug - it seems like the framework is incorrectly getting a viewport size as zero when it shouldn't be.
Is there a reproducible test case or project for this?
@pedromassango This is not a native crash. I am not sure what the engine action item is here as the stack trace is all Dart.
@dnfield the reproducible project code is https://github.com/flutter/flutter/files/5518598/application.zip provided in https://github.com/flutter/flutter/issues/70179#issuecomment-724806398.
Try adjusting the dimensions(height, width) of the widget you're taking.
Same issue on iOS when switching from orientation Portrait to Landscape or on hot reload when on landscape. Do we have a workaround to prevent this issue?
Simple example
Card(
child: ListTile(
leading: Container(
padding: const EdgeInsets.symmetric(vertical: 4.0),
height: 100,
width: 100,
child: const Icon(Icons.info),
),
title: Text('Yolo'),
),
);
Oh the issue was caused by the drawer, not the expected Card widget with Tile 😅 I've resolved the drawer and everything gonna right
I have an extremely simple flutter app. Below is the main.dart file. This App gives an error message "Failed assertion: line 1186 pos 7: 'tileWidth != leadingSize.width || tileWidth == 0.0'" when I try to resize the App window to a Screen Width around 290. My flutter version is 3.7.7 and I've also tried to downgrade to 3.7.3 but it didn't fix the issue.
import 'package:flutter/material.dart';
void main() { runApp(MyApp()); }
class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: SideMenu(), ); } }
class SideMenu extends StatelessWidget { @override Widget build(BuildContext context) { MediaQuery.of(context).size.width; return Scaffold( appBar: AppBar( title: const Text('Test'), ), body: Material( child: SizedBox( width: 300, child: ListView( physics: const NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, children: [ ListTile( leading: SizedBox( width: 260, height: 260, child: Icon( Icons.search, size: 260.0, ), ), ), ListTile( title: Text('Screen Width: ${MediaQuery.of(context).size.width}'), ), ], ), ), ), ); } }
Same.
@Wouter12 I tried to reverify this issue using latest stable and ran it per your original description, but can't seem to replicate the error. I get below logs when the app compiles and runs.
D/FlutterGeolocator(24253): Flutter engine connected. Connected engine count 1
D/EGL_emulation(24101): app_time_stats: avg=1381.08ms min=43.89ms max=3648.03ms count=3
D/EGL_emulation(24101): app_time_stats: avg=15.49ms min=1.86ms max=183.38ms count=31
D/EGL_emulation(24101): app_time_stats: avg=128.07ms min=1.93ms max=879.66ms count=7
D/FlutterGeolocator(24253): Detaching Geolocator from activity
D/FlutterGeolocator(24253): Flutter engine disconnected. Connected engine count 0
I/flutter (24421):
I/flutter (24421):
I/flutter (24421):
I/flutter (24421):
I/flutter (24421): Flutter screen size: 1440.0 2476.0
I/flutter (24421): first: 338583194 last: 1015619479
I tried on latest stable 3.19.2. Can you check at your end if the original error still persists ? If so, please provide us updated runnable code sample.
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
I have a flutter module added to my native android project. Everything works ok, but when i go back to my android app, and reopen the flutteractivity (with reuse of the flutter engine) I get this exception (I show a listview with some items).
What I think the issue is, is what the note explains in this link: add flutter screen. Upon debugging i found that the tileWidth and leadingSize.width are both 0
Steps to reproduce: 1) add flutter module to android app 2) use prewarmed engine (I have overridden
FlutterActivity#provideFlutterEngine
, where I checked if there was an instance of the engine in theFlutterEngineCache
, if not create a new Engine and store it in theFlutterEngineCache
3) show a ListView with ListTiles 4) go back to the native android app 5) restart theFlutterActivity
6) Exception gets thrown in the flutter log