Jaime Blasco
Committed by GitHub

feat: sheet improvements (#355)

* feat: sheet improvements

* fix: remove unused simulation

* fix: rebase

* fix: update dependencies
Showing 35 changed files with 469 additions and 414 deletions
... ... @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>
... ...
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
... ...
... ... @@ -14,9 +14,9 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher_ios/ios"
SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
url_launcher_ios: ae1517e5e344f5544fb090b079e11f399dfbe4d2
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
COCOAPODS: 1.11.3
COCOAPODS: 1.13.0
... ...
... ... @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
... ... @@ -113,7 +113,6 @@
9E13656F8C2A211F9F4C04EF /* Pods-Runner.release.xcconfig */,
C33049C8773181A0B4BCD4EE /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
... ... @@ -156,7 +155,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
... ... @@ -200,10 +199,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
... ... @@ -214,6 +215,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
... ... @@ -340,7 +342,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
... ... @@ -356,6 +358,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 87RQQPQ85J;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
... ... @@ -417,7 +420,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
... ... @@ -466,7 +469,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
... ... @@ -483,6 +486,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 87RQQPQ85J;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
... ... @@ -505,6 +509,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 87RQQPQ85J;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
... ...
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
... ...
... ... @@ -43,5 +43,7 @@
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
... ...
... ... @@ -5,10 +5,10 @@ packages:
dependency: transitive
description:
name: async
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.10.0"
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
... ... @@ -21,10 +21,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
version: "1.3.0"
clock:
dependency: transitive
description:
... ... @@ -37,18 +37,18 @@ packages:
dependency: transitive
description:
name: collection
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.17.2"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d
url: "https://pub.dev"
source: hosted
version: "1.0.5"
version: "1.0.6"
fake_async:
dependency: transitive
description:
... ... @@ -72,61 +72,53 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
js:
dependency: transitive
description:
name: js
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
url: "https://pub.dev"
source: hosted
version: "0.6.5"
matcher:
dependency: transitive
description:
name: matcher
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
url: "https://pub.dev"
source: hosted
version: "0.12.13"
version: "0.12.16"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
version: "0.5.0"
meta:
dependency: transitive
description:
name: meta
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
version: "1.9.1"
modal_bottom_sheet:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "2.1.2"
version: "3.0.1"
path:
dependency: transitive
description:
name: path
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
url: "https://pub.dev"
source: hosted
version: "1.8.2"
version: "1.8.3"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a
sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d
url: "https://pub.dev"
source: hosted
version: "2.1.3"
version: "2.1.6"
sky_engine:
dependency: transitive
description: flutter
... ... @@ -136,10 +128,10 @@ packages:
dependency: transitive
description:
name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.10.0"
stack_trace:
dependency: transitive
description:
... ... @@ -176,74 +168,74 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
url: "https://pub.dev"
source: hosted
version: "0.4.16"
version: "0.6.0"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
sha256: "698fa0b4392effdc73e9e184403b627362eb5fbf904483ac9defbb1c2191d809"
sha256: b1c9e98774adf8820c96fbc7ae3601231d324a7d5ebd8babe27b6dfac91357ba
url: "https://pub.dev"
source: hosted
version: "6.1.8"
version: "6.2.1"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: "3e2f6dfd2c7d9cd123296cab8ef66cfc2c1a13f5845f42c7a0f365690a8a7dd1"
sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def"
url: "https://pub.dev"
source: hosted
version: "6.0.23"
version: "6.2.0"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: bb328b24d3bccc20bdf1024a0990ac4f869d57663660de9c936fb8c043edefe3
sha256: "4ac97281cf60e2e8c5cc703b2b28528f9b50c8f7cebc71df6bdf0845f647268a"
url: "https://pub.dev"
source: hosted
version: "6.0.18"
version: "6.2.0"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: "318c42cba924e18180c029be69caf0a1a710191b9ec49bb42b5998fdcccee3cc"
sha256: "9f2d390e096fdbe1e6e6256f97851e51afc2d9c423d3432f1d6a02a8a9a8b9fd"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
version: "3.1.0"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: "41988b55570df53b3dd2a7fc90c76756a963de6a8c5f8e113330cb35992e2094"
sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234
url: "https://pub.dev"
source: hosted
version: "3.0.2"
version: "3.1.0"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "4eae912628763eb48fc214522e58e942fd16ce195407dbf45638239523c759a6"
sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.2.0"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: "44d79408ce9f07052095ef1f9a693c258d6373dc3944249374e30eff7219ccb0"
sha256: "7fd2f55fe86cea2897b963e864dc01a7eb0719ecc65fcef4c1cc3d686d718bb2"
url: "https://pub.dev"
source: hosted
version: "2.0.14"
version: "2.2.0"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: "387e227c4b979034cc52afb11d66b04ed9b288ca1f45beeef39b2ea69e714fa5"
sha256: "7754a1ad30ee896b265f8d14078b0513a4dba28d358eabb9d5f339886f4a1adc"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
version: "3.1.0"
vector_math:
dependency: transitive
description:
... ... @@ -252,6 +244,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
web:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
sdks:
dart: ">=2.18.0 <4.0.0"
flutter: ">=3.7.0"
dart: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
... ...
import 'dart:async';
import 'package:flutter/material.dart' hide ModalBottomSheetRoute;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
const Radius kDefaultBarTopRadius = Radius.circular(15);
... ... @@ -96,7 +97,7 @@ Future<T?> showBarModalBottomSheet<T>({
assert(debugCheckHasMediaQuery(context));
assert(debugCheckHasMaterialLocalizations(context));
final result = await Navigator.of(context, rootNavigator: useRootNavigator)
.push(ModalBottomSheetRoute<T>(
.push(ModalSheetRoute<T>(
builder: builder,
bounce: bounce,
closeProgressThreshold: closeProgressThreshold,
... ...
... ... @@ -26,7 +26,7 @@ Future<T?> showMaterialModalBottomSheet<T>({
assert(debugCheckHasMediaQuery(context));
assert(debugCheckHasMaterialLocalizations(context));
final result = await Navigator.of(context, rootNavigator: useRootNavigator)
.push(ModalBottomSheetRoute<T>(
.push(ModalSheetRoute<T>(
builder: builder,
closeProgressThreshold: closeProgressThreshold,
containerBuilder: _materialContainerBuilder(
... ...
... ... @@ -20,7 +20,7 @@ class MaterialWithModalsPageRoute<T> extends MaterialPageRoute<T> {
builder: builder,
maintainState: maintainState);
ModalBottomSheetRoute? _nextModalRoute;
ModalSheetRoute? _nextModalRoute;
@override
bool canTransitionTo(TransitionRoute<dynamic> nextRoute) {
... ... @@ -29,12 +29,12 @@ class MaterialWithModalsPageRoute<T> extends MaterialPageRoute<T> {
(nextRoute is CupertinoPageRoute && !nextRoute.fullscreenDialog) ||
(nextRoute is MaterialWithModalsPageRoute &&
!nextRoute.fullscreenDialog) ||
(nextRoute is ModalBottomSheetRoute);
(nextRoute is ModalSheetRoute);
}
@override
void didChangeNext(Route? nextRoute) {
if (nextRoute is ModalBottomSheetRoute) {
if (nextRoute is ModalSheetRoute) {
_nextModalRoute = nextRoute;
}
... ... @@ -42,11 +42,6 @@ class MaterialWithModalsPageRoute<T> extends MaterialPageRoute<T> {
}
@override
void didPopNext(Route nextRoute) {
super.didPopNext(nextRoute);
}
@override
bool didPop(T? result) {
_nextModalRoute = null;
return super.didPop(result);
... ...
... ... @@ -5,10 +5,10 @@ packages:
dependency: transitive
description:
name: async
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.10.0"
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
... ... @@ -21,10 +21,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
version: "1.3.0"
clock:
dependency: transitive
description:
... ... @@ -37,10 +37,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.17.2"
fake_async:
dependency: transitive
description:
... ... @@ -59,54 +59,46 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
js:
dependency: transitive
description:
name: js
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
url: "https://pub.dev"
source: hosted
version: "0.6.5"
lints:
dependency: "direct dev"
description:
name: lints
sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593"
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "2.1.1"
matcher:
dependency: transitive
description:
name: matcher
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
url: "https://pub.dev"
source: hosted
version: "0.12.13"
version: "0.12.16"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
version: "0.5.0"
meta:
dependency: transitive
description:
name: meta
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
version: "1.9.1"
path:
dependency: transitive
description:
name: path
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
url: "https://pub.dev"
source: hosted
version: "1.8.2"
version: "1.8.3"
sky_engine:
dependency: transitive
description: flutter
... ... @@ -116,10 +108,10 @@ packages:
dependency: transitive
description:
name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.10.0"
stack_trace:
dependency: transitive
description:
... ... @@ -156,10 +148,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
url: "https://pub.dev"
source: hosted
version: "0.4.16"
version: "0.6.0"
vector_math:
dependency: transitive
description:
... ... @@ -168,6 +160,13 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
web:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
sdks:
dart: ">=2.18.0 <4.0.0"
flutter: ">=3.7.0"
dart: ">=3.1.0-185.0.dev <4.0.0"
... ...
name: modal_bottom_sheet
description: 'Create awesome and powerful modal bottom sheets. Material, Cupertino iOS 13 or create your own style'
version: 3.0.0-pre
version: 3.0.1
homepage: 'https://github.com/jamesblasco/modal_bottom_sheet'
environment:
sdk: ">=2.17.0 <3.0.0"
flutter: ">=3.7.0"
dependencies:
flutter:
... ...
... ... @@ -47,7 +47,7 @@ Stack(
```
The widget has several parameters that allow fully costumization of the sheet
The widget has several parameters that allow fully customization of the sheet
#### Add an initial position
... ... @@ -60,7 +60,7 @@ Sheet(
)
```
#### Clamp the sheet between a min and maximun values
#### Clamp the sheet between a min and maximum values
You can set a `minExtent` and `maxExtent` to limit the position of the Sheet between those values
... ... @@ -89,9 +89,9 @@ Sheet(
#### Fit modes
By default the sheet height will be the minimun between the max available height and the one recommended by the child.
By default the sheet height will be the minimum between the max available height and the one recommended by the child.
It is possible to force the sheet child to be the maxium size available by setting `SheetFit.expand`
It is possible to force the sheet child to be the maximum size available by setting `SheetFit.expand`
```dart
Sheet(
... ... @@ -104,7 +104,7 @@ Sheet(
#### Resizable
By default the sheet has a fixed sized and it is vertically translated according to the user drag.
It is posible to make the sheet change the height of the child by setting `resize: true`
It is possible to make the sheet change the height of the child by setting `resize: true`
This will force the child to fit the available visual space.
```dart
... ... @@ -131,7 +131,7 @@ Sheet(
#### Control the position of the sheet
It is possible to pass a `SheetController` to control programatically the position of the sheet.
It is possible to pass a `SheetController` to control programmatically the position of the sheet.
```dart
SheetController controller = SheetController();
... ...
... ... @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
... ... @@ -171,10 +171,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
... ... @@ -185,6 +187,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
... ... @@ -288,7 +291,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 8734Y6QF3F;
DEVELOPMENT_TEAM = 87RQQPQ85J;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
... ... @@ -425,7 +428,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 8734Y6QF3F;
DEVELOPMENT_TEAM = 87RQQPQ85J;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
... ... @@ -456,7 +459,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 8734Y6QF3F;
DEVELOPMENT_TEAM = 87RQQPQ85J;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
... ...
... ... @@ -43,5 +43,7 @@
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
... ...
... ... @@ -5,28 +5,112 @@ class NestedScrollModal extends StatelessWidget {
@override
Widget build(BuildContext context) {
return NestedScrollView(
physics: const ClampingScrollPhysics(),
controller: PrimaryScrollController.of(context),
final List<String> tabs = <String>['Tab 1', 'Tab 2'];
return DefaultTabController(
length: tabs.length, // This is the number of tabs.
child: Scaffold(
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
// These are the slivers that show up in the "outer" scroll view.
return <Widget>[
SliverList(
delegate: SliverChildListDelegate(
<Widget>[
Container(height: 300, color: Colors.blue),
],
SliverOverlapAbsorber(
// This widget takes the overlapping behavior of the SliverAppBar,
// and redirects it to the SliverOverlapInjector below. If it is
// missing, then it is possible for the nested "inner" scroll view
// below to end up under the SliverAppBar even when the inner
// scroll view thinks it has not been scrolled.
// This is not necessary if the "headerSliverBuilder" only builds
// widgets that do not overlap the next sliver.
handle:
NestedScrollView.sliverOverlapAbsorberHandleFor(context),
sliver: SliverAppBar(
title:
const Text('Books'), // This is the title in the app bar.
pinned: true,
expandedHeight: 150.0,
// The "forceElevated" property causes the SliverAppBar to show
// a shadow. The "innerBoxIsScrolled" parameter is true when the
// inner scroll view is scrolled beyond its "zero" point, i.e.
// when it appears to be scrolled below the SliverAppBar.
// Without this, there are cases where the shadow would appear
// or not appear inappropriately, because the SliverAppBar is
// not actually aware of the precise position of the inner
// scroll views.
forceElevated: innerBoxIsScrolled,
bottom: TabBar(
// These are the widgets to put in each tab in the tab bar.
tabs: tabs.map((String name) => Tab(text: name)).toList(),
),
),
),
];
},
body: ListView.builder(
itemBuilder: (BuildContext context, int index) {
return Container(
height: 100,
color: index.isOdd ? Colors.green : Colors.orange,
body: TabBarView(
// These are the contents of the tab views, below the tabs.
children: tabs.map((String name) {
return SafeArea(
top: false,
bottom: false,
child: Builder(
// This Builder is needed to provide a BuildContext that is
// "inside" the NestedScrollView, so that
// sliverOverlapAbsorberHandleFor() can find the
// NestedScrollView.
builder: (BuildContext context) {
return CustomScrollView(
controller: PrimaryScrollController.of(context),
// The "controller" and "primary" members should be left
// unset, so that the NestedScrollView can control this
// inner scroll view.
// If the "controller" property is set, then this scroll
// view will not be associated with the NestedScrollView.
// The PageStorageKey should be unique to this ScrollView;
// it allows the list to remember its scroll position when
// the tab view is not on the screen.
key: PageStorageKey<String>(name),
slivers: <Widget>[
SliverOverlapInjector(
// This is the flip side of the SliverOverlapAbsorber
// above.
handle:
NestedScrollView.sliverOverlapAbsorberHandleFor(
context),
),
SliverPadding(
padding: const EdgeInsets.all(8.0),
// In this example, the inner scroll view has
// fixed-height list items, hence the use of
// SliverFixedExtentList. However, one could use any
// sliver widget here, e.g. SliverList or SliverGrid.
sliver: SliverFixedExtentList(
// The items in this example are fixed to 48 pixels
// high. This matches the Material Design spec for
// ListTile widgets.
itemExtent: 48.0,
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
// This builder is called for each child.
// In this example, we just number each list item.
return ListTile(
title: Text('Item $index'),
);
},
itemCount: 12,
// The childCount of the SliverChildBuilderDelegate
// specifies how many children this inner list
// has. In this example, each tab has a list of
// exactly 30 items, but this is arbitrary.
childCount: 30,
),
),
),
],
);
},
),
);
}).toList(),
),
),
),
);
}
... ...
... ... @@ -66,7 +66,7 @@ class _GoRouterBooksAppState extends State<GoRouterBooksApp> {
name: 'book',
path: 'book/:bid',
pageBuilder: (BuildContext context, GoRouterState state) {
final String id = state.params['bid']!;
final String id = state.pathParameters['bid']!;
final Book? book =
books.firstWhereOrNull((Book b) => b.id == id);
return CupertinoSheetPage<void>(
... ... @@ -76,8 +76,8 @@ class _GoRouterBooksAppState extends State<GoRouterBooksApp> {
),
);
},
redirect: (GoRouterState state) {
final String id = state.params['bid']!;
redirect: (context, state) {
final String id = state.pathParameters['bid']!;
final Book? book =
books.firstWhereOrNull((Book b) => b.id == id);
if (book == null) {
... ...
... ... @@ -17,6 +17,7 @@ import 'package:flutter/material.dart';
import 'package:sheet/route.dart';
import 'package:sheet/sheet.dart';
import 'examples/route/examples/modal_with_nested_scroll.dart';
import 'examples/route/navigation/go_router.dart';
class RouteExamplePage extends StatelessWidget {
... ... @@ -251,15 +252,14 @@ class RouteExamplePage extends StatelessWidget {
),
),
// TODO(jaime): It does not work for nested scroll yet
// ListTile(
// title: Text('Modal with Nested Scroll'),
// onTap: () => Navigator.of(context).push(
// CupertinoSheetRoute<void>(
// builder: (context) => NestedScrollModal(),
// ),
// ),
// ),
ListTile(
title: Text('Modal with Nested Scroll'),
onTap: () => Navigator.of(context).push(
CupertinoSheetRoute<void>(
builder: (context) => NestedScrollModal(),
),
),
),
ListTile(
title: const Text('Modal with PageView'),
onTap: () => Navigator.of(context).push(
... ...
... ... @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {
/* Begin PBXAggregateTarget section */
... ... @@ -182,7 +182,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "The Flutter Authors";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
... ... @@ -235,6 +235,7 @@
/* Begin PBXShellScriptBuildPhase section */
3399D490228B24CF009A79C7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
... ... @@ -344,7 +345,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
... ... @@ -427,7 +428,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
... ... @@ -474,7 +475,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
... ...
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
... ...
... ... @@ -45,10 +45,10 @@ packages:
dependency: "direct main"
description:
name: cupertino_icons
sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d
url: "https://pub.dev"
source: hosted
version: "1.0.5"
version: "1.0.6"
equatable:
dependency: "direct main"
description:
... ... @@ -84,18 +84,18 @@ packages:
dependency: "direct main"
description:
name: go_router
sha256: aec1999abe8b2f131eda46d4c9629048fb1befed2b65e90b73f9193a300ce489
sha256: "2cb236ba3f923043fdbe14a6a3a796b8c250e85658e28caee3e86c0c275847e5"
url: "https://pub.dev"
source: hosted
version: "4.5.1"
version: "8.2.0"
logging:
dependency: transitive
description:
name: logging
sha256: c0bbfe94d46aedf9b8b3e695cf3bd48c8e14b35e3b2c639e0aa7755d589ba946
sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.2.0"
matcher:
dependency: transitive
description:
... ... @@ -222,4 +222,4 @@ packages:
version: "0.1.4-beta"
sdks:
dart: ">=3.1.0-185.0.dev <4.0.0"
flutter: ">=3.7.0"
flutter: ">=3.3.0"
... ...
... ... @@ -4,18 +4,17 @@ publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.17.0 <3.0.0"
flutter: ">=3.7.0"
sdk: ">=3.0.0 <4.0.0"
dependencies:
flutter:
sdk: flutter
equatable: ^2.0.3
equatable: ^2.0.5
cupertino_icons: ^1.0.0
provider: ^6.0.2
provider: ^6.0.5
sheet:
path: ../
go_router: ^4.3.0
go_router: ^8.0.5
dev_dependencies:
flutter_test:
... ...
... ... @@ -169,7 +169,7 @@ class BouncingSheetPhysics extends ScrollPhysics with SheetPhysics {
@override
Simulation? createBallisticSimulation(
ScrollMetrics position, double velocity) {
final Tolerance tolerance = toleranceFor(position);
if (position.outOfRange) {
return BouncingScrollSimulation(
spring: const SpringDescription(
... ... @@ -181,7 +181,7 @@ class BouncingSheetPhysics extends ScrollPhysics with SheetPhysics {
velocity: velocity,
leadingExtent: position.minScrollExtent,
trailingExtent: position.maxScrollExtent,
tolerance: tolerance,
tolerance: toleranceFor(position),
);
}
return super.createBallisticSimulation(position, velocity);
... ... @@ -266,7 +266,6 @@ class NoMomentumSheetPhysics extends ScrollPhysics with SheetPhysics {
@override
Simulation? createBallisticSimulation(
ScrollMetrics position, double velocity) {
final Tolerance tolerance = toleranceFor(position);
if (position.outOfRange) {
double? end;
if (position.pixels > position.maxScrollExtent) {
... ... @@ -280,7 +279,7 @@ class NoMomentumSheetPhysics extends ScrollPhysics with SheetPhysics {
position.pixels,
end!,
math.min(0.0, velocity),
tolerance: tolerance,
tolerance: toleranceFor(position),
);
}
return null;
... ... @@ -514,7 +513,7 @@ class SnapSheetPhysics extends ScrollPhysics with SheetPhysics {
}
/// Describes how [SheetScrollable] widgets should behave.
class SheetBehaviour extends ScrollBehavior {
class SheetBehavior extends ScrollBehavior {
static const SheetPhysics _clampingPhysics =
NoMomentumSheetPhysics(parent: RangeMaintainingScrollPhysics());
... ...
... ... @@ -14,16 +14,11 @@ mixin PreviousSheetRouteMixin<T> on PageRoute<T> {
class MaterialExtendedPageRoute<T> extends MaterialPageRoute<T>
with PreviousSheetRouteMixin<T>, DelegatedTransitionsRoute<T> {
MaterialExtendedPageRoute({
required WidgetBuilder builder,
RouteSettings? settings,
bool maintainState = true,
bool fullscreenDialog = false,
}) : super(
builder: builder,
maintainState: maintainState,
settings: settings,
fullscreenDialog: fullscreenDialog,
);
required super.builder,
super.settings,
super.maintainState = true,
super.fullscreenDialog = false,
});
}
class MaterialExtendedPage<T> extends Page<T> {
... ... @@ -32,15 +27,11 @@ class MaterialExtendedPage<T> extends Page<T> {
required this.child,
this.maintainState = true,
this.fullscreenDialog = false,
LocalKey? key,
String? name,
Object? arguments,
String? restorationId,
}) : super(
key: key,
name: name,
arguments: arguments,
restorationId: restorationId);
super.key,
super.name,
super.arguments,
super.restorationId,
});
/// The content to be shown in the [Route] created by this page.
final Widget child;
... ... @@ -89,18 +80,12 @@ class _PageBasedMaterialPageRoute<T> extends MaterialExtendedPageRoute<T> {
class CupertinoExtendedPageRoute<T> extends CupertinoPageRoute<T>
with PreviousSheetRouteMixin<T>, DelegatedTransitionsRoute<T> {
CupertinoExtendedPageRoute({
required WidgetBuilder builder,
String? title,
RouteSettings? settings,
bool maintainState = true,
bool fullscreenDialog = false,
}) : super(
builder: builder,
title: title,
maintainState: maintainState,
settings: settings,
fullscreenDialog: fullscreenDialog,
);
required super.builder,
super.title,
super.settings,
super.maintainState = true,
super.fullscreenDialog = false,
});
}
class CupertinoExtendedPage<T> extends Page<T> {
... ... @@ -110,15 +95,11 @@ class CupertinoExtendedPage<T> extends Page<T> {
this.maintainState = true,
this.title,
this.fullscreenDialog = false,
LocalKey? key,
String? name,
Object? arguments,
String? restorationId,
}) : super(
key: key,
name: name,
arguments: arguments,
restorationId: restorationId);
super.key,
super.name,
super.arguments,
super.restorationId,
});
/// The content to be shown in the [Route] created by this page.
final Widget child;
... ...
... ... @@ -26,7 +26,7 @@ const Radius _kCupertinoSheetTopRadius = Radius.circular(10.0);
const Radius _kRoundedDeviceRadius = Radius.circular(38.5);
/// Minimal distance from the top of the screen to the top of the previous route
/// It will be used ff the top safearea is less than this value.
/// It will be used ff the top safe area is less than this value.
/// In iPhones the top SafeArea is more or equal to this distance.
const double _kSheetMinimalOffset = 10;
... ... @@ -38,18 +38,17 @@ const double _kRoundedDeviceStatusBarHeight = 20;
const Curve _kCupertinoSheetCurve = Curves.easeOutExpo;
const Curve _kCupertinoTransitionCurve = Curves.linear;
/// Wraps the child into a cupertino modal sheet appareance. This is used to
/// Wraps the child into a cupertino modal sheet appearance. This is used to
/// create a [SheetRoute].
///
/// Clip the child widget to rectangle with top rounded corners and adds
/// top padding and top safe area.
class _CupertinoSheetDecorationBuilder extends StatelessWidget {
const _CupertinoSheetDecorationBuilder({
Key? key,
required this.child,
required this.topRadius,
this.backgroundColor,
}) : super(key: key);
});
/// The child contained by the modal sheet
final Widget child;
... ... @@ -86,22 +85,22 @@ class _CupertinoSheetDecorationBuilder extends StatelessWidget {
}
/// A modal route that overlays a widget over the current route and animates
/// it from the bottom with a cupertino modal sheet appareance
/// it from the bottom with a cupertino modal sheet appearance
///
/// Clip the child widget to rectangle with top rounded corners and adds
/// top padding and top safe area.
///
/// * [CupertinoSheetPage], which is the [Page] version of this class
class CupertinoSheetRoute<T> extends SheetRoute<T> {
CupertinoSheetRoute(
{required WidgetBuilder builder,
List<double>? stops,
CupertinoSheetRoute({
required WidgetBuilder builder,
super.stops,
double initialStop = 1,
RouteSettings? settings,
super.settings,
Color? backgroundColor,
bool maintainState = true,
super.fit})
: super(
super.maintainState = true,
super.fit,
}) : super(
builder: (BuildContext context) {
return _CupertinoSheetDecorationBuilder(
child: Builder(builder: builder),
... ... @@ -109,11 +108,8 @@ class CupertinoSheetRoute<T> extends SheetRoute<T> {
topRadius: _kCupertinoSheetTopRadius,
);
},
settings: settings,
animationCurve: _kCupertinoSheetCurve,
stops: stops,
initialExtent: initialStop,
maintainState: maintainState,
);
@override
... ... @@ -239,7 +235,7 @@ class CupertinoSheetBottomRouteTransition extends StatelessWidget {
// Currently iOS does not provide any way to detect the radius of the
// screen device. Right not we detect if the safe area has the size
// for the device that contain a notch as they are the ones rigth
// for the device that contain a notch as they are the ones right
// now that has corners with radius
Radius _getRadiusForDevice(MediaQueryData mediaQuery) {
final double topPadding = mediaQuery.padding.top;
... ... @@ -305,7 +301,7 @@ class CupertinoSheetBottomRouteTransition extends StatelessWidget {
}
/// A modal page that overlays a widget over the current route and animates
/// it from the bottom with a cupertino modal sheet appareance
/// it from the bottom with a cupertino modal sheet appearance
///
/// Clip the child widget to rectangle with top rounded corners and adds
/// top padding and top safe area.
... ...
... ... @@ -3,6 +3,7 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:sheet/route.dart';
import 'package:sheet/sheet.dart';
... ... @@ -27,7 +28,7 @@ const Color _kBarrierColor = Color(0x59000000);
/// See also:
///
/// * [SheetPage], which is a [Page] of this class.
/// * [CupertinoSheetRoute], which is has an iOS appareance
/// * [CupertinoSheetRoute], which is has an iOS appearance
class SheetRoute<T> extends PageRoute<T> with DelegatedTransitionsRoute<T> {
SheetRoute({
required this.builder,
... ... @@ -45,9 +46,9 @@ class SheetRoute<T> extends PageRoute<T> with DelegatedTransitionsRoute<T> {
this.maintainState = true,
this.willPopThreshold = _kWillPopThreshold,
this.decorationBuilder,
RouteSettings? settings,
super.settings,
}) : transitionDuration = duration ?? _kSheetTransitionDuration,
super(settings: settings, fullscreenDialog: true);
super(fullscreenDialog: true);
/// Builds the primary contents of the route.
final WidgetBuilder builder;
... ... @@ -85,7 +86,7 @@ class SheetRoute<T> extends PageRoute<T> with DelegatedTransitionsRoute<T> {
/// Drag threshold to block any interaction if [Route.willPop] returns false
/// See also:
/// * [WillPopScope], that allow to block an attemp to close a [ModalRoute]
/// * [WillPopScope], that allow to block an attempt to close a [ModalRoute]
final double willPopThreshold;
/// {@macro flutter.widgets.TransitionRoute.transitionDuration}
... ... @@ -95,7 +96,7 @@ class SheetRoute<T> extends PageRoute<T> with DelegatedTransitionsRoute<T> {
/// The semantic label used for a sheet modal route.
final String? sheetLabel;
/// Wraps the child in a custom sheet decoration appareance
/// Wraps the child in a custom sheet decoration appearance
///
/// The default value is null.
final SheetDecorationBuilder? decorationBuilder;
... ... @@ -225,9 +226,9 @@ class SheetPage<T> extends Page<T> {
const SheetPage(
{required this.child,
this.maintainState = true,
LocalKey? key,
String? name,
Object? arguments,
super.key,
super.name,
super.arguments,
this.initialExtent = 1,
this.stops,
this.draggable = true,
... ... @@ -241,12 +242,7 @@ class SheetPage<T> extends Page<T> {
this.barrierDismissible = true,
this.willPopThreshold = _kWillPopThreshold,
this.decorationBuilder})
: transitionDuration = duration ?? _kSheetTransitionDuration,
super(
key: key,
name: name,
arguments: arguments,
);
: transitionDuration = duration ?? _kSheetTransitionDuration;
/// Relative extent up to where the sheet is animated when pushed for
/// the first time.
... ... @@ -287,7 +283,7 @@ class SheetPage<T> extends Page<T> {
/// Drag threshold to block any interaction if [Route.willPop] returns false
/// See also:
/// * [WillPopScope], that allow to block an attemp to close a [ModalRoute]
/// * [WillPopScope], that allow to block an attempt to close a [ModalRoute]
final double willPopThreshold;
/// {@macro flutter.widgets.TransitionRoute.transitionDuration}
... ... @@ -302,7 +298,7 @@ class SheetPage<T> extends Page<T> {
final String? barrierLabel;
/// Wraps the child in a custom sheet decoration appareance
/// Wraps the child in a custom sheet decoration appearance
///
/// The default value is null.
final SheetDecorationBuilder? decorationBuilder;
... ... @@ -332,30 +328,17 @@ class SheetPage<T> extends Page<T> {
class _PageBasedSheetRoute<T> extends SheetRoute<T> {
_PageBasedSheetRoute({
required SheetPage<T> page,
Color? barrierColor,
SheetPhysics? physics,
SheetFit fit = SheetFit.expand,
Curve? animationCurve,
bool barrierDismissible = true,
bool draggable = true,
Duration? duration,
List<double>? stops,
double initialExtent = 1,
SheetDecorationBuilder? decorationBuilder,
}) : super(
settings: page,
builder: (BuildContext context) => page.child,
physics: physics,
fit: fit,
stops: stops,
initialExtent: initialExtent,
barrierDismissible: barrierDismissible,
barrierColor: barrierColor,
draggable: draggable,
animationCurve: animationCurve,
duration: duration,
decorationBuilder: decorationBuilder,
);
super.physics,
required super.fit,
super.animationCurve,
required super.barrierDismissible,
super.barrierColor,
required super.draggable,
super.duration,
super.stops,
required super.initialExtent,
super.decorationBuilder,
}) : super(settings: page, builder: (BuildContext context) => page.child);
SheetPage<T> get _page => settings as SheetPage<T>;
... ... @@ -392,7 +375,6 @@ class __SheetRouteContainerState extends State<_SheetRouteContainer>
curve: route.animationCurve ?? Curves.easeOut,
);
});
super.initState();
}
... ... @@ -406,8 +388,11 @@ class __SheetRouteContainerState extends State<_SheetRouteContainer>
void onSheetExtentUpdate() {
if (_routeController.value != _sheetController.animation.value) {
if (route.isCurrent &&
!_firstAnimation &&
!_sheetController.position.preventingDrag &&
route.shouldPreventPopForExtent(_sheetController.animation.value)) {
route.shouldPreventPopForExtent(_sheetController.animation.value) &&
_sheetController.position.userScrollDirection ==
ScrollDirection.forward) {
preventPop();
return;
}
... ... @@ -420,9 +405,10 @@ class __SheetRouteContainerState extends State<_SheetRouteContainer>
toHigh: 1,
);
_routeController.value = animationValue;
if (_sheetController.animation.value == 0) {
widget.sheetRoute.navigator?.pop();
_routeController.value = 0.001;
_routeController.animateBack(0);
route.navigator?.pop();
}
}
}
... ... @@ -436,6 +422,8 @@ class __SheetRouteContainerState extends State<_SheetRouteContainer>
if (!_routeController.isAnimating) {
return;
}
// widget.sheetRoute.navigator!.userGestureInProgressNotifier.value = false;
if (!_firstAnimation &&
_routeController.value != _sheetController.animation.value) {
if (_routeController.status == AnimationStatus.forward) {
... ... @@ -462,11 +450,12 @@ class __SheetRouteContainerState extends State<_SheetRouteContainer>
@protected
void preventPop() {
_sheetController.position.preventDrag();
_sheetController.relativeAnimateTo(
1,
_sheetController.position.animateTo(
_sheetController.position.maxScrollExtent,
duration: const Duration(milliseconds: 400),
curve: Curves.easeInOut,
);
route.willPop().then(
(RoutePopDisposition disposition) {
if (disposition == RoutePopDisposition.pop) {
... ...
... ... @@ -88,7 +88,7 @@ class SheetPrimaryScrollPosition extends ScrollPositionWithSingleContext {
final SheetContext sheetContext;
SheetPosition get sheetPosition => sheetContext.position;
bool sheetShouldSheetAcceptUserOffser(double delta) {
bool sheetShouldSheetAcceptUserOffset(double delta) {
// Can drag down if list already on the top
final bool canDragForward = delta >= 0 && pixels <= minScrollExtent;
... ... @@ -106,63 +106,37 @@ class SheetPrimaryScrollPosition extends ScrollPositionWithSingleContext {
if (sheetPosition.preventingDrag) {
return;
}
if (sheetShouldSheetAcceptUserOffser(delta)) {
final double pixels = sheetPosition.pixels -
sheetPosition.physics.applyPhysicsToUserOffset(sheetPosition, delta);
sheetPosition.forcePixels(
pixels.clamp(
sheetPosition.minScrollExtent, sheetPosition.maxScrollExtent),
);
if (sheetShouldSheetAcceptUserOffset(delta)) {
if (sheetPosition.activity is! _SheetScrollActivity) {
sheetPosition.beginActivity(_SheetScrollActivity(sheetPosition));
}
final double sheetDelta =
sheetPosition.physics.applyPhysicsToUserOffset(sheetPosition, delta);
sheetPosition.applyUserOffset(sheetDelta);
return;
} else {
super.applyUserOffset(delta);
sheetPosition.goIdle();
if (sheetPosition.activity is! HoldScrollActivity) {
sheetPosition.hold(() {});
}
}
}
@override
void goBallistic(double velocity) {
if (sheetPosition.preventingDrag) {
beginActivity(
BallisticScrollActivity(
this,
ScrollSpringSimulation(
SpringDescription.withDampingRatio(
mass: 0.5,
stiffness: 100.0,
ratio: 1.1,
),
pixels,
0,
velocity,
),
context.vsync,
true,
),
);
goIdle();
return;
}
final bool sheetDragging = sheetPosition.activity!.isScrolling;
if (sheetDragging &&
sheetPosition.hasContentDimensions &&
!sheetPosition.preventingDrag &&
sheetPosition.activity!.isScrolling) {
if (sheetPosition.hasContentDimensions) {
sheetPosition.goBallistic(velocity);
} else {
sheetPosition.goIdle();
}
if (!sheetDragging) {
super.goBallistic(velocity);
return;
} else if (velocity > 0.0 &&
if (velocity > 0.0 &&
sheetPosition.pixels >= sheetPosition.maxScrollExtent ||
(velocity < 0.0 && pixels > 0)) {
// super.goBallistic(velocity);
super.goBallistic(velocity);
return;
} else if (outOfRange) {
beginActivity(
... ... @@ -183,11 +157,9 @@ class SheetPrimaryScrollPosition extends ScrollPositionWithSingleContext {
),
);
return;
}
} else {
goIdle();
return;
}
}
//@override
//double get pixels => super.pixels + viewportDimension;
}
... ...
... ... @@ -196,11 +196,11 @@ class SheetScrollable extends StatefulWidget {
/// {@macro flutter.widgets.shadow.scrollBehavior}
///
/// [SheetBehaviour]s also provide [SheetPhysics]. If an explicit
/// [SheetBehavior]s also provide [SheetPhysics]. If an explicit
/// [ScrollPhysics] is provided in [physics], it will take precedence,
/// followed by [scrollBehavior], and then the inherited ancestor
/// [SheetBehaviour].
final SheetBehaviour? scrollBehavior;
/// [SheetBehavior].
final SheetBehavior? scrollBehavior;
final double? initialExtent;
... ... @@ -328,7 +328,7 @@ class SheetState extends State<SheetScrollable>
@override
AxisDirection get axisDirection => widget.axisDirection;
late SheetBehaviour _configuration;
late SheetBehavior _configuration;
ScrollPhysics? _physics;
SheetController? _fallbackScrollController;
... ... @@ -339,7 +339,7 @@ class SheetState extends State<SheetScrollable>
// Only call this from places that will definitely trigger a rebuild.
void _updatePosition() {
_configuration = widget.scrollBehavior ?? SheetBehaviour();
_configuration = widget.scrollBehavior ?? SheetBehavior();
_physics = _configuration.getScrollPhysics(context);
if (widget.physics != null) {
_physics = widget.physics!.applyTo(_physics);
... ...
... ... @@ -21,14 +21,14 @@ enum SheetFit {
/// The constraints passed to the child from the sheet are loosened.
///
/// For example, if the sheet has expand constraints with 600 high, this would allow the child of the sheet to have any
/// height from zero to maximun available.
/// height from zero to maximum available.
loose,
/// The constraints passed to the stack from its parent are tightened to the
/// biggest size allowed.
///
/// For example, if the sheet has loose constraints with a height in the
/// range 0 to 600, then the child of the shhet would all be sized
/// range 0 to 600, then the child of the sheet would all be sized
/// as 600 high.
expand,
}
... ... @@ -54,7 +54,7 @@ typedef SheetDecorationBuilder = Widget Function(
///
/// By default the bottom sheet inherits the values provided by the
/// material theme and prioritize the ones passed in the constructor.
/// Use [Sheet.raw] if you wish to remove the Material appareance and
/// Use [Sheet.raw] if you wish to remove the Material appearance and
/// build your own
///
/// See also:
... ... @@ -115,7 +115,7 @@ class Sheet extends StatelessWidget {
/// Empty space to surround the [child].
final EdgeInsets padding;
/// The inital height to use when displaying the widget.
/// The initial height to use when displaying the widget.
///
/// This value will be clamped between [minExtent] and [maxExtent]
///
... ... @@ -129,12 +129,12 @@ class Sheet extends StatelessWidget {
/// The maximum height to use when displaying the widget.
///
/// This value will be clamped to be as maximun the parent container's height
/// This value will be clamped to be as maximum the parent container's height
///
/// The default value is `double.infinity`.
final double? maxExtent;
/// The height area of the minimun interaction zone to allow to
/// The height area of the minimum interaction zone to allow to
/// drag up the sheet when it is closed
///
/// The default value is `0`.
... ... @@ -148,10 +148,10 @@ class Sheet extends StatelessWidget {
/// The default value is `false`.
final bool resizable;
/// If resizable true, the minimun height that the sheet can be.
/// If resizable true, the minimum height that the sheet can be.
/// The content of the sheet will be resized to fit the
/// available visible space until this value, after that will be
/// translated keeping this minimun height.
/// translated keeping this minimum height.
///
/// The default value is `0`.
final double? minResizableExtent;
... ... @@ -212,7 +212,7 @@ class Sheet extends StatelessWidget {
/// will be [Clip.none].
final Clip? clipBehavior;
/// Wraps the child in a custom sheet decoration appareance
/// Wraps the child in a custom sheet decoration appearance
/// If null, the sheet has material appareance
///
/// The default value is null.
... ... @@ -222,8 +222,7 @@ class Sheet extends StatelessWidget {
return child;
}
@override
Widget build(BuildContext context) {
Widget decorationBuild(BuildContext context, Widget child) {
final SheetDecorationBuilder decorationBuilder = this.decorationBuilder ??
(BuildContext context, Widget child) {
final BottomSheetThemeData bottomSheetTheme =
... ... @@ -244,6 +243,11 @@ class Sheet extends StatelessWidget {
child: child,
);
};
return decorationBuilder(context, child);
}
@override
Widget build(BuildContext context) {
final SheetController? effectiveController =
controller ?? DefaultSheetController.of(context);
final double? initialExtent =
... ... @@ -254,7 +258,7 @@ class Sheet extends StatelessWidget {
physics: physics,
controller: effectiveController,
axisDirection: AxisDirection.down,
scrollBehavior: SheetBehaviour(),
scrollBehavior: SheetBehavior(),
viewportBuilder: (BuildContext context, ViewportOffset offset) {
return _DefaultSheetScrollController(
child: ScrollToTopStatusBarHandler(
... ... @@ -274,10 +278,7 @@ class Sheet extends StatelessWidget {
child: Builder(
key: const Key('_sheet_child'),
builder: (BuildContext context) {
return decorationBuilder(
context,
child,
);
return decorationBuild(context, child);
},
),
),
... ... @@ -317,12 +318,7 @@ class _DefaultSheetScrollController extends StatelessWidget {
/// * [SheetPosition], which manages the positioning logic for
/// this controller.
class SheetController extends ScrollController {
SheetController({
String? debugLabel,
}) : super(
debugLabel: debugLabel,
initialScrollOffset: 0,
);
SheetController({super.debugLabel}) : super(initialScrollOffset: 0);
final ProxyAnimation _animation = ProxyAnimation();
Animation<double> get animation => _animation;
... ... @@ -411,20 +407,13 @@ class SheetController extends ScrollController {
/// * [_SheetScrollController], which uses this as its [ScrollPosition].
class SheetPosition extends ScrollPositionWithSingleContext {
SheetPosition({
required ScrollPhysics physics,
required SheetContext context,
double initialPixels = 0.0,
bool keepScrollOffset = true,
ScrollPosition? oldPosition,
String? debugLabel,
}) : super(
physics: physics,
context: context,
initialPixels: initialPixels,
keepScrollOffset: keepScrollOffset,
oldPosition: oldPosition,
debugLabel: debugLabel,
);
required super.physics,
required SheetContext super.context,
super.initialPixels = 0.0,
super.keepScrollOffset = true,
super.oldPosition,
super.debugLabel,
});
late final SheetPrimaryScrollController _scrollController =
SheetPrimaryScrollController(sheetContext: context as SheetContext);
... ... @@ -540,15 +529,15 @@ class SheetPosition extends ScrollPositionWithSingleContext {
class SheetViewport extends SingleChildRenderObjectWidget {
const SheetViewport({
Key? key,
super.key,
this.axisDirection = AxisDirection.down,
required this.offset,
this.minExtent,
this.maxExtent,
Widget? child,
super.child,
required this.fit,
required this.clipBehavior,
}) : super(key: key, child: child);
});
final AxisDirection axisDirection;
final ViewportOffset offset;
... ... @@ -801,13 +790,13 @@ class RenderSheetViewport extends RenderBox
minHeight = overflowHeight;
}
final BoxConstraints childContstraints = BoxConstraints(
final BoxConstraints childConstraints = BoxConstraints(
minHeight: minHeight,
maxHeight: maxHeight,
minWidth: constraints.minWidth,
maxWidth: constraints.maxWidth,
);
child!.layout(childContstraints, parentUsesSize: true);
child!.layout(childConstraints, parentUsesSize: true);
size = constraints.biggest;
}
... ... @@ -955,7 +944,7 @@ class RenderSheetViewport extends RenderBox
Curve curve = Curves.ease,
}) {
return;
// TODO(jaime): check showOnScreen method beheves when keyboard appears on
// TODO(jaime): check showOnScreen method behaves when keyboard appears on
// the screen
// if (!offset.allowImplicitScrolling) {
// return super.showOnScreen(
... ...
... ... @@ -3,7 +3,7 @@ import 'package:sheet/sheet.dart';
typedef SheetControllerCallback = void Function(SheetController controller);
/// A widget that injets a [SheetController] that can be used by
/// A widget that injects a [SheetController] that can be used by
/// any [Sheet] children
///
/// It is useful for creating initial animations
... ...
import 'package:flutter/material.dart';
import 'package:sheet/sheet.dart';
class MaterialSheet extends Sheet {
const MaterialSheet({
super.key,
required super.child,
super.controller,
super.physics,
super.initialExtent,
super.minExtent,
super.maxExtent,
super.minInteractionExtent = 20.0,
super.backgroundColor,
super.clipBehavior,
super.shape,
super.elevation,
super.fit = SheetFit.loose,
super.resizable = false,
super.padding = EdgeInsets.zero,
super.minResizableExtent,
});
@override
Widget decorationBuild(BuildContext context, Widget child) {
final BottomSheetThemeData bottomSheetTheme =
Theme.of(context).bottomSheetTheme;
final Color? color = backgroundColor ?? bottomSheetTheme.backgroundColor;
final double elevation = this.elevation ?? bottomSheetTheme.elevation ?? 0;
final ShapeBorder? shape = this.shape ?? bottomSheetTheme.shape;
final Clip clipBehavior =
this.clipBehavior ?? bottomSheetTheme.clipBehavior ?? Clip.none;
return Material(
color: color,
elevation: elevation,
shape: shape,
clipBehavior: clipBehavior,
child: child,
);
}
}
... ...
... ... @@ -5,26 +5,26 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "0c80aeab9bc807ab10022cd3b2f4cf2ecdf231949dc1ddd9442406a003f19201"
sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a
url: "https://pub.dev"
source: hosted
version: "52.0.0"
version: "61.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: cd8ee83568a77f3ae6b913a36093a1c9b1264e7cb7f834d9ddd2311dade9c1f4
sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562
url: "https://pub.dev"
source: hosted
version: "5.4.0"
version: "5.13.0"
args:
dependency: transitive
description:
name: args
sha256: "139d809800a412ebb26a3892da228b2d0ba36f0ef5d9a82166e5e52ec8d61611"
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
url: "https://pub.dev"
source: hosted
version: "2.3.2"
version: "2.4.2"
async:
dependency: transitive
description:
... ... @@ -77,18 +77,18 @@ packages:
dependency: transitive
description:
name: coverage
sha256: "961c4aebd27917269b1896382c7cb1b1ba81629ba669ba09c27a7e5710ec9040"
sha256: "595a29b55ce82d53398e1bcc2cba525d7bd7c59faeb2d2540e9d42c390cfeeeb"
url: "https://pub.dev"
source: hosted
version: "1.6.2"
version: "1.6.4"
crypto:
dependency: transitive
description:
name: crypto
sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
url: "https://pub.dev"
source: hosted
version: "3.0.2"
version: "3.0.3"
fake_async:
dependency: transitive
description:
... ... @@ -101,10 +101,10 @@ packages:
dependency: transitive
description:
name: file
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
url: "https://pub.dev"
source: hosted
version: "6.1.4"
version: "7.0.0"
flutter:
dependency: "direct main"
description: flutter
... ... @@ -127,10 +127,10 @@ packages:
dependency: transitive
description:
name: glob
sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c"
sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
http_multi_server:
dependency: transitive
description:
... ... @@ -159,26 +159,26 @@ packages:
dependency: transitive
description:
name: js
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.dev"
source: hosted
version: "0.6.5"
version: "0.6.7"
lints:
dependency: "direct dev"
description:
name: lints
sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593"
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "2.1.1"
logging:
dependency: transitive
description:
name: logging
sha256: c0bbfe94d46aedf9b8b3e695cf3bd48c8e14b35e3b2c639e0aa7755d589ba946
sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.2.0"
matcher:
dependency: transitive
description:
... ... @@ -223,10 +223,10 @@ packages:
dependency: transitive
description:
name: node_preamble
sha256: "8ebdbaa3b96d5285d068f80772390d27c21e1fa10fb2df6627b1b9415043608d"
sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "2.0.2"
package_config:
dependency: transitive
description:
... ... @@ -255,42 +255,42 @@ packages:
dependency: transitive
description:
name: pub_semver
sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17"
sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
version: "2.1.4"
shelf:
dependency: transitive
description:
name: shelf
sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c
sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
shelf_packages_handler:
dependency: transitive
description:
name: shelf_packages_handler
sha256: aef74dc9195746a384843102142ab65b6a4735bb3beea791e63527b88cc83306
sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
version: "3.0.2"
shelf_static:
dependency: transitive
description:
name: shelf_static
sha256: e792b76b96a36d4a41b819da593aff4bdd413576b3ba6150df5d8d9996d2e74c
sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.1.2"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8
sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1"
url: "https://pub.dev"
source: hosted
version: "1.0.3"
version: "1.0.4"
sky_engine:
dependency: transitive
description: flutter
... ... @@ -308,10 +308,10 @@ packages:
dependency: transitive
description:
name: source_maps
sha256: "490098075234dcedb83c5d949b4c93dad5e6b7702748de000be2b57b8e6b2427"
sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703"
url: "https://pub.dev"
source: hosted
version: "0.10.11"
version: "0.10.12"
source_span:
dependency: transitive
description:
... ... @@ -380,10 +380,10 @@ packages:
dependency: transitive
description:
name: typed_data
sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5"
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
url: "https://pub.dev"
source: hosted
version: "1.3.1"
version: "1.3.2"
vector_math:
dependency: transitive
description:
... ... @@ -396,18 +396,18 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: e7fb6c2282f7631712b69c19d1bff82f3767eea33a2321c14fa59ad67ea391c7
sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583
url: "https://pub.dev"
source: hosted
version: "9.4.0"
version: "11.10.0"
watcher:
dependency: transitive
description:
name: watcher
sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0"
sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
url: "https://pub.dev"
source: hosted
version: "1.0.2"
version: "1.1.0"
web:
dependency: transitive
description:
... ... @@ -420,26 +420,25 @@ packages:
dependency: transitive
description:
name: web_socket_channel
sha256: ca49c0bc209c687b887f30527fb6a9d80040b072cc2990f34b9bec3e7663101b
sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b
url: "https://pub.dev"
source: hosted
version: "2.3.0"
version: "2.4.0"
webkit_inspection_protocol:
dependency: transitive
description:
name: webkit_inspection_protocol
sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d"
sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.2.1"
yaml:
dependency: transitive
description:
name: yaml
sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370"
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
url: "https://pub.dev"
source: hosted
version: "3.1.1"
version: "3.1.2"
sdks:
dart: ">=3.1.0-185.0.dev <4.0.0"
flutter: ">=3.7.0"
... ...
... ... @@ -5,7 +5,6 @@ homepage: https://github.com/jamesblasco/modal_bottom_sheet
environment:
sdk: ">=2.17.0 <3.0.0"
flutter: ">=3.7.0"
dependencies:
flutter:
... ... @@ -15,6 +14,6 @@ dev_dependencies:
flutter_test:
sdk: flutter
mocktail: ^0.3.0
lints: ^2.0.0
lints: ^2.1.1
flutter:
\ No newline at end of file
... ...
... ... @@ -11,7 +11,6 @@ void main() {
testWidgets('defaultTestSize', (WidgetTester tester) async {
final Size testSize =
tester.view.physicalSize / tester.view.devicePixelRatio;
expect(testSize, equals(kScreenSize));
});
}
... ...
... ... @@ -77,21 +77,21 @@ void main() {
test('overscroll is progressively harder', () {
final ScrollMetrics lessOverscrolledPosition = FixedScrollMetrics(
devicePixelRatio: 1,
minScrollExtent: 0.0,
maxScrollExtent: 1000.0,
pixels: -20.0,
viewportDimension: 100.0,
axisDirection: AxisDirection.down,
devicePixelRatio: 1,
);
final ScrollMetrics moreOverscrolledPosition = FixedScrollMetrics(
minScrollExtent: 0.0,
devicePixelRatio: 1,
maxScrollExtent: 1000.0,
pixels: -40.0,
viewportDimension: 100.0,
axisDirection: AxisDirection.down,
devicePixelRatio: 1,
);
final double lessOverscrollApplied = physicsUnderTest
... ... @@ -116,11 +116,11 @@ void main() {
test('easing an overscroll still has resistance', () {
final ScrollMetrics overscrolledPosition = FixedScrollMetrics(
minScrollExtent: 0.0,
devicePixelRatio: 1,
maxScrollExtent: 1000.0,
pixels: -20.0,
viewportDimension: 100.0,
axisDirection: AxisDirection.down,
devicePixelRatio: 1,
);
final double easingApplied = physicsUnderTest.applyPhysicsToUserOffset(
... ... @@ -154,10 +154,10 @@ void main() {
final ScrollMetrics overscrolledPosition = FixedScrollMetrics(
minScrollExtent: 0.0,
maxScrollExtent: 1000.0,
devicePixelRatio: 1,
pixels: -20.0,
viewportDimension: 100.0,
axisDirection: AxisDirection.down,
devicePixelRatio: 1,
);
final double easingApplied = physicsUnderTest.applyPhysicsToUserOffset(
... ...