aves/lib/widgets/stats/percent_text.dart
Thibault Deckers ebc147771c minor fixes
2023-01-11 19:26:48 +01:00

30 lines
812 B
Dart

import 'package:aves/utils/constants.dart';
import 'package:aves/widgets/common/basic/text/outlined.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class LinearPercentIndicatorText extends StatelessWidget {
final double percent;
final percentFormat = NumberFormat.percentPattern();
LinearPercentIndicatorText({
super.key,
required this.percent,
});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return OutlinedText(
textSpans: [
TextSpan(
text: percentFormat.format(percent),
style: TextStyle(
shadows: theme.brightness == Brightness.dark ? Constants.embossShadows : null,
),
)
],
outlineColor: theme.scaffoldBackgroundColor,
);
}
}