| 1 | import 'package:cake_wallet/src/widgets/standard_switch.dart'; |
| 2 | import 'package:flutter/material.dart'; |
| 3 | |
| 4 | class UnspentCoinsSwitchRow extends StatelessWidget { |
| 5 | UnspentCoinsSwitchRow( |
| 6 | {required this.title, |
| 7 | required this.switchValue, |
| 8 | required this.onSwitchValueChange, |
| 9 | this.titleFontSize = 14}); |
| 10 | |
| 11 | final String title; |
| 12 | final double titleFontSize; |
| 13 | final bool switchValue; |
| 14 | final void Function(bool value) onSwitchValueChange; |
| 15 | |
| 16 | @override |
| 17 | Widget build(BuildContext context) { |
| 18 | return Container( |
| 19 | width: double.infinity, |
| 20 | color: Theme.of(context).colorScheme.surface, |
| 21 | child: Padding( |
| 22 | padding: const EdgeInsets.only(left: 24, top: 16, bottom: 16, right: 24), |
| 23 | child: Column( |
| 24 | crossAxisAlignment: CrossAxisAlignment.start, |
| 25 | children: <Widget>[ |
| 26 | Text( |
| 27 | title, |
| 28 | style: Theme.of(context).textTheme.bodyMedium!.copyWith( |
| 29 | fontSize: titleFontSize, |
| 30 | fontWeight: FontWeight.w500, |
| 31 | color: Theme.of(context).colorScheme.onSurfaceVariant, |
| 32 | ), |
| 33 | textAlign: TextAlign.left, |
| 34 | ), |
| 35 | Padding( |
| 36 | padding: EdgeInsets.only(top: 12), |
| 37 | child: StandardSwitch( |
| 38 | value: switchValue, |
| 39 | onTapped: () => onSwitchValueChange(!switchValue), |
| 40 | ), |
| 41 | ) |
| 42 | ], |
| 43 | ), |
| 44 | ), |
| 45 | ); |
| 46 | } |
| 47 | } |