Skip to content

Instantly share code, notes, and snippets.

@bsutton
Created October 13, 2019 04:10
Show Gist options
  • Save bsutton/7f6d7c009d73e21b1df109e6ff4b4523 to your computer and use it in GitHub Desktop.
Save bsutton/7f6d7c009d73e21b1df109e6ff4b4523 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class GrayedOut extends StatelessWidget {
final Widget child;
final bool grayedOut;
GrayedOut({@required this.child, this.grayedOut = true});
@override
Widget build(BuildContext context) {
return grayedOut ? Opacity(opacity: 0.3, child: child) : child;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment