Ability to cache currency selection (#5)

This commit is contained in:
2022-09-07 00:16:49 +01:00
committed by GitHub
parent 3c1ecd76c2
commit 5104fc674e
13 changed files with 415 additions and 172 deletions

View File

@@ -1,14 +1,15 @@
import 'package:dropdown_search/dropdown_search.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../Utils/Constants.dart';
class DropDownBox extends StatelessWidget {
final List<String> _selection;
final String _hintText;
final Function(String?) _onChanged;
const DropDownBox(this._selection, this._onChanged, {super.key});
const DropDownBox(this._selection, this._hintText, this._onChanged,
{super.key});
@override
Widget build(BuildContext context) {
@@ -18,20 +19,21 @@ class DropDownBox extends StatelessWidget {
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(22))),
child: DropdownSearch<String>(
popupProps: const PopupProps.dialog(showSearchBox: true),
popupProps: const PopupProps.dialog(
showSearchBox: true,
dialogProps: DialogProps(backgroundColor: colourThree)),
items: _selection,
dropdownDecoratorProps: const DropDownDecoratorProps(
dropdownDecoratorProps: DropDownDecoratorProps(
dropdownSearchDecoration: InputDecoration(
contentPadding: EdgeInsets.all(14),
contentPadding: const EdgeInsets.all(14),
border: InputBorder.none,
filled: true,
fillColor: Colors.transparent,
hintText: "Select a currency",
hintText: _hintText,
),
),
onChanged: _onChanged,
),
);
}
}
}