Skip to content

CupertinoPageRoute barrier and shadow paints offscreen unnecessarily for the bottom route #114169

@moffatman

Description

@moffatman

CupertinoPageRoute includes a partially-transparent ModalBarrier behind it, as well as a drop-shadow on its left edge. This is to match the native page transition while a new page slides over on top of the current one. But this occurs even on the bottom/first route in the Navigator, where both the shadow and the background fill should never be visible to the user. So this increases raster time and/or memory usage.

CupertinoModalBarrier

image

(rectangle of 0x00000018)

CupertinoPageTransition

image

Example code

import 'package:flutter/cupertino.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const Padding(
      padding: EdgeInsets.all(64),
      child: CupertinoApp(
        home: CupertinoPageScaffold(
          child: Center(
            child: Text('content')
          )
        )
      )
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectf: cupertinoflutter/packages/flutter/cupertino repositoryframeworkflutter/packages/flutter repository. See also f: labels.perf: memoryPerformance issues related to memoryperf: speedPerformance issues related to (mostly rendering) speedteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions