mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
cleanup
This commit is contained in:
@ -4,7 +4,7 @@ import 'package:apidash/models/models.dart';
|
|||||||
|
|
||||||
String getEnvironmentTitle(String? name) {
|
String getEnvironmentTitle(String? name) {
|
||||||
if (name == null || name.trim() == "") {
|
if (name == null || name.trim() == "") {
|
||||||
return "untitled";
|
return kUntitled;
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -3,12 +3,12 @@ import '../consts.dart';
|
|||||||
|
|
||||||
String getRequestTitleFromUrl(String? url) {
|
String getRequestTitleFromUrl(String? url) {
|
||||||
if (url == null || url.trim() == "") {
|
if (url == null || url.trim() == "") {
|
||||||
return "untitled";
|
return kUntitled;
|
||||||
}
|
}
|
||||||
if (url.contains("://")) {
|
if (url.contains("://")) {
|
||||||
String rem = url.split("://")[1];
|
String rem = url.split("://")[1];
|
||||||
if (rem.trim() == "") {
|
if (rem.trim() == "") {
|
||||||
return "untitled";
|
return kUntitled;
|
||||||
}
|
}
|
||||||
return rem;
|
return rem;
|
||||||
}
|
}
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
import 'package:apidash_core/apidash_core.dart';
|
|
||||||
import 'package:apidash_design_system/apidash_design_system.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class DropdownButtonAPIType extends StatelessWidget {
|
|
||||||
const DropdownButtonAPIType({
|
|
||||||
super.key,
|
|
||||||
this.apiType,
|
|
||||||
this.onChanged,
|
|
||||||
});
|
|
||||||
|
|
||||||
final APIType? apiType;
|
|
||||||
final void Function(APIType?)? onChanged;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return ADDropdownButton<APIType>(
|
|
||||||
value: apiType,
|
|
||||||
values: APIType.values.map((e) => (e, e.label)),
|
|
||||||
onChanged: onChanged,
|
|
||||||
isDense: true,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user