Created
December 21, 2018 05:04
-
-
Save zmtzawqlp/653f92071584939f759d559e724ddc04 to your computer and use it in GitHub Desktop.
CustomScrollBehavior水波纹
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
import 'package:flutter/material.dart'; | |
class CustomScrollBehavior extends ScrollBehavior { | |
@override | |
Widget buildViewportChrome( | |
BuildContext context, Widget child, AxisDirection axisDirection) { | |
// TODO: implement buildViewportChrome | |
switch (getPlatform(context)) { | |
case TargetPlatform.iOS: | |
return child; | |
case TargetPlatform.android: | |
case TargetPlatform.fuchsia: | |
return GlowingOverscrollIndicator( | |
showTrailing: true, | |
showLeading: false, | |
child: child, | |
axisDirection: axisDirection, | |
color: Colors.blue, | |
); | |
} | |
return null; | |
//super.buildViewportChrome(context, child, axisDirection) | |
} | |
//// @override | |
// ScrollPhysics getScrollPhysics(BuildContext context) { | |
// // TODO: implement getScrollPhysics | |
// return CustomNestedScrollViewFixPinnedScrollPhysics(pinnedHeight); | |
// return super.getScrollPhysics(context); | |
// } | |
// | |
// @override | |
// bool shouldNotify(ScrollBehavior oldDelegate) { | |
// // TODO: implement shouldNotify | |
// return true; | |
// return pinnedHeight != (oldDelegate as CustomScrollBehavior).pinnedHeight; | |
// return super.shouldNotify(oldDelegate); | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment