-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: SheetController attached to NavigationSheet always emits minPixe…
…ls = 0.0 (#164) Fixes #163. **New APIs** - `ExtentScopeBuilder` **Internal changes** - Removed `SheetExtentConfig`, `SheetExtentFactory`, and their subclasses. - Accordingly, `SheetExtentScope` widgets now also take responsibility for creating the `SheetExtent`s they host. - Moved the responsibility for managing the scope keys of the local `SheetExtentScope`s from `NavigationSheetExtent` to each `NavigationSheetRoute`. **Misc** - Added a regression test for #163. - Bumped the version to 0.7.2.
- Loading branch information
Showing
26 changed files
with
884 additions
and
667 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
package/lib/src/draggable/draggable_sheet_extent_scope.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import 'package:meta/meta.dart'; | ||
|
||
import '../foundation/sheet_extent.dart'; | ||
import '../foundation/sheet_extent_scope.dart'; | ||
import 'draggable_sheet_extent.dart'; | ||
|
||
@internal | ||
class DraggableSheetExtentScope extends SheetExtentScope { | ||
const DraggableSheetExtentScope({ | ||
super.key, | ||
super.controller, | ||
super.isPrimary, | ||
required this.initialExtent, | ||
required super.minExtent, | ||
required super.maxExtent, | ||
required super.physics, | ||
super.gestureTamperer, | ||
this.debugLabel, | ||
required super.child, | ||
}); | ||
|
||
/// {@macro DraggableSheetExtent.initialExtent} | ||
final Extent initialExtent; | ||
|
||
/// {@macro SheetExtent.debugLabel} | ||
final String? debugLabel; | ||
|
||
@override | ||
SheetExtentScopeState createState() { | ||
return _DraggableSheetExtentScopeState(); | ||
} | ||
} | ||
|
||
class _DraggableSheetExtentScopeState extends SheetExtentScopeState< | ||
DraggableSheetExtent, DraggableSheetExtentScope> { | ||
@override | ||
bool shouldRebuildExtent(DraggableSheetExtent oldExtent) { | ||
return widget.initialExtent != oldExtent.initialExtent || | ||
widget.debugLabel != oldExtent.debugLabel || | ||
super.shouldRebuildExtent(oldExtent); | ||
} | ||
|
||
@override | ||
DraggableSheetExtent buildExtent(SheetContext context) { | ||
return DraggableSheetExtent( | ||
context: context, | ||
initialExtent: widget.initialExtent, | ||
minExtent: widget.minExtent, | ||
maxExtent: widget.maxExtent, | ||
physics: widget.physics, | ||
gestureTamperer: widget.gestureTamperer, | ||
debugLabel: widget.debugLabel, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.