Skip to content

Commit

Permalink
Use adaptive Switch
Browse files Browse the repository at this point in the history
  • Loading branch information
GBergatto committed Nov 9, 2023
1 parent 92e076b commit 0e558ec
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions lib/pages/add_page/widgets/recurrence_list_tile.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import "package:flutter_riverpod/flutter_riverpod.dart";
import 'dart:io' show Platform;

import "../../../constants/style.dart";
import '../../../providers/transactions_provider.dart';
Expand Down Expand Up @@ -43,18 +41,11 @@ class RecurrenceListTile extends ConsumerWidget {
.titleLarge!
.copyWith(color: Theme.of(context).colorScheme.primary),
),
trailing: (Platform.isIOS)
? CupertinoSwitch(
value: isRecurring,
onChanged: (select) => ref
.read(selectedRecurringPayProvider.notifier)
.state = select,
)
: Switch(
value: isRecurring,
onChanged: (select) =>
ref.read(selectedRecurringPayProvider.notifier).state = select,
),
trailing: Switch.adaptive(
value: isRecurring,
onChanged: (select) =>
ref.read(selectedRecurringPayProvider.notifier).state = select,
),
),
if (isRecurring) ...[
Padding(
Expand Down

0 comments on commit 0e558ec

Please sign in to comment.