Skip to content

First frame with a platform view on iOS is janky #29573

@amirh

Description

@amirh

On iOS with GL rendering there's jank in the first frame a platform view is added, screen recording: https://photos.app.goo.gl/TUm6nSiENM2WT1ED6

The following minimal might help debugging with a simple layer tree:

class Glitch extends StatefulWidget {
  @override
  State<Glitch> createState() => GlitchState();
}

class GlitchState extends State<Glitch> {
  bool showMap = false;

  @override
  Widget build(BuildContext context) {
   return Column(
     children: <Widget>[
       Text('Hello'),
       Container(
         width: 300,
         height: 300,
         child: showMap ?
         GoogleMap(
           initialCameraPosition: CameraPosition(target: LatLng(0, 0)),
         )
             : null,
       ),
       GestureDetector(
         onTap: () {
           setState(() {
             showMap = !showMap;
           });
         },
         child: Text('TOGGLE SHOW MAP'),
       ),
     ],
   );
  }
}

The following engine patch prevents a second frame from being pumped right after a platform view is attached: amirh/engine@ee9ebb2

With that patch and the sample code above the bad frame remains stable on the screen, hopefully that makes debugging easier.

Metadata

Metadata

Assignees

Labels

a: platform-viewsEmbedding Android/iOS views in Flutter appspackageflutter/packages repository. See also p: labels.platform-iosiOS applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions