-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ChinaGamer
committed
Feb 26, 2022
1 parent
c1e8104
commit 3cd4417
Showing
16 changed files
with
599 additions
and
286 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
class SlideTopRoute extends PageRouteBuilder { | ||
final Widget page; | ||
|
||
SlideTopRoute({required this.page}) | ||
: super( | ||
pageBuilder: ( | ||
BuildContext context, | ||
Animation<double> animation, | ||
Animation<double> secondaryAnimation, | ||
) => | ||
page, | ||
transitionsBuilder: ( | ||
BuildContext context, | ||
Animation<double> animation, | ||
Animation<double> secondaryAnimation, | ||
Widget child, | ||
) => | ||
SlideTransition( | ||
position: Tween<Offset>( | ||
begin: const Offset(0,1), | ||
end: Offset.zero, | ||
).animate(animation), | ||
child: child, | ||
), | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'package:flutter/material.dart'; | ||
// 取消涟漪效果 | ||
/// Cancel ripples caused by excessive Listview scrolling. | ||
class NoRippleOverScroll extends StatefulWidget { | ||
final Widget child; | ||
|
||
NoRippleOverScroll({required this.child}); | ||
|
||
@override | ||
NoRippleOverScrollState createState() => NoRippleOverScrollState(); | ||
} | ||
|
||
class NoRippleOverScrollState extends State<NoRippleOverScroll> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return ScrollConfiguration( | ||
behavior: _OverScrollBehavior(), | ||
child: widget.child, | ||
); | ||
} | ||
} | ||
|
||
class _OverScrollBehavior extends ScrollBehavior { | ||
@override | ||
Widget buildViewportChrome(BuildContext context, Widget child, AxisDirection axisDirection) { | ||
if (getPlatform(context) == TargetPlatform.android || | ||
getPlatform(context) == TargetPlatform.fuchsia) { | ||
return GlowingOverscrollIndicator( | ||
child: child, | ||
showLeading: false, | ||
showTrailing: false, | ||
axisDirection: axisDirection, | ||
//'accentColor' is deprecated and shouldn't be used. Use colorScheme.secondary instead. For more information, consult the migration guide at https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. This feature was deprecated after v2.3.0-0.1.pre.. (文档) Try replacing the use of the deprecated member with the replacement. | ||
color: Theme.of(context).colorScheme.secondary, | ||
); | ||
} else { | ||
return child; | ||
} | ||
} | ||
} |
Oops, something went wrong.