-
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.
chore: Rename ZetaBanner to ZetaSystemBanner to match Figma (#235)
fix: remove capitals from issue_tracker url due to issue on pub.dev fix: Move Zebra head logo into library fix: Make ZetaAvatar._pixelSize extension private fix: Badge, button colors updated fix: Tag, chat item, list item now shrink rather than expands by default fix: Date and time inputs pass zeta context into their children feat: Make ZetaDialog public fix: Changed progress bar, notification list item shapes so they are not affected by contrast test: Update in page banner tests as banner no longer fully expands
- Loading branch information
1 parent
dd28e28
commit 74fee17
Showing
43 changed files
with
640 additions
and
541 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
# include: package:zds_analysis/analysis_options_lib_all_files.yaml | ||
include: package:zds_analysis/analysis_options_lib.yaml |
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
194 changes: 194 additions & 0 deletions
194
example/lib/pages/components/system_banner_example.dart
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,194 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:zeta_example/widgets.dart'; | ||
import 'package:zeta_flutter/zeta_flutter.dart'; | ||
|
||
class BannerExample extends StatelessWidget { | ||
static const String name = 'Banner'; | ||
|
||
const BannerExample({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ExampleScaffold( | ||
name: BannerExample.name, | ||
child: SingleChildScrollView( | ||
child: Padding( | ||
padding: EdgeInsets.all(20), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Text('System Banner', style: ZetaTextStyles.displayMedium), | ||
_getTitle('Style variants'), | ||
ZetaSystemBanner( | ||
type: ZetaSystemBannerStatus.primary, | ||
title: 'Centered', | ||
context: context, | ||
titleCenter: true, | ||
leadingIcon: ZetaIcons.info, | ||
), | ||
ZetaSystemBanner( | ||
type: ZetaSystemBannerStatus.primary, | ||
context: context, | ||
title: 'Title Left', | ||
), | ||
ZetaSystemBanner( | ||
type: ZetaSystemBannerStatus.primary, | ||
context: context, | ||
title: 'Title left with arrow', | ||
titleCenter: true, | ||
trailing: ZetaIcon(ZetaIcons.chevron_right), | ||
), | ||
ZetaSystemBanner( | ||
type: ZetaSystemBannerStatus.primary, | ||
title: 'Title left + Icon', | ||
titleCenter: true, | ||
context: context, | ||
leadingIcon: ZetaIcons.info, | ||
), | ||
ZetaSystemBanner( | ||
type: ZetaSystemBannerStatus.primary, | ||
context: context, | ||
title: 'Title left + Icon with Arrow', | ||
titleCenter: true, | ||
leadingIcon: ZetaIcons.info, | ||
trailing: IconButton( | ||
icon: ZetaIcon(ZetaIcons.chevron_right), | ||
onPressed: () { | ||
ScaffoldMessenger.of(context).showMaterialBanner(ZetaSystemBanner( | ||
title: 'Title', | ||
context: context, | ||
type: ZetaSystemBannerStatus.primary, | ||
trailing: IconButton( | ||
icon: ZetaIcon(ZetaIcons.close), | ||
onPressed: () => ScaffoldMessenger.of(context).clearMaterialBanners(), | ||
), | ||
)); | ||
}, | ||
), | ||
), | ||
_getTitle('Color variants'), | ||
ZetaSystemBanner( | ||
type: ZetaSystemBannerStatus.positive, | ||
context: context, | ||
title: 'Centered', | ||
titleCenter: true, | ||
leadingIcon: ZetaIcons.info, | ||
trailing: IconButton( | ||
icon: ZetaIcon(ZetaIcons.chevron_right), | ||
onPressed: () { | ||
ScaffoldMessenger.of(context).showMaterialBanner(ZetaSystemBanner( | ||
title: 'Title', | ||
context: context, | ||
type: ZetaSystemBannerStatus.positive, | ||
trailing: IconButton( | ||
icon: ZetaIcon(ZetaIcons.close), | ||
onPressed: () => ScaffoldMessenger.of(context).clearMaterialBanners(), | ||
), | ||
)); | ||
}, | ||
), | ||
), | ||
ZetaSystemBanner( | ||
type: ZetaSystemBannerStatus.warning, | ||
title: 'Centered', | ||
context: context, | ||
titleCenter: true, | ||
leadingIcon: ZetaIcons.info, | ||
trailing: IconButton( | ||
icon: ZetaIcon(ZetaIcons.chevron_right), | ||
onPressed: () { | ||
ScaffoldMessenger.of(context).showMaterialBanner(ZetaSystemBanner( | ||
title: 'Title', | ||
context: context, | ||
type: ZetaSystemBannerStatus.warning, | ||
trailing: IconButton( | ||
icon: ZetaIcon(ZetaIcons.close), | ||
onPressed: () => ScaffoldMessenger.of(context).clearMaterialBanners(), | ||
), | ||
)); | ||
}, | ||
), | ||
), | ||
ZetaSystemBanner( | ||
type: ZetaSystemBannerStatus.negative, | ||
title: 'Centered', | ||
context: context, | ||
titleCenter: true, | ||
leadingIcon: ZetaIcons.info, | ||
trailing: IconButton( | ||
icon: ZetaIcon(ZetaIcons.chevron_right), | ||
onPressed: () { | ||
ScaffoldMessenger.of(context).showMaterialBanner(ZetaSystemBanner( | ||
title: 'Title', | ||
context: context, | ||
type: ZetaSystemBannerStatus.negative, | ||
trailing: IconButton( | ||
icon: ZetaIcon(ZetaIcons.close), | ||
onPressed: () => ScaffoldMessenger.of(context).clearMaterialBanners(), | ||
), | ||
)); | ||
}, | ||
), | ||
), | ||
const Divider(), | ||
Text('In-Page Banner', style: ZetaTextStyles.displayMedium), | ||
ZetaInPageBanner( | ||
content: Text(_content), | ||
status: ZetaWidgetStatus.info, | ||
), | ||
ZetaInPageBanner( | ||
content: Text(_content), | ||
onClose: () {}, | ||
status: ZetaWidgetStatus.positive, | ||
title: 'Banner Title', | ||
), | ||
ZetaInPageBanner( | ||
content: Text(_content), | ||
onClose: () {}, | ||
status: ZetaWidgetStatus.warning, | ||
title: 'Banner Title', | ||
actions: [ZetaButton(label: 'Button', onPressed: () {})], | ||
), | ||
ZetaInPageBanner( | ||
content: Text(_content), | ||
onClose: () {}, | ||
status: ZetaWidgetStatus.negative, | ||
title: 'Banner Title Banner Title Banner Title Banner Title', | ||
), | ||
ZetaInPageBanner( | ||
content: Text(_content), | ||
onClose: () {}, | ||
status: ZetaWidgetStatus.neutral, | ||
title: 'Banner Title', | ||
) | ||
].divide(const SizedBox(height: 10)).toList(), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
|
||
final _content = 'Lorem ipsum dolor sit amet, conse ctetur cididunt ut' | ||
'labore et do lore magna aliqua.'; | ||
|
||
Widget _getTitle(String title) => Container(height: 50, child: Center(child: Text(title))); | ||
|
||
Column buildExampleBannerColumn( | ||
ZetaWidgetStatus status, { | ||
IconData? customIcon, | ||
}) { | ||
return Column( | ||
mainAxisAlignment: MainAxisAlignment.spaceAround, | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
ZetaInPageBanner( | ||
content: Text(_content), | ||
onClose: () {}, | ||
status: status, | ||
title: 'Banner Title', | ||
customIcon: customIcon, | ||
), | ||
], | ||
); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -40,4 +40,4 @@ SPEC CHECKSUMS: | |
|
||
PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7 | ||
|
||
COCOAPODS: 1.15.2 | ||
COCOAPODS: 1.16.2 |
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
File renamed without changes
Oops, something went wrong.