Skip to content

Commit

Permalink
chore: Add version to example app and widgetbook (#79)
Browse files Browse the repository at this point in the history
deps: Update example app / widgetbook deps
chore: update example app web implementation
docs: Add introduction page to widgetbook
docs: Add new addons to widgetbook
  • Loading branch information
thelukewalton committed May 24, 2024
1 parent 418cc1d commit c1dafeb
Show file tree
Hide file tree
Showing 15 changed files with 296 additions and 36 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Zeta is the new, formal, standardized Zebra Design System based off the successe
### Prerequisites

```
dart sdk: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"
dart sdk: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"
```

## Installation
Expand All @@ -30,7 +30,7 @@ Zeta allows you to specify an initial theme mode for your app, which can be one
By default, the theme mode is set to `ThemeMode.system`.

```dart
initialThemeMode: ThemeMode.light
initialThemeMode: ThemeMode.system
```

### Providing Initial Theme Data
Expand Down
6 changes: 6 additions & 0 deletions example/assets/zebra-logo-head.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion example/lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ class _HomeState extends State<Home> {
final _assets = assets..sort((a, b) => a.name.compareTo(b.name));
final _theme = theme..sort((a, b) => a.name.compareTo(b.name));
return ExampleScaffold(
name: 'Zeta',
// x-release-please-start-version
name: 'zeta_flutter v0.9.1',
// x-release-please-end
child: SingleChildScrollView(
child: Column(
children: [
Expand Down
4 changes: 4 additions & 0 deletions example/linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

#include "generated_plugin_registrant.h"

#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
}
1 change: 1 addition & 0 deletions example/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_linux
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
2 changes: 2 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import Foundation
import path_provider_foundation
import shared_preferences_foundation
import sqflite
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
6 changes: 6 additions & 0 deletions example/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ PODS:
- sqflite (0.0.3):
- Flutter
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS

DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/darwin`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)

EXTERNAL SOURCES:
FlutterMacOS:
Expand All @@ -25,12 +28,15 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
sqflite:
:path: Flutter/ephemeral/.symlinks/plugins/sqflite/darwin
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos

SPEC CHECKSUMS:
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
url_launcher_macos: 5f437abeda8c85500ceb03f5c1938a8c5a705399

PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7

Expand Down
5 changes: 5 additions & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ dependencies:
cached_network_image: ^3.3.1
flutter:
sdk: flutter
flutter_svg: ^2.0.10+1
go_router: ^14.1.2
google_fonts: ^6.2.1
markdown_widget: ^2.3.2+6
path_drawing: ^1.0.1
shared_preferences: ^2.2.2
url_launcher: ^6.2.6
zeta_flutter:
path: ../

Expand All @@ -26,3 +30,4 @@ flutter:
uses-material-design: true
assets:
- assets/
- ../README.md
27 changes: 3 additions & 24 deletions example/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,18 @@
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="zeta_flutter_example">
<meta name="apple-mobile-web-app-title" content="zeta_flutter example">
<link rel="apple-touch-icon" href="icons/Icon-192.png">

<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png" />

<title>zeta_flutter_example</title>
<title>zeta_flutter example</title>
<link rel="manifest" href="manifest.json">

<script>
// The value below is injected by flutter build, do not touch.
const serviceWorkerVersion = null;
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
</head>

<body>
<script>
window.addEventListener('load', function (ev) {
// Download main.dart.js
_flutter.loader.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
},
onEntrypointLoaded: function (engineInitializer) {
engineInitializer.initializeEngine({ useColorEmoji: true, }).then(function (appRunner) {
appRunner.runApp();
});
}
});
});
</script>
<script src="flutter_bootstrap.js" async></script>
</body>

</html>
8 changes: 4 additions & 4 deletions example/web/manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "zeta_flutter_example",
"short_name": "zeta_flutter_example",
"name": "zeta_flutter example",
"short_name": "zeta_flutter example",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "Demonstrates how to use the zeta_flutter plugin.",
"description": "Demonstrates how to use the zeta_flutter library",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
Expand All @@ -32,4 +32,4 @@
"purpose": "maskable"
}
]
}
}
28 changes: 25 additions & 3 deletions example/widgetbook/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:widgetbook/widgetbook.dart';
import 'package:zeta_flutter/zeta_flutter.dart';

Expand Down Expand Up @@ -42,22 +43,39 @@ import 'pages/components/snack_bar_widgetbook.dart';
import 'pages/components/tabs_widgetbook.dart';
import 'pages/components/time_input_widgetbook.dart';
import 'pages/components/tooltip_widgetbook.dart';
import 'pages/introduction.dart';
import 'pages/theme/color_widgetbook.dart';
import 'pages/theme/radius_widgetbook.dart';
import 'pages/theme/spacing_widgetbook.dart';
import 'pages/theme/typography_widgetbook.dart';
import 'utils/zebra.dart';

void main() => runApp(const HotReload());
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
String readme = await rootBundle.loadString('../README.md');

class HotReload extends StatelessWidget {
const HotReload({super.key});
runApp(HotReload(readme: readme));
}

class HotReload extends StatefulWidget {
final String readme;
const HotReload({super.key, required this.readme});

@override
State<HotReload> createState() => _HotReloadState();
}

class _HotReloadState extends State<HotReload> {
@override
Widget build(BuildContext context) {
return Widgetbook(
appBuilder: (context, child) => child,
initialRoute: '?path=introduction',
directories: [
WidgetbookUseCase(
name: 'Introduction',
builder: (BuildContext context) => IntroductionWidgetbook(readme: widget.readme),
),
WidgetbookCategory(
name: 'Components',
isInitiallyExpanded: false,
Expand Down Expand Up @@ -221,6 +239,10 @@ class HotReload extends StatelessWidget {
);
},
),
AccessibilityAddon(),
InspectorAddon(enabled: false),
ZoomAddon(initialZoom: 1.0),
TextScaleAddon(scales: [1.0, 1.2, 1.4, 1.6, 1.8, 2.0], initialScale: 1),
],
);
}
Expand Down
Loading

0 comments on commit c1dafeb

Please sign in to comment.