diff --git a/example/lib/home.dart b/example/lib/home.dart index 19b41578..b8fdba3b 100644 --- a/example/lib/home.dart +++ b/example/lib/home.dart @@ -32,8 +32,7 @@ final List components = [ Component(ButtonExample.name, (context) => const ButtonExample()), Component(CheckBoxExample.name, (context) => const CheckBoxExample()), Component(ChipExample.name, (context) => const ChipExample()), - Component( - PasswordInputExample.name, (context) => const PasswordInputExample()), + Component(PasswordInputExample.name, (context) => const PasswordInputExample()), Component(ProgressExample.name, (context) => const ProgressExample()) ]; @@ -96,27 +95,21 @@ class _HomeState extends State { title: Text('Widgets'), backgroundColor: Zeta.of(context).colors.warm.shade30, children: _components - .map((item) => ListTile( - title: Text(item.name), - onTap: () => context.go('/${item.name}'))) + .map((item) => ListTile(title: Text(item.name), onTap: () => context.go('/${item.name}'))) .toList(), ), ExpansionTile( title: Text('Theme'), backgroundColor: Zeta.of(context).colors.warm.shade30, children: _theme - .map((item) => ListTile( - title: Text(item.name), - onTap: () => context.go('/${item.name}'))) + .map((item) => ListTile(title: Text(item.name), onTap: () => context.go('/${item.name}'))) .toList(), ), ExpansionTile( title: Text('Assets'), backgroundColor: Zeta.of(context).colors.warm.shade30, children: _assets - .map((item) => ListTile( - title: Text(item.name), - onTap: () => context.go('/${item.name}'))) + .map((item) => ListTile(title: Text(item.name), onTap: () => context.go('/${item.name}'))) .toList(), ), ], diff --git a/example/lib/pages/components/progress_example.dart b/example/lib/pages/components/progress_example.dart index 84167758..2158b5ee 100644 --- a/example/lib/pages/components/progress_example.dart +++ b/example/lib/pages/components/progress_example.dart @@ -28,11 +28,7 @@ class ProgressExampleState extends State { SizedBox( height: 20, ), - Wrapper( - stepsCompleted: 0, - type: ZetaBarType.standard, - isThin: false, - stateChangeable: true), + Wrapper(stepsCompleted: 0, type: ZetaBarType.standard, isThin: false, stateChangeable: true), SizedBox( height: 20, ), @@ -94,9 +90,7 @@ class _WrapperState extends State { void setLoading() { setState(() { - type = type == ZetaBarType.buffering - ? ZetaBarType.standard - : ZetaBarType.buffering; + type = type == ZetaBarType.buffering ? ZetaBarType.standard : ZetaBarType.buffering; }); } @@ -108,25 +102,17 @@ class _WrapperState extends State { SizedBox( width: 400, child: ZetaProgressBar( - progress: progress, - rounded: widget.rounded, - type: type, - isThin: widget.isThin, - label: widget.label), + progress: progress, rounded: widget.rounded, type: type, isThin: widget.isThin, label: widget.label), ), const SizedBox(width: 40), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ widget.type != ZetaBarType.indeterminate - ? FilledButton( - onPressed: increasePercentage, child: Text("Increase")) + ? FilledButton(onPressed: increasePercentage, child: Text("Increase")) : Container(), const SizedBox(width: 40), - widget.stateChangeable - ? FilledButton( - onPressed: setLoading, child: Text("Start Buffering")) - : Container() + widget.stateChangeable ? FilledButton(onPressed: setLoading, child: Text("Start Buffering")) : Container() ], ) ], diff --git a/lib/src/components/progress/progress.dart b/lib/src/components/progress/progress.dart index 8730a303..148ee1e0 100644 --- a/lib/src/components/progress/progress.dart +++ b/lib/src/components/progress/progress.dart @@ -19,8 +19,7 @@ abstract class ZetaProgress extends StatefulWidget { /// Super class for [ZetaProgressState] /// Defines functions that deal with state change of progress value and /// animation changing. -abstract class ZetaProgressState extends State - with TickerProviderStateMixin { +abstract class ZetaProgressState extends State with TickerProviderStateMixin { /// Decimal progress value late double progress; @@ -34,8 +33,7 @@ abstract class ZetaProgressState extends State void initState() { super.initState(); progress = widget.progress; - controller = AnimationController( - vsync: this, duration: const Duration(milliseconds: 200)); + controller = AnimationController(vsync: this, duration: const Duration(milliseconds: 200)); animation = Tween( begin: widget.progress, // Start value end: widget.progress, // End value (initially same as start value) diff --git a/lib/src/components/progress/progress_bar.dart b/lib/src/components/progress/progress_bar.dart index f7793fc8..218e0ab8 100644 --- a/lib/src/components/progress/progress_bar.dart +++ b/lib/src/components/progress/progress_bar.dart @@ -26,33 +26,21 @@ class ZetaProgressBar extends ZetaProgress { required this.rounded, required this.type, required this.isThin, - this.label}); + this.label,}); /// Constructs a standard progress bar const ZetaProgressBar.standard( - {super.key, - required super.progress, - this.rounded = true, - this.isThin = false, - this.label}) + {super.key, required super.progress, this.rounded = true, this.isThin = false, this.label,}) : type = ZetaBarType.standard; /// Constructs buffering example const ZetaProgressBar.buffering( - {super.key, - required super.progress, - this.rounded = true, - this.isThin = false, - this.label}) + {super.key, required super.progress, this.rounded = true, this.isThin = false, this.label,}) : type = ZetaBarType.buffering; /// Constructs indeterminate example const ZetaProgressBar.indeterminate( - {super.key, - required super.progress, - this.rounded = true, - this.isThin = false, - this.label}) + {super.key, required super.progress, this.rounded = true, this.isThin = false, this.label,}) : type = ZetaBarType.indeterminate; /// Is progress bar rounded or sharp. @@ -98,24 +86,20 @@ class _ZetaProgressBarState extends ZetaProgressState { height: _weight, child: LinearProgressIndicator( borderRadius: _border, - value: widget.type == ZetaBarType.indeterminate - ? null - : animation.value, - backgroundColor: widget.type == ZetaBarType.buffering - ? Zeta.of(context).colors.surfaceDisabled - : Colors.transparent, + value: widget.type == ZetaBarType.indeterminate ? null : animation.value, + backgroundColor: + widget.type == ZetaBarType.buffering ? Zeta.of(context).colors.surfaceDisabled : Colors.transparent, ), ), ), _extraWidgets(), - ]) + ],), ], ); } /// Returns border based on widgets border type. - BorderRadius get _border => - widget.rounded ? ZetaRadius.rounded : ZetaRadius.none; + BorderRadius get _border => widget.rounded ? ZetaRadius.rounded : ZetaRadius.none; /// Returns thickness of progress bar based on its weight. double get _weight => widget.isThin ? 8 : 16; @@ -128,16 +112,12 @@ class _ZetaProgressBarState extends ZetaProgressState { Container( width: _weight, height: _weight, - decoration: const BoxDecoration( - color: Color.fromRGBO(224, 227, 233, 1), - borderRadius: ZetaRadius.rounded), + decoration: const BoxDecoration(color: Color.fromRGBO(224, 227, 233, 1), borderRadius: ZetaRadius.rounded), ), - ]); + ],); final Widget extraWidgets = Row( - children: widget.type == ZetaBarType.buffering - ? extraList.expand((list) => list).toList() - : [], + children: widget.type == ZetaBarType.buffering ? extraList.expand((list) => list).toList() : [], ); return extraWidgets; }