Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
55e9376
Initial tree implementation
hawkkiller Jul 31, 2025
74dbc4c
Implemented tree view
hawkkiller Jul 31, 2025
84b134b
Enhance button preview and showcase root functionality
hawkkiller Jul 31, 2025
44bbc6f
wip
hawkkiller Aug 2, 2025
c643c40
Simplify structure
hawkkiller Aug 2, 2025
dddd60c
Refactor routing and enhance button preview functionality
hawkkiller Aug 2, 2025
409c2f7
Enhance ShowcaseTreeView with selection state and expanded node logic
hawkkiller Aug 2, 2025
9cb3c56
Refactor ShowcaseTreeView for improved node handling and UI interaction
hawkkiller Aug 2, 2025
668e71f
Update showcase view for mobile
hawkkiller Aug 2, 2025
69bb8f1
Enhance showcase functionality with new components and previews
hawkkiller Aug 2, 2025
55a212f
Update showcase node preview
hawkkiller Aug 3, 2025
bf3b845
Add device preview
hawkkiller Aug 3, 2025
4b202f8
Add Card preview to showcase
hawkkiller Aug 3, 2025
f30d846
Refactor CardPreview and remove ShowcaseNodeMixin
hawkkiller Aug 3, 2025
20c28bf
Enhance button preview and add boolean input widget
hawkkiller Aug 3, 2025
e59a0e6
Add checkbox preview
hawkkiller Aug 4, 2025
2e87638
Decouple the routing solution
hawkkiller Aug 8, 2025
da27546
Implement theme selection functionality in showcase
hawkkiller Aug 9, 2025
b173181
Correctly save state
hawkkiller Aug 9, 2025
075107b
Remove unused import for theme input in component preview
hawkkiller Aug 9, 2025
fd4329a
Add component preview sidebar functionality
hawkkiller Aug 9, 2025
220a61f
Merge branch 'main' of https://github.com/hawkkiller/sizzle_starter i…
hawkkiller Oct 5, 2025
6fa5a44
chore: add ui_showcase to workspace
hawkkiller Oct 5, 2025
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
8 changes: 8 additions & 0 deletions .cursor/rules/flutter.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
globs: app/**/*.dart,core/**/*.dart
alwaysApply: false
---

## Widgets

- Use SizedBox, DecoratedBox, Padding, etc. instead of Container.
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
"type": "dart",
"cwd": "${workspaceFolder}/app",
"flutterMode": "release"
},
{
"name": "ui_library_showcase",
"request": "launch",
"type": "dart",
"cwd": "${workspaceFolder}/core/ui_library/example",
"program": "lib/main.dart"
}
]
}
45 changes: 45 additions & 0 deletions core/ui_library/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
30 changes: 30 additions & 0 deletions core/ui_library/example/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "be698c48a6750c8cb8e61c740ca9991bb947aba2"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: be698c48a6750c8cb8e61c740ca9991bb947aba2
base_revision: be698c48a6750c8cb8e61c740ca9991bb947aba2
- platform: macos
create_revision: be698c48a6750c8cb8e61c740ca9991bb947aba2
base_revision: be698c48a6750c8cb8e61c740ca9991bb947aba2

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
3 changes: 3 additions & 0 deletions core/ui_library/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# example

A new Flutter project.
3 changes: 3 additions & 0 deletions core/ui_library/example/devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
52 changes: 52 additions & 0 deletions core/ui_library/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import 'package:example/src/previews/button_preview.dart';
import 'package:example/src/previews/card_preview.dart';
import 'package:example/src/previews/checkbox_preview.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:ui_showcase/ui_showcase.dart';

void main() {
runApp(const MyApp());
}

final showcaseNodes = [
ShowcaseNode(name: 'Button', widget: const SomeButtonPreview()),
ShowcaseNode(name: 'Card', widget: const CardPreview()),
ShowcaseNode(name: 'Checkbox', widget: const CheckboxPreview()),
];

