-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
86 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import 'package:figma_squircle/figma_squircle.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class AverageBar extends StatelessWidget { | ||
const AverageBar( | ||
{required this.average, | ||
required this.completedCredits, | ||
required this.totalCredits, | ||
required this.statusText, | ||
required this.averageText, | ||
super.key}); | ||
|
||
final double average; | ||
final int completedCredits; | ||
final int totalCredits; | ||
final String statusText; | ||
final String averageText; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return LayoutBuilder(builder: (context, constraints) { | ||
return Row(children: [ | ||
ClipSmoothRect( | ||
radius: SmoothBorderRadius( | ||
cornerRadius: 10, | ||
cornerSmoothing: 1, | ||
), | ||
child: Container( | ||
decoration: BoxDecoration( | ||
color: Theme.of(context).colorScheme.secondary, | ||
borderRadius: BorderRadius.all(Radius.circular(5))), | ||
width: constraints.maxWidth * 0.25, | ||
height: 50, | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Text(averageText), | ||
Text(average.toString(), | ||
style: TextStyle( | ||
fontWeight: FontWeight.bold, fontSize: 18)) | ||
]))), | ||
SizedBox(width: constraints.maxWidth * 0.05), | ||
Container( | ||
width: constraints.maxWidth * 0.70, | ||
height: 50, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Tooltip( | ||
message: "European Credit System", | ||
child: Text("ECTS"), | ||
), | ||
Text('$completedCredits/$totalCredits'), | ||
]), | ||
LinearProgressIndicator( | ||
minHeight: 8, | ||
value: completedCredits / totalCredits, | ||
borderRadius: BorderRadius.all(Radius.circular(5))), | ||
Text(statusText) | ||
])) | ||
]); | ||
}); | ||
} | ||
} |
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