mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
Create popup_menu_api_type.dart
This commit is contained in:
26
lib/widgets/popup_menu_api_type.dart
Normal file
26
lib/widgets/popup_menu_api_type.dart
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import 'package:apidash_core/apidash_core.dart';
|
||||||
|
import 'package:apidash_design_system/apidash_design_system.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class APITypePopupMenu extends StatelessWidget {
|
||||||
|
const APITypePopupMenu({
|
||||||
|
super.key,
|
||||||
|
required this.apiType,
|
||||||
|
this.onChanged,
|
||||||
|
});
|
||||||
|
|
||||||
|
final APIType? apiType;
|
||||||
|
final void Function(APIType?)? onChanged;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ADPopupMenu<APIType>(
|
||||||
|
tooltip: "Select API Type",
|
||||||
|
width: 100,
|
||||||
|
value: apiType?.label,
|
||||||
|
values: APIType.values.map((e) => (e, e.label)),
|
||||||
|
onChanged: onChanged,
|
||||||
|
isOutlined: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user