mirror of
https://github.com/hmalik144/easy_cc_flutter.git
synced 2025-12-10 03:05:34 +00:00
Ability to cache currency selection (#5)
This commit is contained in:
@@ -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,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user