Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix progress theme and use latest version of the Zeta #38

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions example/lib/pages/components/default_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ class DefaultFlutter extends StatelessWidget {
),
Card(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
LinearProgressIndicator(),
CircularProgressIndicator(),
Slider(
value: 50,
onChanged: (value) {},
Expand All @@ -62,7 +65,7 @@ class DefaultFlutter extends StatelessWidget {
min: 0,
max: 100,
),
],
].divide(const SizedBox(height: 8)).toList(growable: false),
),
),
Card(
Expand Down Expand Up @@ -144,7 +147,7 @@ class DefaultFlutter extends StatelessWidget {
TextButton(onPressed: () {}, child: Text("Cancel")),
const Spacer(),
OutlinedButton(onPressed: () {}, child: Text("Reset")),
SizedBox(width: ZetaSpacing.small),
SizedBox(width: Zeta.of(context).spacing.small),
ElevatedButton(onPressed: () {}, child: Text("Next")),
],
),
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:
table_calendar: ^3.0.9
zds_flutter:
path: ../
zeta_flutter: ^0.15.2
zeta_flutter: ^0.18.0

flutter:
uses-material-design: true
Expand Down
29 changes: 12 additions & 17 deletions lib/src/components/atoms/circle_icon_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ class _CircleIconButton extends State<CircleIconButton> {

@override
Widget build(BuildContext context) {
final colors = Zeta.of(context).colors;
final zeta = Zeta.of(context);
final colors = zeta.colors;
final bool toggled = type == CircleButtonType.toggled;

return Column(
Expand All @@ -180,9 +181,9 @@ class _CircleIconButton extends State<CircleIconButton> {
decoration: _animatedStyle(colors, isPressed),
child: Icon(
toggled ? widget.activeIcon : widget.icon,
size: _iconSize,
size: _iconSize(zeta),
color: type.foregroundColor(colors),
).padding(_iconPadding),
).padding(_iconPadding(zeta)),
),
),
Text(
Expand All @@ -192,35 +193,29 @@ class _CircleIconButton extends State<CircleIconButton> {
fontSize: widget.size == ButtonSize.small ? 14 : 16,
),
),
]
.divide(
const SizedBox(
height: ZetaSpacing.minimum,
),
)
.toList(),
].divide(SizedBox(height: zeta.spacing.minimum)).toList(),
);
}

double get _iconPadding {
double _iconPadding(Zeta zeta) {
switch (widget.size) {
case ButtonSize.large:
return ZetaSpacing.xl_1;
return zeta.spacing.xl;
case ButtonSize.medium:
return 15;
case ButtonSize.small:
return ZetaSpacing.minimum;
return zeta.spacing.minimum;
}
}

double get _iconSize {
double _iconSize(Zeta zeta) {
switch (widget.size) {
case ButtonSize.large:
return ZetaSpacing.xl_6;
return zeta.spacing.xl_6;
case ButtonSize.medium:
return ZetaSpacingBase.x7_5;
return zeta.spacing.xl_3;
case ButtonSize.small:
return ZetaSpacing.xl_1;
return zeta.spacing.xl;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ extension ProgressIndicatorExtension on ZetaColorScheme {
return ProgressIndicatorThemeData(
/// Setting up the color.
color: secondary,
linearTrackColor: Colors.transparent,
circularTrackColor: Colors.transparent,
);
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ dependencies:
video_compress: ^3.1.3
video_player: ^2.8.6
vsc_quill_delta_to_html: ^1.0.5
zeta_flutter: ^0.15.2
zeta_flutter: ^0.18.0

dev_dependencies:
flutter_test:
Expand Down