Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.10 KB | None | 0 0
  1. class ApiResult {
  2. int page;
  3. int totalPages;
  4. int totalResults;
  5. String type;
  6. int count;
  7. List<Players> items;
  8.  
  9. ApiResult(
  10. {this.page,
  11. this.totalPages,
  12. this.totalResults,
  13. this.type,
  14. this.count,
  15. this.items});
  16.  
  17. ApiResult.fromJson(Map<String, dynamic> json) {
  18. page = json['page'];
  19. totalPages = json['totalPages'];
  20. totalResults = json['totalResults'];
  21. type = json['type'];
  22. count = json['count'];
  23. if (json['items'] != null) {
  24. items = new List<Players>();
  25. json['items'].forEach((v) {
  26. items.add(new Players.fromJson(v));
  27. });
  28. }
  29. }
  30.  
  31. Map<String, dynamic> toJson() {
  32. final Map<String, dynamic> data = new Map<String, dynamic>();
  33. data['page'] = this.page;
  34. data['totalPages'] = this.totalPages;
  35. data['totalResults'] = this.totalResults;
  36. data['type'] = this.type;
  37. data['count'] = this.count;
  38. if (this.items != null) {
  39. data['items'] = this.items.map((v) => v.toJson()).toList();
  40. }
  41. return data;
  42. }
  43. }
  44.  
  45. class Players {
  46. String commonName;
  47. String firstName;
  48. String lastName;
  49. League league;
  50. Nation nation;
  51. Club club;
  52. Headshot headshot;
  53. String position;
  54. int composure;
  55. String playStyle;
  56. Null playStyleId;
  57. int height;
  58. int weight;
  59. String birthdate;
  60. int age;
  61. int acceleration;
  62. int aggression;
  63. int agility;
  64. int balance;
  65. int ballcontrol;
  66. String foot;
  67. int skillMoves;
  68. int crossing;
  69. int curve;
  70. int dribbling;
  71. int finishing;
  72. int freekickaccuracy;
  73. int gkdiving;
  74. int gkhandling;
  75. int gkkicking;
  76. int gkpositioning;
  77. int gkreflexes;
  78. int headingaccuracy;
  79. int interceptions;
  80. int jumping;
  81. int longpassing;
  82. int longshots;
  83. int marking;
  84. int penalties;
  85. int positioning;
  86. int potential;
  87. int reactions;
  88. int shortpassing;
  89. int shotpower;
  90. int slidingtackle;
  91. int sprintspeed;
  92. int standingtackle;
  93. int stamina;
  94. int strength;
  95. int vision;
  96. int volleys;
  97. int weakFoot;
  98. List<String> traits;
  99. List<String> specialities;
  100. String atkWorkRate;
  101. String defWorkRate;
  102. Null playerType;
  103. List<Attributes> attributes;
  104. String name;
  105. int rarityId;
  106. bool isIcon;
  107. String quality;
  108. bool isGK;
  109. String positionFull;
  110. bool isSpecialType;
  111. Null contracts;
  112. Null fitness;
  113. Null rawAttributeChemistryBonus;
  114. Null isLoan;
  115. Null squadPosition;
  116. IconAttributes iconAttributes;
  117. String itemType;
  118. Null discardValue;
  119. String id;
  120. String modelName;
  121. int baseId;
  122. int rating;
  123.  
  124. Players(
  125. {this.commonName,
  126. this.firstName,
  127. this.lastName,
  128. this.league,
  129. this.nation,
  130. this.club,
  131. this.headshot,
  132. this.position,
  133. this.composure,
  134. this.playStyle,
  135. this.playStyleId,
  136. this.height,
  137. this.weight,
  138. this.birthdate,
  139. this.age,
  140. this.acceleration,
  141. this.aggression,
  142. this.agility,
  143. this.balance,
  144. this.ballcontrol,
  145. this.foot,
  146. this.skillMoves,
  147. this.crossing,
  148. this.curve,
  149. this.dribbling,
  150. this.finishing,
  151. this.freekickaccuracy,
  152. this.gkdiving,
  153. this.gkhandling,
  154. this.gkkicking,
  155. this.gkpositioning,
  156. this.gkreflexes,
  157. this.headingaccuracy,
  158. this.interceptions,
  159. this.jumping,
  160. this.longpassing,
  161. this.longshots,
  162. this.marking,
  163. this.penalties,
  164. this.positioning,
  165. this.potential,
  166. this.reactions,
  167. this.shortpassing,
  168. this.shotpower,
  169. this.slidingtackle,
  170. this.sprintspeed,
  171. this.standingtackle,
  172. this.stamina,
  173. this.strength,
  174. this.vision,
  175. this.volleys,
  176. this.weakFoot,
  177. this.traits,
  178. this.specialities,
  179. this.atkWorkRate,
  180. this.defWorkRate,
  181. this.playerType,
  182. this.attributes,
  183. this.name,
  184. this.rarityId,
  185. this.isIcon,
  186. this.quality,
  187. this.isGK,
  188. this.positionFull,
  189. this.isSpecialType,
  190. this.contracts,
  191. this.fitness,
  192. this.rawAttributeChemistryBonus,
  193. this.isLoan,
  194. this.squadPosition,
  195. this.iconAttributes,
  196. this.itemType,
  197. this.discardValue,
  198. this.id,
  199. this.modelName,
  200. this.baseId,
  201. this.rating});
  202.  
  203. Players.fromJson(Map<String, dynamic> json) {
  204. commonName = json['commonName'];
  205. firstName = json['firstName'];
  206. lastName = json['lastName'];
  207. league =
  208. json['league'] != null ? new League.fromJson(json['league']) : null;
  209. nation =
  210. json['nation'] != null ? new Nation.fromJson(json['nation']) : null;
  211. club = json['club'] != null ? new Club.fromJson(json['club']) : null;
  212. headshot = json['headshot'] != null
  213. ? new Headshot.fromJson(json['headshot'])
  214. : null;
  215. position = json['position'];
  216. composure = json['composure'];
  217. playStyle = json['playStyle'];
  218. playStyleId = json['playStyleId'];
  219. height = json['height'];
  220. weight = json['weight'];
  221. birthdate = json['birthdate'];
  222. age = json['age'];
  223. acceleration = json['acceleration'];
  224. aggression = json['aggression'];
  225. agility = json['agility'];
  226. balance = json['balance'];
  227. ballcontrol = json['ballcontrol'];
  228. foot = json['foot'];
  229. skillMoves = json['skillMoves'];
  230. crossing = json['crossing'];
  231. curve = json['curve'];
  232. dribbling = json['dribbling'];
  233. finishing = json['finishing'];
  234. freekickaccuracy = json['freekickaccuracy'];
  235. gkdiving = json['gkdiving'];
  236. gkhandling = json['gkhandling'];
  237. gkkicking = json['gkkicking'];
  238. gkpositioning = json['gkpositioning'];
  239. gkreflexes = json['gkreflexes'];
  240. headingaccuracy = json['headingaccuracy'];
  241. interceptions = json['interceptions'];
  242. jumping = json['jumping'];
  243. longpassing = json['longpassing'];
  244. longshots = json['longshots'];
  245. marking = json['marking'];
  246. penalties = json['penalties'];
  247. positioning = json['positioning'];
  248. potential = json['potential'];
  249. reactions = json['reactions'];
  250. shortpassing = json['shortpassing'];
  251. shotpower = json['shotpower'];
  252. slidingtackle = json['slidingtackle'];
  253. sprintspeed = json['sprintspeed'];
  254. standingtackle = json['standingtackle'];
  255. stamina = json['stamina'];
  256. strength = json['strength'];
  257. vision = json['vision'];
  258. volleys = json['volleys'];
  259. weakFoot = json['weakFoot'];
  260. //traits = json['traits'].cast<String>();
  261. //specialities = json['specialities'].cast<String>();
  262. atkWorkRate = json['atkWorkRate'];
  263. defWorkRate = json['defWorkRate'];
  264. playerType = json['playerType'];
  265. if (json['attributes'] != null) {
  266. attributes = new List<Attributes>();
  267. json['attributes'].forEach((v) {
  268. attributes.add(new Attributes.fromJson(v));
  269. });
  270. }
  271. name = json['name'];
  272. rarityId = json['rarityId'];
  273. isIcon = json['isIcon'];
  274. quality = json['quality'];
  275. isGK = json['isGK'];
  276. positionFull = json['positionFull'];
  277. isSpecialType = json['isSpecialType'];
  278. contracts = json['contracts'];
  279. fitness = json['fitness'];
  280. rawAttributeChemistryBonus = json['rawAttributeChemistryBonus'];
  281. isLoan = json['isLoan'];
  282. squadPosition = json['squadPosition'];
  283. iconAttributes = json['iconAttributes'] != null
  284. ? new IconAttributes.fromJson(json['iconAttributes'])
  285. : null;
  286. itemType = json['itemType'];
  287. discardValue = json['discardValue'];
  288. id = json['id'];
  289. modelName = json['modelName'];
  290. baseId = json['baseId'];
  291. rating = json['rating'];
  292. }
  293.  
  294. Map<String, dynamic> toJson() {
  295. final Map<String, dynamic> data = new Map<String, dynamic>();
  296. data['commonName'] = this.commonName;
  297. data['firstName'] = this.firstName;
  298. data['lastName'] = this.lastName;
  299. if (this.league != null) {
  300. data['league'] = this.league.toJson();
  301. }
  302. if (this.nation != null) {
  303. data['nation'] = this.nation.toJson();
  304. }
  305. if (this.club != null) {
  306. data['club'] = this.club.toJson();
  307. }
  308. if (this.headshot != null) {
  309. data['headshot'] = this.headshot.toJson();
  310. }
  311. data['position'] = this.position;
  312. data['composure'] = this.composure;
  313. data['playStyle'] = this.playStyle;
  314. data['playStyleId'] = this.playStyleId;
  315. data['height'] = this.height;
  316. data['weight'] = this.weight;
  317. data['birthdate'] = this.birthdate;
  318. data['age'] = this.age;
  319. data['acceleration'] = this.acceleration;
  320. data['aggression'] = this.aggression;
  321. data['agility'] = this.agility;
  322. data['balance'] = this.balance;
  323. data['ballcontrol'] = this.ballcontrol;
  324. data['foot'] = this.foot;
  325. data['skillMoves'] = this.skillMoves;
  326. data['crossing'] = this.crossing;
  327. data['curve'] = this.curve;
  328. data['dribbling'] = this.dribbling;
  329. data['finishing'] = this.finishing;
  330. data['freekickaccuracy'] = this.freekickaccuracy;
  331. data['gkdiving'] = this.gkdiving;
  332. data['gkhandling'] = this.gkhandling;
  333. data['gkkicking'] = this.gkkicking;
  334. data['gkpositioning'] = this.gkpositioning;
  335. data['gkreflexes'] = this.gkreflexes;
  336. data['headingaccuracy'] = this.headingaccuracy;
  337. data['interceptions'] = this.interceptions;
  338. data['jumping'] = this.jumping;
  339. data['longpassing'] = this.longpassing;
  340. data['longshots'] = this.longshots;
  341. data['marking'] = this.marking;
  342. data['penalties'] = this.penalties;
  343. data['positioning'] = this.positioning;
  344. data['potential'] = this.potential;
  345. data['reactions'] = this.reactions;
  346. data['shortpassing'] = this.shortpassing;
  347. data['shotpower'] = this.shotpower;
  348. data['slidingtackle'] = this.slidingtackle;
  349. data['sprintspeed'] = this.sprintspeed;
  350. data['standingtackle'] = this.standingtackle;
  351. data['stamina'] = this.stamina;
  352. data['strength'] = this.strength;
  353. data['vision'] = this.vision;
  354. data['volleys'] = this.volleys;
  355. data['weakFoot'] = this.weakFoot;
  356. data['traits'] = this.traits;
  357. data['specialities'] = this.specialities;
  358. data['atkWorkRate'] = this.atkWorkRate;
  359. data['defWorkRate'] = this.defWorkRate;
  360. data['playerType'] = this.playerType;
  361. if (this.attributes != null) {
  362. data['attributes'] = this.attributes.map((v) => v.toJson()).toList();
  363. }
  364. data['name'] = this.name;
  365. data['rarityId'] = this.rarityId;
  366. data['isIcon'] = this.isIcon;
  367. data['quality'] = this.quality;
  368. data['isGK'] = this.isGK;
  369. data['positionFull'] = this.positionFull;
  370. data['isSpecialType'] = this.isSpecialType;
  371. data['contracts'] = this.contracts;
  372. data['fitness'] = this.fitness;
  373. data['rawAttributeChemistryBonus'] = this.rawAttributeChemistryBonus;
  374. data['isLoan'] = this.isLoan;
  375. data['squadPosition'] = this.squadPosition;
  376. if (this.iconAttributes != null) {
  377. data['iconAttributes'] = this.iconAttributes.toJson();
  378. }
  379. data['itemType'] = this.itemType;
  380. data['discardValue'] = this.discardValue;
  381. data['id'] = this.id;
  382. data['modelName'] = this.modelName;
  383. data['baseId'] = this.baseId;
  384. data['rating'] = this.rating;
  385. return data;
  386. }
  387. }
  388.  
  389. class League {
  390. LeagueImageUrls imageUrls;
  391. String abbrName;
  392. int id;
  393. Null imgUrl;
  394. String name;
  395.  
  396. League({this.imageUrls, this.abbrName, this.id, this.imgUrl, this.name});
  397.  
  398. League.fromJson(Map<String, dynamic> json) {
  399. imageUrls = json['imageUrls'] != null
  400. ? new LeagueImageUrls.fromJson(json['imageUrls'])
  401. : null;
  402. abbrName = json['abbrName'];
  403. id = json['id'];
  404. imgUrl = json['imgUrl'];
  405. name = json['name'];
  406. }
  407.  
  408. Map<String, dynamic> toJson() {
  409. final Map<String, dynamic> data = new Map<String, dynamic>();
  410. if (this.imageUrls != null) {
  411. data['imageUrls'] = this.imageUrls.toJson();
  412. }
  413. data['abbrName'] = this.abbrName;
  414. data['id'] = this.id;
  415. data['imgUrl'] = this.imgUrl;
  416. data['name'] = this.name;
  417. return data;
  418. }
  419. }
  420.  
  421. class LeagueImageUrls {
  422. String dark;
  423. String light;
  424.  
  425. LeagueImageUrls({this.dark, this.light});
  426.  
  427. LeagueImageUrls.fromJson(Map<String, dynamic> json) {
  428. dark = json['dark'];
  429. light = json['light'];
  430. }
  431.  
  432. Map<String, dynamic> toJson() {
  433. final Map<String, dynamic> data = new Map<String, dynamic>();
  434. data['dark'] = this.dark;
  435. data['light'] = this.light;
  436. return data;
  437. }
  438. }
  439.  
  440. class Nation {
  441. NationImageUrls imageUrls;
  442. String abbrName;
  443. int id;
  444. Null imgUrl;
  445. String name;
  446.  
  447. Nation({this.imageUrls, this.abbrName, this.id, this.imgUrl, this.name});
  448.  
  449. Nation.fromJson(Map<String, dynamic> json) {
  450. imageUrls = json['imageUrls'] != null
  451. ? new NationImageUrls.fromJson(json['imageUrls'])
  452. : null;
  453. abbrName = json['abbrName'];
  454. id = json['id'];
  455. imgUrl = json['imgUrl'];
  456. name = json['name'];
  457. }
  458.  
  459. Map<String, dynamic> toJson() {
  460. final Map<String, dynamic> data = new Map<String, dynamic>();
  461. if (this.imageUrls != null) {
  462. data['imageUrls'] = this.imageUrls.toJson();
  463. }
  464. data['abbrName'] = this.abbrName;
  465. data['id'] = this.id;
  466. data['imgUrl'] = this.imgUrl;
  467. data['name'] = this.name;
  468. return data;
  469. }
  470. }
  471.  
  472. class NationImageUrls {
  473. String small;
  474. String medium;
  475. String large;
  476.  
  477. NationImageUrls({this.small, this.medium, this.large});
  478.  
  479. NationImageUrls.fromJson(Map<String, dynamic> json) {
  480. small = json['small'];
  481. medium = json['medium'];
  482. large = json['large'];
  483. }
  484.  
  485. Map<String, dynamic> toJson() {
  486. final Map<String, dynamic> data = new Map<String, dynamic>();
  487. data['small'] = this.small;
  488. data['medium'] = this.medium;
  489. data['large'] = this.large;
  490. return data;
  491. }
  492. }
  493.  
  494. class Club {
  495. ImageUrls imageUrls;
  496. String abbrName;
  497. int id;
  498. Null imgUrl;
  499. String name;
  500.  
  501. Club({this.imageUrls, this.abbrName, this.id, this.imgUrl, this.name});
  502.  
  503. Club.fromJson(Map<String, dynamic> json) {
  504. imageUrls = json['imageUrls'] != null
  505. ? new ImageUrls.fromJson(json['imageUrls'])
  506. : null;
  507. abbrName = json['abbrName'];
  508. id = json['id'];
  509. imgUrl = json['imgUrl'];
  510. name = json['name'];
  511. }
  512.  
  513. Map<String, dynamic> toJson() {
  514. final Map<String, dynamic> data = new Map<String, dynamic>();
  515. if (this.imageUrls != null) {
  516. data['imageUrls'] = this.imageUrls.toJson();
  517. }
  518. data['abbrName'] = this.abbrName;
  519. data['id'] = this.id;
  520. data['imgUrl'] = this.imgUrl;
  521. data['name'] = this.name;
  522. return data;
  523. }
  524. }
  525.  
  526. class ImageUrls {
  527. Dark dark;
  528. Light light;
  529.  
  530. ImageUrls({this.dark, this.light});
  531.  
  532. ImageUrls.fromJson(Map<String, dynamic> json) {
  533. dark = json['dark'] != null ? new Dark.fromJson(json['dark']) : null;
  534. light = json['light'] != null ? new Light.fromJson(json['light']) : null;
  535. }
  536.  
  537. Map<String, dynamic> toJson() {
  538. final Map<String, dynamic> data = new Map<String, dynamic>();
  539. if (this.dark != null) {
  540. data['dark'] = this.dark.toJson();
  541. }
  542. if (this.light != null) {
  543. data['light'] = this.light.toJson();
  544. }
  545. return data;
  546. }
  547. }
  548.  
  549. class Dark {
  550. String small;
  551. String medium;
  552. String large;
  553.  
  554. Dark({this.small, this.medium, this.large});
  555.  
  556. Dark.fromJson(Map<String, dynamic> json) {
  557. small = json['small'];
  558. medium = json['medium'];
  559. large = json['large'];
  560. }
  561.  
  562. Map<String, dynamic> toJson() {
  563. final Map<String, dynamic> data = new Map<String, dynamic>();
  564. data['small'] = this.small;
  565. data['medium'] = this.medium;
  566. data['large'] = this.large;
  567. return data;
  568. }
  569. }
  570.  
  571. class Light {
  572. String small;
  573. String medium;
  574. String large;
  575.  
  576. Light({this.small, this.medium, this.large});
  577.  
  578. Light.fromJson(Map<String, dynamic> json) {
  579. small = json['small'];
  580. medium = json['medium'];
  581. large = json['large'];
  582. }
  583.  
  584. Map<String, dynamic> toJson() {
  585. final Map<String, dynamic> data = new Map<String, dynamic>();
  586. data['small'] = this.small;
  587. data['medium'] = this.medium;
  588. data['large'] = this.large;
  589. return data;
  590. }
  591. }
  592.  
  593. class Headshot {
  594. String imgUrl;
  595. bool isDynamicPortrait;
  596.  
  597. Headshot({this.imgUrl, this.isDynamicPortrait});
  598.  
  599. Headshot.fromJson(Map<String, dynamic> json) {
  600. imgUrl = json['imgUrl'];
  601. isDynamicPortrait = json['isDynamicPortrait'];
  602. }
  603.  
  604. Map<String, dynamic> toJson() {
  605. final Map<String, dynamic> data = new Map<String, dynamic>();
  606. data['imgUrl'] = this.imgUrl;
  607. data['isDynamicPortrait'] = this.isDynamicPortrait;
  608. return data;
  609. }
  610. }
  611.  
  612. class Attributes {
  613. String name;
  614. int value;
  615. List<int> chemistryBonus;
  616.  
  617. Attributes({this.name, this.value, this.chemistryBonus});
  618.  
  619. Attributes.fromJson(Map<String, dynamic> json) {
  620. name = json['name'];
  621. value = json['value'];
  622. chemistryBonus = json['chemistryBonus'].cast<int>();
  623. }
  624.  
  625. Map<String, dynamic> toJson() {
  626. final Map<String, dynamic> data = new Map<String, dynamic>();
  627. data['name'] = this.name;
  628. data['value'] = this.value;
  629. data['chemistryBonus'] = this.chemistryBonus;
  630. return data;
  631. }
  632. }
  633.  
  634. class IconAttributes {
  635. List<ClubTeamStats> clubTeamStats;
  636. List<NationalTeamStats> nationalTeamStats;
  637. String iconText;
  638.  
  639. IconAttributes({this.clubTeamStats, this.nationalTeamStats, this.iconText});
  640.  
  641. IconAttributes.fromJson(Map<String, dynamic> json) {
  642. if (json['clubTeamStats'] != null) {
  643. clubTeamStats = new List<ClubTeamStats>();
  644. json['clubTeamStats'].forEach((v) {
  645. clubTeamStats.add(new ClubTeamStats.fromJson(v));
  646. });
  647. }
  648. if (json['nationalTeamStats'] != null) {
  649. nationalTeamStats = new List<NationalTeamStats>();
  650. json['nationalTeamStats'].forEach((v) {
  651. nationalTeamStats.add(new NationalTeamStats.fromJson(v));
  652. });
  653. }
  654. iconText = json['iconText'];
  655. }
  656.  
  657. Map<String, dynamic> toJson() {
  658. final Map<String, dynamic> data = new Map<String, dynamic>();
  659. if (this.clubTeamStats != null) {
  660. data['clubTeamStats'] =
  661. this.clubTeamStats.map((v) => v.toJson()).toList();
  662. }
  663. if (this.nationalTeamStats != null) {
  664. data['nationalTeamStats'] =
  665. this.nationalTeamStats.map((v) => v.toJson()).toList();
  666. }
  667. data['iconText'] = this.iconText;
  668. return data;
  669. }
  670. }
  671.  
  672. class ClubTeamStats {
  673. int years;
  674. int clubId;
  675. String clubName;
  676. int appearances;
  677. int goals;
  678.  
  679. ClubTeamStats(
  680. {this.years, this.clubId, this.clubName, this.appearances, this.goals});
  681.  
  682. ClubTeamStats.fromJson(Map<String, dynamic> json) {
  683. years = json['years'];
  684. clubId = json['clubId'];
  685. clubName = json['clubName'];
  686. appearances = json['appearances'];
  687. goals = json['goals'];
  688. }
  689.  
  690. Map<String, dynamic> toJson() {
  691. final Map<String, dynamic> data = new Map<String, dynamic>();
  692. data['years'] = this.years;
  693. data['clubId'] = this.clubId;
  694. data['clubName'] = this.clubName;
  695. data['appearances'] = this.appearances;
  696. data['goals'] = this.goals;
  697. return data;
  698. }
  699. }
  700.  
  701. class NationalTeamStats {
  702. int years;
  703. int clubId;
  704. String clubName;
  705. int appearances;
  706. int goals;
  707.  
  708. NationalTeamStats(
  709. {this.years, this.clubId, this.clubName, this.appearances, this.goals});
  710.  
  711. NationalTeamStats.fromJson(Map<String, dynamic> json) {
  712. years = json['years'];
  713. clubId = json['clubId'];
  714. clubName = json['clubName'];
  715. appearances = json['appearances'];
  716. goals = json['goals'];
  717. }
  718.  
  719. Map<String, dynamic> toJson() {
  720. final Map<String, dynamic> data = new Map<String, dynamic>();
  721. data['years'] = this.years;
  722. data['clubId'] = this.clubId;
  723. data['clubName'] = this.clubName;
  724. data['appearances'] = this.appearances;
  725. data['goals'] = this.goals;
  726. return data;
  727. }
  728. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement