mirror of
https://github.com/hmalik144/easy_cc_flutter.git
synced 2025-12-10 03:05:34 +00:00
Project lint checked and step added to config.yml
This commit is contained in:
39
lib/views/drop_down_box.dart
Normal file
39
lib/views/drop_down_box.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
import 'package:dropdown_search/dropdown_search.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._hintText, this._onChanged,
|
||||
{super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
color: colourThree,
|
||||
elevation: 2,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(22))),
|
||||
child: DropdownSearch<String>(
|
||||
popupProps: const PopupProps.dialog(
|
||||
showSearchBox: true,
|
||||
dialogProps: DialogProps(backgroundColor: colourThree)),
|
||||
items: _selection,
|
||||
dropdownDecoratorProps: DropDownDecoratorProps(
|
||||
dropdownSearchDecoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.all(14),
|
||||
border: InputBorder.none,
|
||||
filled: true,
|
||||
fillColor: Colors.transparent,
|
||||
hintText: _hintText,
|
||||
),
|
||||
),
|
||||
onChanged: _onChanged,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user