From 37bc6dc4fa227a8c9537844b7c802a680a32cfaf Mon Sep 17 00:00:00 2001 From: Ashita Prasad Date: Sun, 12 Jan 2025 15:45:05 +0530 Subject: [PATCH] Create popup_menu_api_type.dart --- lib/widgets/popup_menu_api_type.dart | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/widgets/popup_menu_api_type.dart diff --git a/lib/widgets/popup_menu_api_type.dart b/lib/widgets/popup_menu_api_type.dart new file mode 100644 index 00000000..22996e17 --- /dev/null +++ b/lib/widgets/popup_menu_api_type.dart @@ -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( + tooltip: "Select API Type", + width: 100, + value: apiType?.label, + values: APIType.values.map((e) => (e, e.label)), + onChanged: onChanged, + isOutlined: true, + ); + } +}