tezvyn:

PageRouteBuilder: Custom Routes Without the Boilerplate

Source: api.flutter.devadvanced

PageRouteBuilder creates a custom page route on the fly, skipping the boilerplate of a full subclass. Just provide a `pageBuilder` for the screen's content and a `transitionsBuilder` for a unique animation.

PageRouteBuilder is a shortcut for creating custom page routes with unique animations, directly within your navigation logic. Instead of writing a new class that inherits from PageRoute, you provide two callbacks: `pageBuilder` to construct your screen's widget tree, and `transitionsBuilder` to define how it animates. This is ideal for one-off transitions, like a special zoom. The main footgun is overusing it for common transitions, which leads to code duplication.

Read the original → api.flutter.dev

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

PageRouteBuilder: Custom Routes Without the Boilerplate · Tezvyn