Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 9 additions & 97 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ void main() {
}

class MyApp extends StatelessWidget {
const MyApp({super.key});
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand All @@ -22,21 +22,21 @@ class MyApp extends StatelessWidget {
}

class NewPage extends StatelessWidget {
const NewPage({super.key});
const NewPage({key});

@override
Widget build(BuildContext context) {
return Scaffold(
floatingActionButton: FloatingActionButton(onPressed: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) => const TestPage()));
.push(MaterialPageRoute(builder: (context) => TestPage()));
}),
);
}
}

class TestPage extends StatefulWidget {
const TestPage({super.key});
const TestPage({Key? key}) : super(key: key);

@override
State<TestPage> createState() => _TestPageState();
Expand Down Expand Up @@ -92,6 +92,9 @@ class _TestPageState extends State<TestPage> {
searchTextStyle: const TextStyle(color: Colors.red),
searchDecoration: const InputDecoration(
hintText: "enter your custom hint text here"),
overlayDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: Colors.blue),
validator: (value) {
if (value == null) {
return "Required field";
Expand Down Expand Up @@ -174,7 +177,7 @@ class _TestPageState extends State<TestPage> {
// initialValue: const ["name1", "name2", "name8", "name3"],
// displayCompleteItem: true,
checkBoxProperty: CheckBoxProperty(
fillColor: WidgetStateProperty.all<Color>(Colors.red)),
fillColor: MaterialStateProperty.all<Color>(Colors.red)),
dropDownList: const [
DropDownValueModel(name: 'name1', value: "value1"),
DropDownValueModel(
Expand Down Expand Up @@ -236,98 +239,7 @@ class _TestPageState extends State<TestPage> {
),
const SizedBox(
height: 50,
),
const Text(
"Single selection dropdown with prefix widget and custom boxDecoration and boxMargin",
style: TextStyle(fontWeight: FontWeight.bold),
),
const SizedBox(
height: 20,
),
DropDownTextField(
// initialValue: "name4",
listSpace: 20,
listPadding: ListPadding(top: 20),
enableSearch: true,
validator: (value) {
if (value == null) {
return "Required field";
} else {
return null;
}
},
boxDecoration: BoxDecoration(
color: Colors.blue[200],
borderRadius: BorderRadius.circular(16),
),
boxMargin:
const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
dropDownList: const [
DropDownValueModel(
name: 'name1',
value: "value1",
prefixWidget: Icon(
Icons.person,
size: 24,
)),
DropDownValueModel(
name: 'name2',
value: "value2",
prefixWidget: Icon(
Icons.person,
size: 24,
)),
DropDownValueModel(
name: 'name3',
value: "value3",
prefixWidget: Icon(
Icons.person,
size: 24,
)),
DropDownValueModel(
name: 'name4',
value: "value4",
prefixWidget: Icon(
Icons.person,
size: 24,
)),
DropDownValueModel(
name: 'name5',
value: "value5",
prefixWidget: Icon(
Icons.person,
size: 24,
)),
DropDownValueModel(
name: 'name6',
value: "value6",
prefixWidget: Icon(
Icons.person,
size: 24,
)),
DropDownValueModel(
name: 'name7',
value: "value7",
prefixWidget: Icon(
Icons.person,
size: 24,
)),
DropDownValueModel(
name: 'name8',
value: "value8",
prefixWidget: Icon(
Icons.person,
size: 24,
)),
],
listTextStyle: const TextStyle(color: Colors.red),
dropDownItemCount: 8,

onChanged: (val) {},
),
const SizedBox(
height: 50,
),
)
],
),
),
Expand Down
Loading