split bill

This commit is contained in:
efrilm
2025-10-31 19:24:15 +07:00
parent 7961c9d8c5
commit 6b42cd86ff
14 changed files with 2622 additions and 100 deletions
+1
View File
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import '../../domain/table/table.dart';
import '../types/split_type.dart';
import '../types/void_type.dart';
part 'build_context_extension.dart';
+13 -2
View File
@@ -39,12 +39,23 @@ extension StringX on String {
VoidType toVoidType() {
switch (this) {
case 'all':
case 'ALL':
return VoidType.all;
case 'item':
case 'ITEM':
return VoidType.item;
default:
return VoidType.unknown;
}
}
SplitType toSplitType() {
switch (this) {
case 'AMOUNT':
return SplitType.amount;
case 'ITEM':
return SplitType.item;
default:
return SplitType.unknown;
}
}
}
+12
View File
@@ -0,0 +1,12 @@
enum SplitType { amount, item, unknown }
extension SplitTypeX on SplitType {
String toStringType() => switch (this) {
SplitType.amount => 'AMOUNT',
SplitType.item => 'ITEM',
SplitType.unknown => 'unknown',
};
bool get isAmount => this == SplitType.amount;
bool get isItem => this == SplitType.item;
}