Skip to content

Commit

Permalink
Update example project main.dart.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenresoft committed Aug 7, 2024
1 parent 703d88c commit 8947030
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class _RiffSwitchExampleState extends State<RiffSwitchExample> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.onBackground,
backgroundColor: Theme.of(context).colorScheme.onSurface,
appBar: AppBar(title: Text(widget._title)),
body: Center(
child: SingleChildScrollView(
Expand Down Expand Up @@ -124,14 +124,14 @@ class _RiffSwitchExampleState extends State<RiffSwitchExample> {
type: RiffSwitchType.simple,
activeText: const Text("Accept"),
inactiveText: const Text("Decline"),
thumbColor: MaterialStateProperty.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
thumbColor: WidgetStateProperty.resolveWith((Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return Colors.greenAccent;
}
return Colors.pinkAccent;
}),
trackColor: MaterialStateProperty.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
trackColor: WidgetStateProperty.resolveWith((Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return Colors.grey;
}
return Colors.grey;
Expand All @@ -150,14 +150,14 @@ class _RiffSwitchExampleState extends State<RiffSwitchExample> {
type: RiffSwitchType.decorative,
activeText: const Text("Accept"),
inactiveText: const Text("Decline"),
thumbColor: MaterialStateProperty.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
thumbColor: WidgetStateProperty.resolveWith((Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return Colors.greenAccent;
}
return Colors.pinkAccent;
}),
trackColor: MaterialStateProperty.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
trackColor: WidgetStateProperty.resolveWith((Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return Colors.grey;
}
return Colors.grey;
Expand Down Expand Up @@ -268,8 +268,8 @@ class _RiffSwitchExampleState extends State<RiffSwitchExample> {
width: double.infinity,
child: const FlutterLogo(),
),
thumbColor: MaterialStateProperty.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
thumbColor: WidgetStateProperty.resolveWith((Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return Colors.greenAccent;
}
return Colors.yellow;
Expand Down

0 comments on commit 8947030

Please sign in to comment.