28 lines
677 B
Dart
28 lines
677 B
Dart
import 'package:flutter/material.dart';
|
|
import '../../core/utils/formatters.dart';
|
|
|
|
/// Widget to display formatted price
|
|
class PriceDisplay extends StatelessWidget {
|
|
final double price;
|
|
final TextStyle? style;
|
|
final String currency;
|
|
|
|
const PriceDisplay({
|
|
super.key,
|
|
required this.price,
|
|
this.style,
|
|
this.currency = 'USD',
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Text(
|
|
Formatters.formatPrice(price, currency: currency),
|
|
style: style ?? Theme.of(context).textTheme.titleMedium?.copyWith(
|
|
fontWeight: FontWeight.bold,
|
|
color: Theme.of(context).colorScheme.primary,
|
|
),
|
|
);
|
|
}
|
|
}
|