Skip to content

Commit

Permalink
chore: Update to zeta_flutter 0.14.0
Browse files Browse the repository at this point in the history
chore: Update to zeta_flutter 0.14.0
  • Loading branch information
thelukewalton authored Jul 8, 2024
2 parents 9703cf9 + 785601b commit 94e651b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 58 deletions.
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ linter:
# producing the lint.
rules:
public_member_api_docs: false
flutter_style_todos: false
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
Expand Down
31 changes: 5 additions & 26 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,14 @@ class MyApp extends StatefulWidget {
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext _) {
return ZetaProvider(
initialThemeData: ZetaThemeData(
colorsDark: ZetaColors.dark(
// TODO(Theme): Add custom color pallete
),
colorsLight: ZetaColors.light(
// TODO(Theme): Add custom color pallete
),
),
builder: (context, themeData, themeMode) {
final dark = themeData.colorsDark.toScheme();
final light = themeData.colorsLight.toScheme();
return ZetaProvider.base(
//TODO: Add custom colors, fonts, etc.
builder: (context, lightTheme, darkTheme, themeMode) {
return MaterialApp.router(
routerConfig: goRouter,
themeMode: themeMode,
theme: ThemeData(
useMaterial3: true,
fontFamily: themeData.fontFamily,
scaffoldBackgroundColor: light.surfaceTertiary,
colorScheme: light,
textTheme: zetaTextTheme,
),
darkTheme: ThemeData(
useMaterial3: true,
fontFamily: themeData.fontFamily,
scaffoldBackgroundColor: dark.surfaceTertiary,
colorScheme: dark,
textTheme: zetaTextTheme,
),
theme: lightTheme,
darkTheme: darkTheme,
);
},
);
Expand Down
58 changes: 29 additions & 29 deletions lib/src/pages/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ class _ExamplePageState extends State<ExamplePage> {
child: Row(
children: const [
ZetaStatusLabel(label: 'Status label'),
ZetaPriorityPill(priority: 'Priority Pill'),
ZetaBadge(label: 'Badge'),
ZetaPriorityPill(label: 'Priority Pill'),
ZetaLabel(label: 'Label'),
ZetaIndicator.icon(),
ZetaIndicator.notification(),
ZetaTag.left(label: 'Tag'),
].gap(ZetaSpacing.m),
).paddingHorizontal(ZetaSpacing.m),
].gap(ZetaSpacing.xl_2),
).paddingHorizontal(ZetaSpacing.xl_2),
),
ZetaSystemBanner(context: context, title: 'Banner'),
ZetaBanner(context: context, title: 'Banner'),
ZetaBreadCrumbs(
children: [
ZetaBreadCrumb(label: 'BreadCrumb', onPressed: () {}),
Expand Down Expand Up @@ -93,8 +93,8 @@ class _ExamplePageState extends State<ExamplePage> {
rounded: true,
isLarge: true,
),
].gap(ZetaSpacing.m),
).paddingHorizontal(ZetaSpacing.m),
].gap(ZetaSpacing.xl_2),
).paddingHorizontal(ZetaSpacing.xl_2),
),
SingleChildScrollView(
scrollDirection: Axis.horizontal,
Expand All @@ -120,8 +120,8 @@ class _ExamplePageState extends State<ExamplePage> {
checked = b ?? false;
}),
),
].gap(ZetaSpacing.m),
).paddingHorizontal(ZetaSpacing.m),
].gap(ZetaSpacing.xl_2),
).paddingHorizontal(ZetaSpacing.xl_2),
),
Column(
children: [
Expand All @@ -135,8 +135,8 @@ class _ExamplePageState extends State<ExamplePage> {
leading: ZetaAvatar(initials: 'AZ', size: ZetaAvatarSize.xxxs),
),
const ZetaAssistChip(label: 'Assist Chip', leading: Icon(ZetaIcons.star_round)),
].gap(ZetaSpacing.m),
).paddingHorizontal(ZetaSpacing.m),
].gap(ZetaSpacing.xl_2),
).paddingHorizontal(ZetaSpacing.xl_2),
),
ZetaFilterSelection(
items: List.generate(10, (e) => e).map((e) => ZetaFilterChip(label: 'Filter Chip ${e + 1}')).toList(),
Expand All @@ -145,6 +145,7 @@ class _ExamplePageState extends State<ExamplePage> {
),
const ZetaDialPad(),
ZetaDropdown(
onChange: (value) {},
items: [
ZetaDropdownItem(value: 'Dropdown item', icon: const Icon(ZetaIcons.add_box_sharp)),
ZetaDropdownItem(value: 'Dropdown item 2', icon: const Icon(ZetaIcons.activity_round)),
Expand All @@ -164,8 +165,7 @@ class _ExamplePageState extends State<ExamplePage> {
Column(
children: [
ZetaListItem(
title: const Text('List Item'),
selected: checked,
primaryText: 'List Item',
onTap: () => setState(() {
checked = !checked;
}),
Expand All @@ -184,12 +184,12 @@ class _ExamplePageState extends State<ExamplePage> {
count: 19,
enabledNotificationIcon: true,
enabledWarningIcon: true,
onCallTap: () {},
onDeleteTap: () {},
onMenuMoreTap: () {},
onPttTap: () {},
onTap: () {},
time: DateTime.now(),
slidableActions: [
ZetaSlidableAction.call(onPressed: () {}),
ZetaSlidableAction.delete(onPressed: () {}),
],
),
],
),
Expand All @@ -203,21 +203,21 @@ class _ExamplePageState extends State<ExamplePage> {
const SizedBox(width: 250, child: ZetaPhoneInput(label: 'Phone Input')),
const SizedBox(width: 250, child: ZetaTimeInput(label: 'Phone Input')),
const SizedBox(width: 250, child: ZetaTextInput(label: 'Phone Input')),
const SizedBox(
SizedBox(
width: 250,
child: ZetaSelectInput(
label: Text('Select Input'),
label: 'Select Input',
items: [
ZetaSelectInputItem(value: 'Item 1'),
ZetaSelectInputItem(value: 'Item 2'),
ZetaSelectInputItem(value: 'Item 3'),
ZetaSelectInputItem(value: 'Item 4'),
ZetaSelectInputItem(value: 'Item 5'),
ZetaDropdownItem(value: 'Item 1'),
ZetaDropdownItem(value: 'Item 2'),
ZetaDropdownItem(value: 'Item 3'),
ZetaDropdownItem(value: 'Item 4'),
ZetaDropdownItem(value: 'Item 5'),
],
),
),
].gap(ZetaSpacing.m),
).paddingHorizontal(ZetaSpacing.m),
].gap(ZetaSpacing.xl_2),
).paddingHorizontal(ZetaSpacing.xl_2),
),
SingleChildScrollView(
scrollDirection: Axis.horizontal,
Expand All @@ -230,8 +230,8 @@ class _ExamplePageState extends State<ExamplePage> {
const SizedBox(width: 250, child: ZetaProgressBar(progress: 1, type: ZetaProgressBarType.buffering)),
const SizedBox(width: 250, child: ZetaProgressBar(progress: 1, type: ZetaProgressBarType.standard)),
const ZetaProgressCircle(progress: 1, size: ZetaCircleSizes.s),
].gap(ZetaSpacing.m),
).paddingHorizontal(ZetaSpacing.m),
].gap(ZetaSpacing.xl_2),
).paddingHorizontal(ZetaSpacing.xl_2),
),
ZetaScreenHeaderBar(
actionButtonLabel: 'Action',
Expand Down Expand Up @@ -275,7 +275,7 @@ class _ExamplePageState extends State<ExamplePage> {
),
const ZetaTooltip(child: Text('Tooltip')),
const SizedBox(height: 100),
].gap(ZetaSpacing.xxl),
].gap(ZetaSpacing.xl_10),
),
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const Padding(
padding: EdgeInsets.all(ZetaSpacing.m),
padding: EdgeInsets.all(ZetaSpacing.xl_2),
child: Column(
children: [
ZetaInPageBanner(
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ environment:
dependencies:
flutter:
sdk: flutter
go_router: ^14.1.3
zeta_flutter: ^0.10.0
go_router: ^14.2.0
zeta_flutter: ^0.14.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 94e651b

Please sign in to comment.