class MyApp extends StatefulWidget {
const MyApp({super.key});

@override
State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
late final RouterConfig<Object> router;

@override
void initState() {
super.initState();
router = GoRouter(
routes: [
createRootShowcaseRoute(
nodes: showcaseNodes,
builder: (context, child) => ThemeOptionProvider(
options: [
ThemeOption(name: 'Light', theme: ThemeData.light()),
ThemeOption(name: 'Dark', theme: ThemeData.dark()),
],
child: child,
),
),
],
);
}

@override
Widget build(BuildContext context) => MaterialApp.router(
routerConfig: router,
debugShowCheckedModeBanner: false,
);
}
39 changes: 39 additions & 0 deletions core/ui_library/example/lib/src/previews/button_preview.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:example/src/widget/component_preview.dart';
import 'package:flutter/material.dart';
import 'package:ui_showcase/ui_showcase.dart';

class SomeButtonPreview extends StatefulWidget {
const SomeButtonPreview({super.key});

@override
State<SomeButtonPreview> createState() => _SomeButtonPreviewState();
}

class _SomeButtonPreviewState extends State<SomeButtonPreview> {
final _labelController = TextEditingController(text: 'Click Me!');
final _enabledController = ValueNotifier(true);

@override
Widget build(BuildContext context) {
return ComponentPreview(
inputs: [
StringInput(
label: 'Label',
description: 'The label of the button',
controller: _labelController,
),
BooleanInput(
label: 'Enabled',
description: 'Whether the button is enabled',
notifier: _enabledController,
),
],
builder: (context) {
return ElevatedButton(
onPressed: _enabledController.value ? () {} : null,
child: Text(_labelController.text),
);
},
);
}
}
35 changes: 35 additions & 0 deletions core/ui_library/example/lib/src/previews/card_preview.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import 'package:example/src/widget/component_preview.dart';
import 'package:flutter/material.dart';
import 'package:ui_showcase/ui_showcase.dart';

class CardPreview extends StatefulWidget {
const CardPreview({super.key});

@override
State<CardPreview> createState() => _CardPreviewState();
}

class _CardPreviewState extends State<CardPreview> {
final _controller = TextEditingController(text: 'Card');

@override
Widget build(BuildContext context) {
return ComponentPreview(
inputs: [
StringInput(
label: 'Label',
description: 'The label of the button',
controller: _controller,
),
],
builder: (context) {
return Card(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(_controller.text),
),
);
},
);
}
}
35 changes: 35 additions & 0 deletions core/ui_library/example/lib/src/previews/checkbox_preview.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import 'package:example/src/widget/component_preview.dart';
import 'package:flutter/material.dart';
import 'package:ui_showcase/ui_showcase.dart';

class CheckboxPreview extends StatefulWidget {
const CheckboxPreview({super.key});

@override
State<CheckboxPreview> createState() => _CheckboxPreviewState();
}

class _CheckboxPreviewState extends State<CheckboxPreview> {
final _enabledController = ValueNotifier(true);

@override
Widget build(BuildContext context) {
return ComponentPreview(
inputs: [
BooleanInput(
label: 'Value',
description: 'The value of the checkbox',
notifier: _enabledController,
),
],
builder: (context) {
return Checkbox(
value: _enabledController.value,
onChanged: (value) {
_enabledController.value = value ?? false;
},
);
},
);
}
}
27 changes: 27 additions & 0 deletions core/ui_library/example/lib/src/widget/component_preview.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'package:example/src/widget/sidebar.dart';
import 'package:flutter/material.dart';
import 'package:ui_showcase/ui_showcase.dart';

class ComponentPreview extends StatelessWidget {
const ComponentPreview({
required this.inputs,
required this.builder,
super.key,
});

final List<InputWidget> inputs;
final WidgetBuilder builder;

@override
Widget build(BuildContext context) => ShowcaseNodePreview(
builder: builder,
listenables: inputs.map((e) => e.listenable).toList(growable: false),
sidebar: Sidebar(children: inputs),
wrapWith: (child) {
return MaterialApp(
theme: ThemeOptionProvider.of(context).theme,
home: Scaffold(body: Center(child: child)),
);
},
);
}
28 changes: 28 additions & 0 deletions core/ui_library/example/lib/src/widget/sidebar.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
import 'package:ui_showcase/ui_showcase.dart';

class Sidebar extends StatelessWidget {
const Sidebar({
required this.children,
this.includeThemeSwitcher = true,
super.key,
});

final bool includeThemeSwitcher;
final List<Widget> children;

@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: const EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 24,
children: [
if (includeThemeSwitcher) const ThemeOptionInput(),
...children,
],
),
);
}
}
Loading
Loading