Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
modal_bottom_sheet
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
maRci002
2024-11-18 18:31:55 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-11-18 18:31:55 +0100
Commit
2b014f4bad796d0eaff960d9e0b5597829c92842
2b014f4b
1 parent
55a97bc7
Fix update Sheet content while initializing (#432)
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
4 deletions
sheet/lib/src/route/sheet_route.dart
sheet/lib/src/scroll_controller.dart
sheet/lib/src/scrollable.dart
sheet/lib/src/route/sheet_route.dart
View file @
2b014f4
...
...
@@ -373,11 +373,18 @@ class __SheetRouteContainerState extends State<_SheetRouteContainer>
_routeController
.
addListener
(
onRouteAnimationUpdate
);
_sheetController
.
addListener
(
onSheetExtentUpdate
);
WidgetsBinding
.
instance
.
addPostFrameCallback
((
Duration
timeStamp
)
{
_sheetController
.
relativeAnimateTo
(
_sheetController
.
relativeAnimateTo
(
route
.
initialExtent
,
duration:
route
.
transitionDuration
,
curve:
route
.
animationCurve
??
Curves
.
easeOut
,
);
)
.
then
((
_
)
{
if
(
_sheetController
.
hasClients
)
{
(
_sheetController
.
position
.
context
as
SheetContext
)
.
initialAnimationFinished
=
true
;
}
});
});
super
.
initState
();
}
...
...
sheet/lib/src/scroll_controller.dart
View file @
2b014f4
...
...
@@ -122,7 +122,12 @@ class SheetPrimaryScrollPosition extends ScrollPositionWithSingleContext {
}
if
(
sheetPosition
.
hasContentDimensions
)
{
sheetPosition
.
goBallistic
(
velocity
);
if
(
sheetContext
.
initialAnimationFinished
)
{
sheetPosition
.
goBallistic
(
velocity
);
}
else
{
goIdle
();
return
;
}
}
if
(
velocity
>
0.0
&&
...
...
sheet/lib/src/scrollable.dart
View file @
2b014f4
...
...
@@ -25,6 +25,8 @@ import 'package:sheet/src/widgets/min_interaction.dart';
abstract
class
SheetContext
extends
ScrollContext
{
double
?
get
initialExtent
;
SheetPosition
get
position
;
bool
get
initialAnimationFinished
;
set
initialAnimationFinished
(
bool
initialAnimationFinished
);
}
/// A widget that transform to user drag.
...
...
@@ -326,6 +328,9 @@ class SheetState extends State<SheetScrollable>
@override
AxisDirection
get
axisDirection
=>
widget
.
axisDirection
;
@override
bool
initialAnimationFinished
=
false
;
late
SheetBehavior
_configuration
;
ScrollPhysics
?
_physics
;
SheetController
?
_fallbackScrollController
;
...
...
@@ -775,7 +780,7 @@ class _ScrollSemantics extends SingleChildRenderObjectWidget {
required
this
.
allowImplicitScrolling
,
required
this
.
semanticChildCount
,
super
.
child
,
})
:
assert
(
semanticChildCount
==
null
||
semanticChildCount
>=
0
);
})
:
assert
(
semanticChildCount
==
null
||
semanticChildCount
>=
0
);
final
ScrollPosition
position
;
final
bool
allowImplicitScrolling
;
...
...
Please
register
or
login
to post a comment