-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): animate the status color transition & add a new text when t…
…he bridge is about to close
- Loading branch information
1 parent
0eeed73
commit c57d08e
Showing
8 changed files
with
124 additions
and
60 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
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
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
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,47 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class CustomProgressBarIndicator extends StatelessWidget { | ||
final double max; | ||
final double current; | ||
final Color color; | ||
|
||
const CustomProgressBarIndicator( | ||
{Key? key, required this.max, required this.current, required this.color}) | ||
: super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return LayoutBuilder( | ||
builder: (_, boxConstraints) { | ||
var x = boxConstraints.maxWidth; | ||
var percent = (current / max) * x; | ||
return Stack( | ||
alignment: Alignment.centerLeft, | ||
children: [ | ||
AnimatedContainer( | ||
duration: const Duration(milliseconds: 500), | ||
width: x, | ||
height: 15, | ||
decoration: BoxDecoration( | ||
border: Border.all( | ||
color: Theme.of(context).colorScheme.inverseSurface, | ||
width: 2, | ||
), | ||
borderRadius: BorderRadius.circular(35), | ||
), | ||
), | ||
AnimatedContainer( | ||
duration: const Duration(milliseconds: 500), | ||
width: percent, | ||
height: 10, | ||
decoration: BoxDecoration( | ||
color: color, | ||
borderRadius: BorderRadius.circular(35), | ||
), | ||
), | ||
], | ||
); | ||
}, | ||
); | ||
} | ||
} |