feat: enhance EditRequestPane with segmented layout for EditGraphQLRequestPane

This commit is contained in:
Udhay-Adithya
2025-09-05 12:48:41 +05:30
parent 1c3eccd9fd
commit 7e13a48199

View File

@@ -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(),