Skip to content

Instantly share code, notes, and snippets.

@bsutton
Last active October 17, 2019 05:26
Show Gist options
  • Save bsutton/d60ec5b9006c28fb90c720e0ec9f9e6b to your computer and use it in GitHub Desktop.
Save bsutton/d60ec5b9006c28fb90c720e0ec9f9e6b to your computer and use it in GitHub Desktop.
Updated grayed_out
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