Skip to content

Commit

Permalink
feat: 去除水波纹
Browse files Browse the repository at this point in the history
  • Loading branch information
azhon committed Sep 13, 2023
1 parent ae1790c commit 93e69a9
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions lib/src/ui/widget/remove_ripple_widget.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:todo_flutter/src/base/base_stateless_widget.dart';

Expand All @@ -18,19 +20,14 @@ class RemoveRippleWidget extends BaseStatelessWidget {

class _RemoveRippleBehavior extends ScrollBehavior {
@override
Widget buildViewportChrome(
BuildContext context, Widget child, AxisDirection axisDirection) {
final platform = getPlatform(context);
if (platform == TargetPlatform.android ||
platform == TargetPlatform.fuchsia) {
return GlowingOverscrollIndicator(
showLeading: false,
showTrailing: false,
axisDirection: axisDirection,
color: Theme.of(context).colorScheme.secondary,
child: child,
);
Widget buildOverscrollIndicator(
BuildContext context,
Widget child,
ScrollableDetails details,
) {
if (Platform.isAndroid) {
return child;
}
return child;
return super.buildOverscrollIndicator(context, child, details);
}
}

0 comments on commit 93e69a9

Please sign in to comment.