order type
This commit is contained in:
@@ -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':
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user