1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-10 14:58:34 +00:00
Files
samples/veggieseasons/lib/widgets/veggie_seasons_page.dart
Brett Morgan bee21b55e6 Cleaning up Veggie Seasons (#2416)
## Pre-launch Checklist

- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I read the [Contributors Guide].
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-devrel
channel on [Discord].

<!-- Links -->
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md
[CLA]: https://cla.developers.google.com/
[Discord]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
[Contributors Guide]:
https://github.com/flutter/samples/blob/main/CONTRIBUTING.md
2024-08-30 15:24:59 -04:00

46 lines
1.1 KiB
Dart

// Copyright 2024, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/cupertino.dart';
class VeggieSeasonsPage<T> extends Page<T> {
final Widget child;
const VeggieSeasonsPage({
super.key,
required this.child,
super.restorationId,
});
@override
VeggieSeasonsPageRoute<T> createRoute(BuildContext context) =>
VeggieSeasonsPageRoute<T>(this);
}
class VeggieSeasonsPageRoute<T> extends PageRoute<T> {
VeggieSeasonsPageRoute(VeggieSeasonsPage<T> page) : super(settings: page);
VeggieSeasonsPage<T> get _page => settings as VeggieSeasonsPage<T>;
@override
Color? get barrierColor => null;
@override
String? get barrierLabel => null;
@override
bool get maintainState => true;
@override
Duration get transitionDuration => Duration.zero;
@override
Widget buildPage(
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
) =>
_page.child;
}