This Dart program provides a simple banking system with functionalities to:
- Create accounts with unique IDs and balances.
- Withdraw or deposit money while handling edge cases.
- Display account details, including account ID and current balance.
-
Account Initialization:
- Supports two types of constructors:
- Standard constructor to set the account ID and initial balance.
- Named constructor to set the account ID with an initial balance of zero.
- Supports two types of constructors:
-
Deposit Method:
- Ensures the deposit amount is positive.
- Adds the specified amount to the balance.
-
Withdraw Method:
- Ensures the withdrawal amount is positive.
- Checks if the balance is sufficient before deducting the amount.
- Displays appropriate messages for invalid or insufficient funds.
-
Display Account Details:
- Prints the account ID and current balance in a formatted way.