order type

This commit is contained in:
efrilm
2025-10-26 23:10:23 +07:00
parent 0bffd92a08
commit 8fec9c8cd0
7 changed files with 436 additions and 76 deletions
@@ -1,6 +1,16 @@
part of 'extension.dart';
extension StringX on String {
String toTitleCase() {
if (isEmpty) return '';
return split(' ')
.map((word) {
if (word.isEmpty) return '';
return word[0].toUpperCase() + word.substring(1).toLowerCase();
})
.join(' ');
}
TableStatusType toTableStatusType() {
switch (this) {
case 'available':
+15
View File
@@ -1,3 +1,5 @@
import 'package:flutter/material.dart';
enum OrderType {
dineIn('DINE IN'),
takeAway('TAKE AWAY'),
@@ -13,4 +15,17 @@ enum OrderType {
orElse: () => OrderType.dineIn,
);
}
IconData get icon {
switch (this) {
case OrderType.dineIn:
return Icons.dinner_dining_outlined;
case OrderType.takeAway:
return Icons.takeout_dining_outlined;
case OrderType.delivery:
return Icons.delivery_dining_outlined;
case OrderType.freeTable:
return Icons.table_bar_outlined;
}
}
}