mirror of
https://github.com/foss42/apidash.git
synced 2025-12-05 12:34:26 +08:00
Merge branch 'foss42:main' into add-request-cancellation
This commit is contained in:
@@ -90,7 +90,7 @@ class EditRequestHeadersState extends ConsumerState<EditRequestHeaders> {
|
||||
key: ValueKey("$selectedId-$index-headers-row-$seed"),
|
||||
cells: <DataCell>[
|
||||
DataCell(
|
||||
CheckBox(
|
||||
ADCheckBox(
|
||||
keyId: "$selectedId-$index-headers-c-$seed",
|
||||
value: isRowEnabledList[index],
|
||||
onChanged: isLast
|
||||
|
||||
@@ -5,7 +5,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:data_table_2/data_table_2.dart';
|
||||
import 'package:apidash/providers/providers.dart';
|
||||
import 'package:apidash/widgets/widgets.dart';
|
||||
import 'package:apidash/consts.dart';
|
||||
import 'package:apidash/screens/common_widgets/common_widgets.dart';
|
||||
|
||||
@@ -90,7 +89,7 @@ class EditRequestURLParamsState extends ConsumerState<EditRequestURLParams> {
|
||||
key: ValueKey("$selectedId-$index-params-row-$seed"),
|
||||
cells: <DataCell>[
|
||||
DataCell(
|
||||
CheckBox(
|
||||
ADCheckBox(
|
||||
keyId: "$selectedId-$index-params-c-$seed",
|
||||
value: isRowEnabledList[index],
|
||||
onChanged: isLast
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import 'package:apidash_design_system/apidash_design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:apidash/providers/providers.dart';
|
||||
import 'package:apidash/extensions/extensions.dart';
|
||||
import 'package:apidash/widgets/widgets.dart';
|
||||
import 'package:apidash/consts.dart';
|
||||
import 'details_card/details_card.dart';
|
||||
import 'details_card/request_pane/request_pane.dart';
|
||||
import '../../common_widgets/common_widgets.dart';
|
||||
import 'request_editor_top_bar.dart';
|
||||
import 'url_card.dart';
|
||||
|
||||
class RequestEditor extends StatelessWidget {
|
||||
@@ -42,53 +39,3 @@ class RequestEditor extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class RequestEditorTopBar extends ConsumerWidget {
|
||||
const RequestEditorTopBar({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final id = ref.watch(selectedIdStateProvider);
|
||||
final name =
|
||||
ref.watch(selectedRequestModelProvider.select((value) => value?.name));
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 12.0,
|
||||
top: 4.0,
|
||||
right: 4.0,
|
||||
bottom: 4.0,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
name ?? "",
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 6,
|
||||
),
|
||||
EditorTitleActions(
|
||||
onRenamePressed: () {
|
||||
showRenameDialog(context, "Rename Request", name, (val) {
|
||||
ref
|
||||
.read(collectionStateNotifierProvider.notifier)
|
||||
.update(id!, name: val);
|
||||
});
|
||||
},
|
||||
onDuplicatePressed: () => ref
|
||||
.read(collectionStateNotifierProvider.notifier)
|
||||
.duplicate(id!),
|
||||
onDeletePressed: () =>
|
||||
ref.read(collectionStateNotifierProvider.notifier).remove(id!),
|
||||
),
|
||||
kHSpacer10,
|
||||
const EnvironmentDropdown(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
import 'package:apidash_core/apidash_core.dart';
|
||||
import 'package:apidash_design_system/apidash_design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:apidash/providers/providers.dart';
|
||||
import 'package:apidash/widgets/widgets.dart';
|
||||
import '../../common_widgets/common_widgets.dart';
|
||||
|
||||
class RequestEditorTopBar extends ConsumerWidget {
|
||||
const RequestEditorTopBar({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final id = ref.watch(selectedIdStateProvider);
|
||||
final name =
|
||||
ref.watch(selectedRequestModelProvider.select((value) => value?.name));
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 12.0,
|
||||
top: 4.0,
|
||||
right: 4.0,
|
||||
bottom: 4.0,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
DropdownButtonAPIType(
|
||||
apiType: APIType.rest,
|
||||
onChanged: (apiType) {},
|
||||
),
|
||||
kHSpacer10,
|
||||
Expanded(
|
||||
child: Text(
|
||||
name ?? "",
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
),
|
||||
),
|
||||
kHSpacer10,
|
||||
EditorTitleActions(
|
||||
onRenamePressed: () {
|
||||
showRenameDialog(context, "Rename Request", name, (val) {
|
||||
ref
|
||||
.read(collectionStateNotifierProvider.notifier)
|
||||
.update(id!, name: val);
|
||||
});
|
||||
},
|
||||
onDuplicatePressed: () => ref
|
||||
.read(collectionStateNotifierProvider.notifier)
|
||||
.duplicate(id!),
|
||||
onDeletePressed: () =>
|
||||
ref.read(collectionStateNotifierProvider.notifier).remove(id!),
|
||||
),
|
||||
kHSpacer10,
|
||||
const EnvironmentDropdown(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user