55 lines
1.5 KiB
Dart
55 lines
1.5 KiB
Dart
|
import 'package:flutter/material.dart';
|
|||
|
|
|||
|
class StreakWidget extends StatelessWidget {
|
|||
|
final int dayCount;
|
|||
|
|
|||
|
StreakWidget({Key? key, required this.dayCount}) : super(key: key);
|
|||
|
|
|||
|
@override
|
|||
|
Widget build(BuildContext context) {
|
|||
|
return Column(
|
|||
|
mainAxisSize: MainAxisSize.min,
|
|||
|
children: [
|
|||
|
Text(
|
|||
|
"Congratulations! You’re currently ",
|
|||
|
style: TextStyle(fontSize: 24),
|
|||
|
textAlign: TextAlign.center,
|
|||
|
),
|
|||
|
Flexible(
|
|||
|
child: Row(
|
|||
|
mainAxisSize: MainAxisSize.min,
|
|||
|
children: [
|
|||
|
Text(
|
|||
|
"on a ",
|
|||
|
style: TextStyle(fontSize: 24),
|
|||
|
textAlign: TextAlign.center,
|
|||
|
),
|
|||
|
Container(
|
|||
|
margin: EdgeInsets.symmetric(vertical: 4),
|
|||
|
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
|||
|
decoration: BoxDecoration(
|
|||
|
color: Colors.lightGreen,
|
|||
|
borderRadius: BorderRadius.circular(20),
|
|||
|
),
|
|||
|
child: Text(
|
|||
|
"$dayCount days",
|
|||
|
style: TextStyle(
|
|||
|
color: Colors.white,
|
|||
|
fontSize: 26,
|
|||
|
fontWeight: FontWeight.bold,
|
|||
|
),
|
|||
|
),
|
|||
|
),
|
|||
|
Text(
|
|||
|
" streak!",
|
|||
|
style: TextStyle(fontSize: 24),
|
|||
|
textAlign: TextAlign.center,
|
|||
|
),
|
|||
|
],
|
|||
|
),
|
|||
|
),
|
|||
|
],
|
|||
|
);
|
|||
|
}
|
|||
|
}
|