mirror of
https://github.com/foss42/apidash.git
synced 2025-05-28 12:18:06 +08:00
Protocol => APIType
This commit is contained in:
@ -61,9 +61,9 @@ class RequestEditorTopBar extends ConsumerWidget {
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
DropdownButtonProtocol(
|
||||
protocol: Protocol.http,
|
||||
onChanged: (protocol) {},
|
||||
DropdownButtonAPIType(
|
||||
apiType: APIType.http,
|
||||
onChanged: (apiType) {},
|
||||
),
|
||||
kHSpacer10,
|
||||
Expanded(
|
||||
|
@ -2,21 +2,21 @@ import 'package:apidash_core/apidash_core.dart';
|
||||
import 'package:apidash_design_system/apidash_design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DropdownButtonProtocol extends StatelessWidget {
|
||||
const DropdownButtonProtocol({
|
||||
class DropdownButtonAPIType extends StatelessWidget {
|
||||
const DropdownButtonAPIType({
|
||||
super.key,
|
||||
this.protocol,
|
||||
this.apiType,
|
||||
this.onChanged,
|
||||
});
|
||||
|
||||
final Protocol? protocol;
|
||||
final void Function(Protocol?)? onChanged;
|
||||
final APIType? apiType;
|
||||
final void Function(APIType?)? onChanged;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ADDropdownButton<Protocol>(
|
||||
value: protocol,
|
||||
values: Protocol.values.map((e) => (e, e.label)),
|
||||
return ADDropdownButton<APIType>(
|
||||
value: apiType,
|
||||
values: APIType.values.map((e) => (e, e.label)),
|
||||
onChanged: onChanged,
|
||||
isDense: true,
|
||||
);
|
@ -25,7 +25,7 @@ export 'dropdown_content_type.dart';
|
||||
export 'dropdown_formdata.dart';
|
||||
export 'dropdown_http_method.dart';
|
||||
export 'dropdown_import_format.dart';
|
||||
export 'dropdown_protocol.dart';
|
||||
export 'dropdown_api_type.dart';
|
||||
export 'editor_json.dart';
|
||||
export 'editor.dart';
|
||||
export 'error_message.dart';
|
||||
|
@ -1,9 +1,9 @@
|
||||
import 'dart:convert';
|
||||
|
||||
enum Protocol {
|
||||
enum APIType {
|
||||
http("HTTP");
|
||||
|
||||
const Protocol(this.label);
|
||||
const APIType(this.label);
|
||||
final String label;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user