47 lines
1.3 KiB
Dart
47 lines
1.3 KiB
Dart
import 'package:easy_localization/easy_localization.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:gecko/globals.dart';
|
|
import 'package:gecko/models/widgets_keys.dart';
|
|
import 'package:gecko/providers/home.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
class ChooseCurrencyUnit extends StatelessWidget {
|
|
const ChooseCurrencyUnit({
|
|
Key? key,
|
|
required this.context,
|
|
}) : super(key: key);
|
|
|
|
final BuildContext context;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
HomeProvider homeProvider =
|
|
Provider.of<HomeProvider>(context, listen: false);
|
|
return InkWell(
|
|
key: keyUdUnit,
|
|
onTap: () async {
|
|
await homeProvider.changeCurrencyUnit(context);
|
|
},
|
|
child: SizedBox(
|
|
height: 50,
|
|
child: Row(
|
|
children: [
|
|
const SizedBox(width: 12),
|
|
Text('showUdAmounts'.tr()),
|
|
const Spacer(),
|
|
Consumer<HomeProvider>(builder: (context, homeProvider, _) {
|
|
final bool isUdUnit = configBox.get('isUdUnit') ?? false;
|
|
return Icon(
|
|
isUdUnit ? Icons.check_box : Icons.check_box_outline_blank,
|
|
color: orangeC,
|
|
size: 32,
|
|
);
|
|
}),
|
|
const SizedBox(width: 30),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|