Skip to content

Instantly share code, notes, and snippets.

@HansMuller
Created August 6, 2020 22:46
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/5a1710517255b5cf8082774a61b9a6f9 to your computer and use it in GitHub Desktop.
Save HansMuller/5a1710517255b5cf8082774a61b9a6f9 to your computer and use it in GitHub Desktop.
import 'package:flutter/scheduler.dart' show timeDilation;
import 'package:flutter/material.dart';
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ButtonStyle style = ButtonStyle(
backgroundColor: MaterialStateProperty.all<Color>(Colors.white),
elevation: MaterialStateProperty.resolveWith<double>((Set<MaterialState> states) {
return states.contains(MaterialState.hovered) ? 2 : null;
}),
);
return Scaffold(
body: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
OutlinedButton(
style: style,
onPressed: () { },
child: Text('Default'),
),
SizedBox(width: 16),
OutlinedButton(
style: style,
onPressed: () { },
child: Text('Icon'),
),
],
),
),
);
}
}
void main() {
timeDilation = 10;
final ThemeData theme = ThemeData.from(colorScheme: ColorScheme.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