mirror of
https://github.com/foss42/apidash.git
synced 2025-12-05 12:34:26 +08:00
feat: enhance EditRequestPane with segmented layout for EditGraphQLRequestPane
This commit is contained in:
@@ -23,7 +23,7 @@ class EditRequestPane extends ConsumerWidget {
|
||||
final isPopped =
|
||||
ref.watch(dashbotWindowNotifierProvider.select((s) => s.isPopped));
|
||||
|
||||
// When Dashbot window is popped, compact segmented layout like History page should be shown
|
||||
// When Dashbot window is not popped, show compact segmented layout like History page
|
||||
if (isPopped == false && apiType == APIType.rest) {
|
||||
return DefaultTabController(
|
||||
length: 3,
|
||||
@@ -60,6 +60,42 @@ class EditRequestPane extends ConsumerWidget {
|
||||
);
|
||||
}
|
||||
|
||||
if (isPopped == false && apiType == APIType.graphql) {
|
||||
return DefaultTabController(
|
||||
length: 3,
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
final controller = DefaultTabController.of(context);
|
||||
return Column(
|
||||
children: [
|
||||
kVSpacer10,
|
||||
SegmentedTabbar(
|
||||
controller: controller,
|
||||
tabs: const [
|
||||
Tab(text: kLabelRequest),
|
||||
Tab(text: kLabelResponse),
|
||||
Tab(text: kLabelCode),
|
||||
],
|
||||
),
|
||||
kVSpacer10,
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
controller: controller,
|
||||
children: const [
|
||||
EditGraphQLRequestPane(),
|
||||
ResponsePane(),
|
||||
CodePane(),
|
||||
],
|
||||
),
|
||||
),
|
||||
kVSpacer8,
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return switch (apiType) {
|
||||
APIType.rest => const EditRestRequestPane(),
|
||||
APIType.graphql => const EditGraphQLRequestPane(),
|
||||
|
||||
Reference in New Issue
Block a user