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

(Urgent) BugFix: Fixed accentColor and backgroundColor deprecation and added null safety to example. Works on Flutter 3.10 #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion example/lib/liquid_circular_progress_indicator_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class _AnimatedLiquidCircularProgressIndicator extends StatefulWidget {
class _AnimatedLiquidCircularProgressIndicatorState
extends State<_AnimatedLiquidCircularProgressIndicator>
with SingleTickerProviderStateMixin {
AnimationController _animationController;
late AnimationController _animationController;

@override
void initState() {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/liquid_custom_progress_indicator_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class _AnimatedLiquidCustomProgressIndicator extends StatefulWidget {
class _AnimatedLiquidCustomProgressIndicatorState
extends State<_AnimatedLiquidCustomProgressIndicator>
with SingleTickerProviderStateMixin {
AnimationController _animationController;
late AnimationController _animationController;

@override
void initState() {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/liquid_linear_progress_indicator_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class _AnimatedLiquidLinearProgressIndicator extends StatefulWidget {
class _AnimatedLiquidLinearProgressIndicatorState
extends State<_AnimatedLiquidLinearProgressIndicator>
with SingleTickerProviderStateMixin {
AnimationController _animationController;
late AnimationController _animationController;

@override
void initState() {
Expand Down
21 changes: 15 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,36 @@ class Example extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
FlatButton(
TextButton(
child: Text("Circular"),
color: Colors.grey[300],
style: ButtonStyle(
backgroundColor:
MaterialStateProperty.all<Color>(Colors.grey.shade300),
),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => LiquidCircularProgressIndicatorPage(),
),
),
),
FlatButton(
TextButton(
child: Text("Linear"),
color: Colors.grey[300],
style: ButtonStyle(
backgroundColor:
MaterialStateProperty.all<Color>(Colors.grey.shade300),
),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => LiquidLinearProgressIndicatorPage(),
),
),
),
FlatButton(
TextButton(
child: Text("Custom"),
color: Colors.grey[300],
style: ButtonStyle(
backgroundColor:
MaterialStateProperty.all<Color>(Colors.grey.shade300),
),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => LiquidCustomProgressIndicatorPage(),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/liquid_circular_progress_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ class LiquidCircularProgressIndicator extends ProgressIndicator {
}

Color _getBackgroundColor(BuildContext context) =>
backgroundColor ?? Theme.of(context).backgroundColor;
backgroundColor ?? Theme.of(context).colorScheme.background;

Color _getValueColor(BuildContext context) =>
valueColor?.value ?? Theme.of(context).accentColor;
valueColor?.value ?? Theme.of(context).colorScheme.secondary;

@override
State<StatefulWidget> createState() =>
Expand Down
4 changes: 2 additions & 2 deletions lib/src/liquid_custom_progress_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ class LiquidCustomProgressIndicator extends ProgressIndicator {
);

Color _getBackgroundColor(BuildContext context) =>
backgroundColor ?? Theme.of(context).backgroundColor;
backgroundColor ?? Theme.of(context).colorScheme.background;

Color _getValueColor(BuildContext context) =>
valueColor?.value ?? Theme.of(context).accentColor;
valueColor?.value ?? Theme.of(context).colorScheme.secondary;

@override
State<StatefulWidget> createState() => _LiquidCustomProgressIndicatorState();
Expand Down
4 changes: 2 additions & 2 deletions lib/src/liquid_linear_progress_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ class LiquidLinearProgressIndicator extends ProgressIndicator {
}

Color _getBackgroundColor(BuildContext context) =>
backgroundColor ?? Theme.of(context).backgroundColor;
backgroundColor ?? Theme.of(context).colorScheme.background;

Color _getValueColor(BuildContext context) =>
valueColor?.value ?? Theme.of(context).accentColor;
valueColor?.value ?? Theme.of(context).colorScheme.secondary;

@override
State<StatefulWidget> createState() => _LiquidLinearProgressIndicatorState();
Expand Down