Created with <3 with dartpad.dev.
Created
September 1, 2022 12:06
-
-
Save Quingsley/dc92ded33760b4fdf7dd1f6bbf3a8f1c to your computer and use it in GitHub Desktop.
bustling-gust-3556
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
void main() { | |
final List<Transactions> transactions = [ | |
Transactions( | |
'1', 'Shoes', 2500.34, DateTime.now()), | |
Transactions('3', 'Bag', 1500, DateTime.now()), | |
]; | |
var id = Random().nextInt(100) + 900; | |
print(id); | |
final txValue = Transactions( | |
'${DateTime.now().millisecondsSinceEpoch}', | |
'gggg', | |
2000, | |
DateTime.now()); | |
transactions.add(txValue); | |
print('before'); | |
print(transactions.map((tx)=> print(tx.id))); | |
print('done'); | |
} | |
class Transactions { | |
String id; | |
String title; | |
double amount; | |
DateTime date; | |
Transactions(this.id, this.title, this.amount, this.date); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment