Skip to content

Commit

Permalink
Merge + add storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
Osman authored and Osman committed Mar 6, 2024
2 parents 009e84c + 12cd2e5 commit ef240ed
Show file tree
Hide file tree
Showing 35 changed files with 1,317 additions and 1,233 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.4.0"
".": "0.5.0"
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
- [`ed1210d`](https://github.com/zebratechnologies/zeta-flutter/commit/ed1210d6cbc173aef8b1adf0d20ee91d3e87f2c3) - Update Widgetbook to correct functionality _(PR [#52](https://github.com/zebratechnologies/zeta-flutter/pull/52) by [@thelukewalton](https://github.com/thelukewalton))_
- [`c627d7a`](https://github.com/zebratechnologies/zeta-flutter/commit/c627d7ab19d3f33e30c406441702ff6134557f14) - Tidy up example app _(PR [#53](https://github.com/zebratechnologies/zeta-flutter/pull/53) by [@thelukewalton](https://github.com/thelukewalton))_

## [0.5.0](https://github.com/ZebraDevs/zeta_flutter/compare/v0.4.0...v0.5.0) (2024-03-05)


### Features

* Dial Pad ([#30](https://github.com/ZebraDevs/zeta_flutter/issues/30)) ([f16df26](https://github.com/ZebraDevs/zeta_flutter/commit/f16df261feb703b20147c4ba406ed1fa3450348b))
* Icon button ([#26](https://github.com/ZebraDevs/zeta_flutter/issues/26)) ([88cd90a](https://github.com/ZebraDevs/zeta_flutter/commit/88cd90a8180df39e3e44c168ca028055333643a6))
* Navigation bar ([#32](https://github.com/ZebraDevs/zeta_flutter/issues/32)) ([36a60e7](https://github.com/ZebraDevs/zeta_flutter/commit/36a60e7087af7d38bfd64578009056d85b0f1e56))
* Progress Bar ([#29](https://github.com/ZebraDevs/zeta_flutter/issues/29)) ([d18dbd2](https://github.com/ZebraDevs/zeta_flutter/commit/d18dbd276177c368e5d5cf80e482ea11564270a9))
* update icons/0.1.65 ([#24](https://github.com/ZebraDevs/zeta_flutter/issues/24)) ([9f0e7f2](https://github.com/ZebraDevs/zeta_flutter/commit/9f0e7f286470c99722e928e726b5a9eb1b0b7b8b))
* Widgetbook hot reload ([#33](https://github.com/ZebraDevs/zeta_flutter/issues/33)) ([44b8f98](https://github.com/ZebraDevs/zeta_flutter/commit/44b8f989850aaa1a6d862526bad26a01ffad361a))

## [0.4.0](https://github.com/ZebraDevs/zeta_flutter/compare/v0.3.0...v0.4.0) (2024-02-14)


Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ Zeta is the new, formal, standardized Zebra Design System based off the successe

> 🚧 **Note**: This package is in pre-release, and so many aspects are incomplete.
### Prerequisites

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

## Installation

To install `zeta_flutter`, follow the instructions [here](https://pub.dev/packages/zeta_flutter/install).
Expand Down
2 changes: 2 additions & 0 deletions example/lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:zeta_example/pages/components/button_example.dart';
import 'package:zeta_example/pages/components/checkbox_example.dart';
import 'package:zeta_example/pages/components/chip_example.dart';
import 'package:zeta_example/pages/components/dialpad_example.dart';
import 'package:zeta_example/pages/components/navigation_bar_example.dart';
import 'package:zeta_example/pages/theme/color_example.dart';
import 'package:zeta_example/pages/components/password_input_example.dart';
import 'package:zeta_example/pages/components/progress_example.dart';
Expand All @@ -32,6 +33,7 @@ final List<Component> components = [
Component(ButtonExample.name, (context) => const ButtonExample()),
Component(CheckBoxExample.name, (context) => const CheckBoxExample()),
Component(ChipExample.name, (context) => const ChipExample()),
Component(NavigationBarExample.name, (context) => const NavigationBarExample()),
Component(PasswordInputExample.name, (context) => const PasswordInputExample()),
Component(ProgressExample.name, (context) => const ProgressExample()),
Component(DialPadExample.name, (context) => const DialPadExample()),
Expand Down
55 changes: 55 additions & 0 deletions example/lib/pages/components/navigation_bar_example.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import 'package:flutter/material.dart';
import 'package:zeta_example/widgets.dart';
import 'package:zeta_flutter/zeta_flutter.dart';

class NavigationBarExample extends StatefulWidget {
static const String name = 'NavigationBar';

const NavigationBarExample({super.key});

@override
State<NavigationBarExample> createState() => _NavigationBarExampleState();
}

class _NavigationBarExampleState extends State<NavigationBarExample> {
int selectedIndex = 0;

@override
Widget build(BuildContext context) {
final items = [
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label', badge: ZetaIndicator(value: 2)),
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'),
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'),
ZetaNavigationBarItem(icon: ZetaIcons.star_round, label: 'Label'),
];

return ExampleScaffold(
name: 'Navigation Bar',
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ZetaNavigationBar.divided(items: items, dividerIndex: 3),
const SizedBox(height: 16),
ZetaNavigationBar.split(items: items),
const SizedBox(height: 16),
ZetaNavigationBar.action(
items: items,
action: ZetaButton.primary(
label: 'Button',
onPressed: () {},
),
),
],
),
),
bottomNavigationBar: ZetaNavigationBar(
items: items,
currentIndex: selectedIndex,
onTap: (val) => setState(() {
selectedIndex = val;
}),
),
);
}
}
82 changes: 36 additions & 46 deletions example/lib/pages/components/progress_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,35 @@ class ProgressExampleState extends State<ProgressExample> {
child: SingleChildScrollView(
child: SizedBox(
width: double.infinity,
child: Column(
children: [
Text('Progress Bars', style: ZetaTextStyles.displayMedium),
SizedBox(
height: 20,
),
Wrapper(
stepsCompleted: 10,
isThin: true,
),
SizedBox(
height: 20,
),
Wrapper(
stepsCompleted: 0,
type: ZetaBarType.standard,
isThin: false,
stateChangeable: true),
SizedBox(
height: 20,
),
Wrapper(
child: Column(children: [
Wrapper(
stepsCompleted: 10,
isThin: true,
),
SizedBox(
height: 20,
),
Wrapper(
stepsCompleted: 0,
type: ZetaBarType.indeterminate,
type: ZetaProgressBarType.standard,
isThin: false,
label: "UPLOADING ...",
),
SizedBox(
height: 20,
),
Text('Progress CIrcles', style: ZetaTextStyles.displayMedium),
SizedBox(
height: 80,
),
Wrapper(
stepsCompleted: 0,
circleSize: ZetaCircleSizes.xl,
rounded: false,
isCircle: true,
),
],
),
stateChangeable: true),
SizedBox(
height: 20,
),
Wrapper(
stepsCompleted: 0,
type: ZetaProgressBarType.indeterminate,
isThin: false,
label: "UPLOADING ...",
),
Wrapper(
stepsCompleted: 0,
circleSize: ZetaCircleSizes.xl,
rounded: false,
isCircle: true,
),
]),
),
),
),
Expand All @@ -73,7 +60,7 @@ class Wrapper extends StatefulWidget {
const Wrapper({
super.key,
required this.stepsCompleted,
this.type = ZetaBarType.standard,
this.type = ZetaProgressBarType.standard,
this.isThin = false,
this.rounded = true,
this.stateChangeable = false,
Expand All @@ -84,7 +71,7 @@ class Wrapper extends StatefulWidget {

final int stepsCompleted;
final bool? rounded;
final ZetaBarType? type;
final ZetaProgressBarType? type;
final bool? isThin;
final String? label;
final bool? stateChangeable;
Expand All @@ -98,7 +85,7 @@ class Wrapper extends StatefulWidget {
class _WrapperState extends State<Wrapper> {
late int stepsCompleted;
late double progress;
late ZetaBarType type;
late ZetaProgressBarType type;

@override
void initState() {
Expand All @@ -118,7 +105,9 @@ class _WrapperState extends State<Wrapper> {

void setLoading() {
setState(() {
type = type == ZetaBarType.buffering ? ZetaBarType.standard : ZetaBarType.buffering;
type = type == ZetaProgressBarType.buffering
? ZetaProgressBarType.standard
: ZetaProgressBarType.buffering;
});
}

Expand Down Expand Up @@ -147,8 +136,9 @@ class _WrapperState extends State<Wrapper> {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
widget.type != ZetaBarType.indeterminate
? FilledButton(onPressed: increasePercentage, child: Text("Increase"))
widget.type != ZetaProgressBarType.indeterminate
? FilledButton(
onPressed: increasePercentage, child: Text("Increase"))
: Container(),
const SizedBox(width: 40),
widget.stateChangeable!
Expand Down
3 changes: 3 additions & 0 deletions example/lib/widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ class ExampleScaffold extends StatelessWidget {
final Widget child;
final List<Widget> actions;
final Widget? floatingActionButton;
final Widget? bottomNavigationBar;

const ExampleScaffold({
required this.name,
required this.child,
this.actions = const [],
this.floatingActionButton,
this.bottomNavigationBar,
super.key,
});

Expand All @@ -98,6 +100,7 @@ class ExampleScaffold extends StatelessWidget {
],
),
backgroundColor: colors.surface,
bottomNavigationBar: bottomNavigationBar,
body: SelectionArea(
child: child,
),
Expand Down
5 changes: 3 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ version: 0.0.1
publish_to: "none"

environment:
sdk: ">=3.0.1 <4.0.0"
sdk: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"

dependencies:
cached_network_image: ^3.3.1
flutter:
sdk: flutter
go_router: ^11.1.2
google_fonts: ^6.1.0
google_fonts: 6.1.0
path_drawing: ^1.0.1
shared_preferences: ^2.2.2
zeta_flutter:
Expand Down
Loading

0 comments on commit ef240ed

Please sign in to comment.