Migrate DropdownButton => ADDropdownButton

This commit is contained in:
Ashita Prasad
2024-12-09 02:47:57 +05:30
parent 5c2b900fc9
commit 171f16639a
8 changed files with 87 additions and 144 deletions

View File

@ -16,35 +16,19 @@ class DropdownButtonHttpMethod extends StatelessWidget {
@override
Widget build(BuildContext context) {
final surfaceColor = Theme.of(context).colorScheme.surface;
return DropdownButton<HTTPVerb>(
focusColor: surfaceColor,
return ADDropdownButton<HTTPVerb>(
value: method,
icon: const Icon(Icons.unfold_more_rounded),
elevation: 4,
underline: Container(
height: 0,
),
borderRadius: kBorderRadius12,
values: HTTPVerb.values.map((e) => (e, e.name.toUpperCase())),
onChanged: onChanged,
items: HTTPVerb.values.map<DropdownMenuItem<HTTPVerb>>((HTTPVerb value) {
return DropdownMenuItem<HTTPVerb>(
value: value,
child: Padding(
padding: EdgeInsets.only(left: context.isMediumWindow ? 8 : 16),
child: Text(
value.name.toUpperCase(),
style: kCodeStyle.copyWith(
fontWeight: FontWeight.bold,
color: getHTTPMethodColor(
value,
brightness: Theme.of(context).brightness,
),
),
),
),
);
}).toList(),
dropdownMenuItemPadding:
EdgeInsets.only(left: context.isMediumWindow ? 8 : 16),
dropdownMenuItemtextStyle: (HTTPVerb v) => kCodeStyle.copyWith(
fontWeight: FontWeight.bold,
color: getHTTPMethodColor(
v,
brightness: Theme.of(context).brightness,
),
),
);
}
}