Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Market {
- final double price;
- final String from;
- final String to;
- final bool isCancelled;
- final double priceAt;
- final DateTime date;
- final double pips;
- final List<TakeOuts> takeOuts;
- Market({
- this.price,
- this.from,
- this.to,
- this.isCancelled,
- this.priceAt,
- this.date,
- this.takeOuts,
- this.pips,
- });
- get isWon => takeOuts.where((c) => !c.isCompleted).isEmpty;
- }
- class TakeOuts {
- final double pips;
- final double id;
- final bool isCompleted;
- TakeOuts({
- this.pips,
- this.id,
- this.isCompleted,
- });
- }
- import 'package:i_go_trade/utils/models.dart';
- List<Market> markets = [
- Market(
- date: DateTime.now().subtract(Duration(days: 14)),
- isCancelled: false,
- from: "NZD",
- to: "USD",
- pips: 21,
- price: 0.6593,
- priceAt: 0.661398,
- takeOuts: [
- TakeOuts(
- pips: 20,
- isCompleted: true,
- id: 113,
- ),
- TakeOuts(
- pips: 76,
- isCompleted: true,
- id: 143,
- ),
- TakeOuts(
- pips: 23,
- isCompleted: true,
- id: 142,
- ),
- TakeOuts(
- pips: 14,
- isCompleted: true,
- id: 346,
- ),
- TakeOuts(
- pips: 24,
- isCompleted: true,
- id: 142,
- ),
- ]
- ),
- Market(
- date: DateTime.now().subtract(Duration(days: 10)),
- isCancelled: false,
- from: "XAU",
- to: "USD",
- pips: 21,
- price: 1311,
- priceAt: 1324.22,
- takeOuts: [
- TakeOuts(
- pips: 40,
- isCompleted: true,
- id: 1315,
- ),
- TakeOuts(
- pips: 70,
- isCompleted: true,
- id: 1318,
- ),
- TakeOuts(
- pips: 90,
- isCompleted: true,
- id: 1320,
- ),
- TakeOuts(
- pips: 140,
- isCompleted: false,
- id: 1325,
- ),
- TakeOuts(
- pips: 190,
- isCompleted: true,
- id: 1330,
- ),
- ]
- ),
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement