Add generic type for result in PopScope (#139164)
Adds a generic type and pop result to popscope and its friend. The use cases are to be able to capture the result when the pop is called. migration guide: https://github.com/flutter/website/pull/9872
This commit is contained in:
@@ -326,9 +326,9 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
|
||||
backgroundColor: isDark ? _kFlutterBlue : theme.primaryColor,
|
||||
body: SafeArea(
|
||||
bottom: false,
|
||||
child: PopScope(
|
||||
child: PopScope<Object?>(
|
||||
canPop: _category == null,
|
||||
onPopInvoked: (bool didPop) {
|
||||
onPopInvoked: (bool didPop, Object? result) {
|
||||
if (didPop) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user