update order detail
This commit is contained in:
@@ -221,14 +221,14 @@ class AppTheme {
|
||||
|
||||
// ==================== Switch Theme ====================
|
||||
switchTheme: SwitchThemeData(
|
||||
thumbColor: MaterialStateProperty.resolveWith((states) {
|
||||
if (states.contains(MaterialState.selected)) {
|
||||
thumbColor: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return AppColors.primaryBlue;
|
||||
}
|
||||
return AppColors.grey500;
|
||||
}),
|
||||
trackColor: MaterialStateProperty.resolveWith((states) {
|
||||
if (states.contains(MaterialState.selected)) {
|
||||
trackColor: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return AppColors.lightBlue;
|
||||
}
|
||||
return AppColors.grey100;
|
||||
@@ -237,20 +237,20 @@ class AppTheme {
|
||||
|
||||
// ==================== Checkbox Theme ====================
|
||||
checkboxTheme: CheckboxThemeData(
|
||||
fillColor: MaterialStateProperty.resolveWith((states) {
|
||||
if (states.contains(MaterialState.selected)) {
|
||||
fillColor: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return AppColors.primaryBlue;
|
||||
}
|
||||
return AppColors.white;
|
||||
}),
|
||||
checkColor: MaterialStateProperty.all(AppColors.white),
|
||||
checkColor: WidgetStateProperty.all(AppColors.white),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)),
|
||||
),
|
||||
|
||||
// ==================== Radio Theme ====================
|
||||
radioTheme: RadioThemeData(
|
||||
fillColor: MaterialStateProperty.resolveWith((states) {
|
||||
if (states.contains(MaterialState.selected)) {
|
||||
fillColor: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return AppColors.primaryBlue;
|
||||
}
|
||||
return AppColors.grey500;
|
||||
|
||||
@@ -7,6 +7,8 @@ library;
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
// ============================================================================
|
||||
// String Extensions
|
||||
@@ -422,26 +424,26 @@ extension BuildContextExtensions on BuildContext {
|
||||
}
|
||||
|
||||
/// Navigate to route
|
||||
Future<T?> push<T>(Widget page) {
|
||||
return Navigator.of(this).push<T>(MaterialPageRoute(builder: (_) => page));
|
||||
}
|
||||
// Future<T?> push<T>(Widget page) {
|
||||
// return Navigator.of(this).push<T>(MaterialPageRoute(builder: (_) => page));
|
||||
// }
|
||||
|
||||
/// Navigate and replace current route
|
||||
Future<T?> pushReplacement<T>(Widget page) {
|
||||
return Navigator.of(
|
||||
this,
|
||||
).pushReplacement<T, void>(MaterialPageRoute(builder: (_) => page));
|
||||
}
|
||||
// Future<T?> pushReplacement<T>(Widget page) {
|
||||
// return Navigator.of(
|
||||
// this,
|
||||
// ).pushReplacement<T, void>(MaterialPageRoute(builder: (_) => page));
|
||||
// }
|
||||
|
||||
/// Pop current route
|
||||
void pop<T>([T? result]) {
|
||||
Navigator.of(this).pop(result);
|
||||
}
|
||||
// void pop<T>([T? result]) {
|
||||
// GoRouter.of(this).pop(result);
|
||||
// }
|
||||
|
||||
/// Pop until first route
|
||||
void popUntilFirst() {
|
||||
Navigator.of(this).popUntil((route) => route.isFirst);
|
||||
}
|
||||
// void popUntilFirst() {
|
||||
// Navigator.of(this).popUntil((route) => route.isFirst);
|
||||
// }
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -466,4 +468,26 @@ extension NumExtensions on num {
|
||||
final mod = math.pow(10.0, places);
|
||||
return ((this * mod).round().toDouble() / mod);
|
||||
}
|
||||
|
||||
/// Format as Vietnamese currency (đồng)
|
||||
/// Returns formatted string like "1.153.434đ"
|
||||
String get toVNCurrency {
|
||||
final formatter = NumberFormat.currency(
|
||||
locale: 'vi_VN',
|
||||
symbol: 'đ',
|
||||
decimalDigits: 0,
|
||||
);
|
||||
return formatter.format(this);
|
||||
}
|
||||
|
||||
/// Format as Vietnamese currency with custom symbol
|
||||
/// Returns formatted string with custom symbol
|
||||
String toCurrency({String symbol = 'đ', int decimalDigits = 0}) {
|
||||
final formatter = NumberFormat.currency(
|
||||
locale: 'vi_VN',
|
||||
symbol: symbol,
|
||||
decimalDigits: decimalDigits,
|
||||
);
|
||||
return formatter.format(this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user