runable
This commit is contained in:
27
lib/shared/widgets/price_display.dart
Normal file
27
lib/shared/widgets/price_display.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user