SplitSession class
Represents the local state of an active split payment session.
Tracks the order total, cumulative payments, outstanding balance, tip amounts, and the list of individual payment legs.
Constructors
-
SplitSession({required String splitId, required Decimal orderTotal, Decimal? explicitTipAmount, List<
PaymentLeg> paymentLegs = const []}) - SplitSession.create({required Decimal orderTotal, String? splitId, Decimal? explicitTipAmount})
-
Creates a new split session for the given order total.
factory
Properties
- amountOutstanding → Decimal
-
Remaining balance: orderTotal - amountPaid.
Can be negative when surplus payments (tips) are accepted.
no setter
- amountPaid → Decimal
-
Sum of all successful purchase leg amounts (excludes refund legs).
no setter
- explicitTipAmount → Decimal
-
The explicit (order-level) tip amount set before the split flow began.
Defaults to
Decimal.zerowhen no order-level tip was applied.final - hashCode → int
-
The hash code for this object.
no setterinherited
- hasSuccessfulPayments → bool
-
Whether any successful payments have been made.
no setter
- orderTotal → Decimal
-
The total order amount to be paid (includes explicit tip if any).
final
-
paymentLegs
→ List<
PaymentLeg> -
List of all payment legs (successful and failed).
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- splitId → String
-
UUID v4 identifying this split payment session.
final
- state → SplitSessionState
-
Current state derived from payment totals.
no setter
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited - subtotal → Decimal
-
The order subtotal excluding the explicit tip.
no setter
- successfulLegCount → int
-
Number of successful payment legs.
no setter
- surplusTipAmount → Decimal
-
Surplus (implicit) tip: the amount by which payments exceed the order total.
no setter
- tipAmount → Decimal
-
Backward-compatible alias — returns totalTipAmount.
no setter
- totalAmountTendered → Decimal
-
Total amount tendered across all payment legs.
no setter
- totalCashSurplus → Decimal
-
Total cash surplus (change) across all successful cash legs.
no setter
- totalTipAmount → Decimal
-
Total tip: explicit (order-level) + implicit (surplus).
no setter
Methods
-
addPaymentLeg(
PaymentLeg leg) → SplitSession - Returns a new session with the given payment leg added.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited