Skip to content

Instantly share code, notes, and snippets.

@HansMuller
Created October 7, 2020 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HansMuller/5974ce0b0d86e7e5ca4be04b74d2d320 to your computer and use it in GitHub Desktop.
Save HansMuller/5974ce0b0d86e7e5ca4be04b74d2d320 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: TextButton.icon(
icon: const Icon(Icons.check_box),
label: const Text('TextButton'),
style: ButtonStyle(
foregroundColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) => states.contains(MaterialState.disabled) ? Colors.black : null,
),
),
onPressed: null,
),
),
);
}
}
void main() {
final ThemeData theme = ThemeData.light();
runApp(MaterialApp(theme: theme, home: Home()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment