Last active
October 17, 2019 05:26
-
-
Save bsutton/d60ec5b9006c28fb90c720e0ec9f9e6b to your computer and use it in GitHub Desktop.
Updated grayed_out
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 GrayedOut extends StatelessWidget { | |
final Widget child; | |
final bool grayedOut; | |
final double opacity; | |
GrayedOut({@required this.child, this.grayedOut = true}) | |
: opacity = grayedOut == true ? 0.3 : 1.0; | |
@override | |
Widget build(BuildContext context) { | |
return AbsorbPointer( | |
absorbing: grayedOut, child: Opacity(opacity: opacity, child: child)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment