Skip to content

Instantly share code, notes, and snippets.

@Quingsley
Created September 1, 2022 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Quingsley/dc92ded33760b4fdf7dd1f6bbf3a8f1c to your computer and use it in GitHub Desktop.
Save Quingsley/dc92ded33760b4fdf7dd1f6bbf3a8f1c to your computer and use it in GitHub Desktop.
bustling-gust-3556
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