-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(UX-1121): Added ZetaProvider.base to allow for better developer …
…experience (#123) refactor: Added Nothing conveinience method refactor: Move rounded property to Zeta, not ZetaThemeData chore: Add rounded switch to example app refactor: Implement global rounded in example app test: Update golden tests for rounded state change
- Loading branch information
1 parent
3b2ddef
commit 3cc79b0
Showing
131 changed files
with
1,560 additions
and
1,492 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
## Set up | ||
|
||
To use Zeta components in you app, first the whole app must be wrapped with `ZetaProvider`. The easiest way to do this is with the custom builder `ZetaProvider.custom`. | ||
You can provide initial values for `ThemeData`, `ThemeMode`, `contrast` and `ZetaThemeData`. | ||
|
||
* `initialThemeData` (optional) allows you to extend an existing Flutter themeData to use alongside the `Zeta` theme. | ||
* `initialThemeMode` (optional) sets whether the app starts in light or dark mode, or uses the device default. | ||
* `initialContrast` (optional) sets whether the app starts with standard (WCAG AA) contrast, or if it attempts to use the more accessible contrast (WCAG AAA). | ||
* `initialZetaThemeData` (optional) allows you to override the Zeta theme with a custom theme. | ||
* `initialLightThemeData` and `initialDarkThemeData` (optional) allows you to use existing ThemeData objects withing zeta | ||
* `builder` (required) is used to construct the app with all Zeta themes injected. | ||
|
||
|
||
```dart | ||
return ZetaProvider.base( | ||
initialThemeData: initialThemeData, | ||
initialThemeMode: initialThemeMode, | ||
initialContrast: initialContrast, | ||
initialZetaThemeData: initialZetaThemeData, | ||
initialRounded: initialRounded, | ||
builder: (context, lightTheme, darkTheme, themeMode) { | ||
return MaterialApp.router( | ||
routerConfig: router, | ||
themeMode: themeMode, | ||
theme: lightTheme, | ||
darkTheme: darkTheme, | ||
); | ||
}, | ||
); | ||
``` | ||
|
||
## Using the components | ||
|
||
Once Zeta is configured, Zeta components can be used as any other componenent, and will inherit theme and other information from `Zeta`. | ||
|
||
```dart | ||
Column( | ||
children:[ | ||
ZetaButton(label: 'Button', onPressed: (){}), | ||
ZetaAvatar(), | ||
ZetaStatusLabel(), | ||
// etc... | ||
] | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.