Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/codegen/codegen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,6 @@ class Codegen {
case CodegenLanguage.swiftUrlSession:
return SwiftURLSessionCodeGen().getCode(rM);
}
return null;
}
}
8 changes: 8 additions & 0 deletions lib/consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const kSuggestionsMenuMaxHeight = 200.0;

const kSegmentedTabWidth = 140.0;
const kSegmentedTabHeight = 32.0;
const kSegmentedTabMinWidth = 80.0;

const kDataTableScrollbarTheme = ScrollbarThemeData(
crossAxisMargin: -4,
Expand Down Expand Up @@ -459,6 +460,13 @@ const kLabelStop = "Stop";
const kLabelOk = "Ok";
const kLabelImport = "Import";
const kUntitled = "untitled";
// Empty State
const kMsgEmptyRequestEditorTitle = "No Request Selected";
const kMsgEmptyRequestEditorSubtitle =
"Create a new API request or select one from the sidebar to get started";
const kLabelNewRequest = "New Request";
const kMsgKeyboardShortcut = "Press ⌘N to create new";

// Request Pane
const kLabelRequest = "Request";
const kLabelHideCode = "Hide Code";
Expand Down
1 change: 1 addition & 0 deletions lib/providers/terminal_providers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,5 +217,6 @@ class TerminalController extends StateNotifier<TerminalState> {
final s = e.system!;
return s.message;
}
return null;
}
}
87 changes: 61 additions & 26 deletions lib/screens/home_page/editor_pane/editor_default.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,71 @@ class RequestEditorDefault extends ConsumerWidget {

@override
Widget build(BuildContext context, WidgetRef ref) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "Click ",
style: Theme.of(context).textTheme.titleMedium,
final theme = Theme.of(context);

return Center(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// Icon
Icon(
Icons.api_rounded,
size: 64,
color: theme.colorScheme.outline.withOpacity(0.5),
),
const SizedBox(height: 24),

// Title
Text(
kMsgEmptyRequestEditorTitle,
style: theme.textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.w600,
color: theme.colorScheme.onSurface,
),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: ElevatedButton(
onPressed: () {
ref.read(collectionStateNotifierProvider.notifier).add();
},
child: const Text(
kLabelPlusNew,
style: kTextStyleButton,
),
),
),
const SizedBox(height: 12),

// Subtitle
Text(
kMsgEmptyRequestEditorSubtitle,
style: theme.textTheme.bodyMedium?.copyWith(
color: theme.colorScheme.outline,
),
TextSpan(
text: " to start drafting a new API request.",
style: Theme.of(context).textTheme.titleMedium,
textAlign: TextAlign.center,
),
const SizedBox(height: 32),

// Primary Action Button
ElevatedButton.icon(
onPressed: () {
ref.read(collectionStateNotifierProvider.notifier).add();
},
icon: const Icon(Icons.add_rounded, size: 20),
label: const Text(
kLabelNewRequest,
style: kTextStyleButton,
),
style: ElevatedButton.styleFrom(
padding:
const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
),
),
const SizedBox(height: 16),

// Keyboard Shortcut Hint
if (kIsMacOS || kIsWindows)
Text(
kIsMacOS ? kMsgKeyboardShortcut : "Press Ctrl+N to create new",
style: theme.textTheme.bodySmall?.copyWith(
color: theme.colorScheme.outline.withOpacity(0.7),
fontStyle: FontStyle.italic,
),
),
],
),
],
),
],
),
);
}
}
18 changes: 12 additions & 6 deletions lib/widgets/tab_label.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ class TabLabel extends StatelessWidget {
child: Stack(
children: [
Center(
child: Text(
text,
textAlign: TextAlign.center,
overflow: TextOverflow.fade,
softWrap: false,
style: kTextStyleTab,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: FittedBox(
fit: BoxFit.scaleDown,
child: Text(
text,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: kTextStyleTab,
),
),
),
),
if (showIndicator)
Expand Down
84 changes: 53 additions & 31 deletions lib/widgets/tabbar_segmented.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,61 @@ class SegmentedTabbar extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Center(
child: Container(
margin: kPh4,
width: tabWidth * tabs.length,
height: tabHeight,
decoration: BoxDecoration(
borderRadius: kBorderRadius20,
border: Border.all(
color: Theme.of(context).colorScheme.outlineVariant,
),
),
child: ClipRRect(
borderRadius: kBorderRadius20,
child: TabBar(
dividerColor: Colors.transparent,
indicatorWeight: 0.0,
indicatorSize: TabBarIndicatorSize.tab,
unselectedLabelColor: Theme.of(context).colorScheme.outline,
labelStyle: kTextStyleTab.copyWith(
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onPrimary,
),
unselectedLabelStyle: kTextStyleTab,
splashBorderRadius: kBorderRadius20,
indicator: BoxDecoration(
borderRadius: kBorderRadius20,
color: Theme.of(context).colorScheme.primary,
return LayoutBuilder(
builder: (context, constraints) {
// Calculate the ideal width for all tabs
final idealWidth = tabWidth * tabs.length;

// Account for padding and margins (8px on each side = 16px total)
final availableWidth = constraints.maxWidth - 16;

// Determine if we need scrolling
final needsScrolling = idealWidth > availableWidth;

// Use ideal width if scrolling, otherwise fit to available width
final containerWidth = needsScrolling ? idealWidth : availableWidth;

return Center(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
physics: needsScrolling
? const BouncingScrollPhysics()
: const NeverScrollableScrollPhysics(),
child: Container(
margin: kPh4,
width: containerWidth,
height: tabHeight,
decoration: BoxDecoration(
borderRadius: kBorderRadius20,
border: Border.all(
color: Theme.of(context).colorScheme.outlineVariant,
),
),
child: ClipRRect(
borderRadius: kBorderRadius20,
child: TabBar(
dividerColor: Colors.transparent,
indicatorWeight: 0.0,
indicatorSize: TabBarIndicatorSize.tab,
unselectedLabelColor: Theme.of(context).colorScheme.outline,
labelStyle: kTextStyleTab.copyWith(
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onPrimary,
),
unselectedLabelStyle: kTextStyleTab,
splashBorderRadius: kBorderRadius20,
indicator: BoxDecoration(
borderRadius: kBorderRadius20,
color: Theme.of(context).colorScheme.primary,
),
controller: controller,
tabs: tabs,
),
),
),
controller: controller,
tabs: tabs,
),
),
),
);
},
);
}
}
8 changes: 4 additions & 4 deletions packages/better_networking/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
url: "https://pub.dev"
source: hosted
version: "1.16.0"
version: "1.17.0"
oauth1:
dependency: transitive
description:
Expand Down Expand Up @@ -423,10 +423,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
url: "https://pub.dev"
source: hosted
version: "0.7.6"
version: "0.7.7"
typed_data:
dependency: transitive
description:
Expand Down
8 changes: 4 additions & 4 deletions packages/genai/genai_example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
url: "https://pub.dev"
source: hosted
version: "1.16.0"
version: "1.17.0"
nanoid:
dependency: transitive
description:
Expand Down Expand Up @@ -438,10 +438,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
url: "https://pub.dev"
source: hosted
version: "0.7.6"
version: "0.7.7"
typed_data:
dependency: transitive
description:
Expand Down
8 changes: 4 additions & 4 deletions packages/json_field_editor/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
url: "https://pub.dev"
source: hosted
version: "1.16.0"
version: "1.17.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -211,10 +211,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
url: "https://pub.dev"
source: hosted
version: "0.7.6"
version: "0.7.7"
vector_math:
dependency: transitive
description:
Expand Down
8 changes: 4 additions & 4 deletions packages/multi_trigger_autocomplete_plus/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
url: "https://pub.dev"
source: hosted
version: "1.16.0"
version: "1.17.0"
multi_trigger_autocomplete_plus:
dependency: "direct main"
description:
Expand Down Expand Up @@ -315,10 +315,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
url: "https://pub.dev"
source: hosted
version: "0.7.6"
version: "0.7.7"
typed_data:
dependency: transitive
description:
Expand Down
Loading