Advertisement
Guest User

Untitled

a guest
May 21st, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.84 KB | None | 0 0
  1. body: ListView.builder(
  2. itemCount: userData == null ? 0 : userData.length,
  3. itemBuilder: (BuildContext context, int index) {
  4. return InkWell(
  5. child: Padding(
  6. padding: const EdgeInsets.all(8.0),
  7. child: Row(
  8. children: <Widget>[
  9. Container(
  10. margin: EdgeInsets.only(top: 16.0),
  11. child: Material(
  12. elevation: 14.0,
  13. borderRadius: BorderRadius.circular(12.0),
  14. shadowColor: globals.isDarkTheme
  15. ? Colors.grey[700]
  16. : Color(0x802196F3),
  17. color:
  18. globals.isDarkTheme ? Colors.grey[850] : Colors.white,
  19. child: InkWell(
  20. onTap: () {
  21. var route = new MaterialPageRoute(
  22. builder: (BuildContext context) =>
  23. new ActionServerPage(
  24. server: User(
  25. id:
  26. userData[index]["attributes"]
  27. ["identifier"],
  28. name: userData[index]["attributes"]
  29. ["name"])),
  30. );
  31. Navigator.of(context).push(route);
  32. },
  33. child: Padding(
  34. padding: EdgeInsets.all(30.0),
  35. child: Column(
  36. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  37. crossAxisAlignment: CrossAxisAlignment.start,
  38. children: <Widget>[
  39. /// Title and rating
  40. Column(
  41. mainAxisAlignment: MainAxisAlignment.center,
  42. crossAxisAlignment: CrossAxisAlignment.start,
  43. children: <Widget>[
  44. Text(
  45. '${userData[index]["attributes"]["description"]}',
  46. style:
  47. TextStyle(color: Colors.blueAccent)),
  48. Row(
  49. mainAxisAlignment: MainAxisAlignment.start,
  50. crossAxisAlignment:
  51. CrossAxisAlignment.center,
  52. children: <Widget>[
  53. Text(
  54. '${userData[index]["attributes"]["name"]}',
  55. style: TextStyle(
  56. color: globals.isDarkTheme
  57. ? Colors.white
  58. : Colors.black,
  59. fontWeight: FontWeight.w700,
  60. fontSize: 18.0)),
  61. ],
  62. ),
  63. ],
  64. ),
  65.  
  66. /// Infos
  67. Row(
  68. mainAxisAlignment: MainAxisAlignment.start,
  69. crossAxisAlignment: CrossAxisAlignment.center,
  70. children: <Widget>[
  71. Text(
  72. DemoLocalizations.of(context)
  73. .trans('total_ram'),
  74. style: TextStyle(
  75. color: globals.isDarkTheme
  76. ? Colors.white
  77. : Colors.black,
  78. )),
  79. Padding(
  80. padding:
  81. EdgeInsets.symmetric(horizontal: 4.0),
  82. child: Material(
  83. borderRadius: BorderRadius.circular(8.0),
  84. color: Colors.green,
  85. child: Padding(
  86. padding: EdgeInsets.all(4.0),
  87. child: Text(
  88. '${userData[index]["attributes"]["limits"]["memory"]} MB',
  89. style: TextStyle(
  90. fontWeight: FontWeight.w700,
  91. color: Colors.white)),
  92. ),
  93. ),
  94. ),
  95. Text(
  96. DemoLocalizations.of(context)
  97. .trans('total_disk'),
  98. style: TextStyle(
  99. color: globals.isDarkTheme
  100. ? Colors.white
  101. : Colors.black,
  102. )),
  103. Padding(
  104. padding:
  105. EdgeInsets.symmetric(horizontal: 4.0),
  106. child: Material(
  107. borderRadius: BorderRadius.circular(8.0),
  108. color: Colors.green,
  109. child: Padding(
  110. padding: EdgeInsets.all(4.0),
  111. child: Text(
  112. '${userData[index]["attributes"]["limits"]["disk"]} MB',
  113. style: TextStyle(
  114. fontWeight: FontWeight.w700,
  115. color: Colors.white)),
  116. ),
  117. ),
  118. ),
  119. ],
  120. ),
  121. ],
  122. ),
  123. ),
  124. ),
  125. ),
  126. ),
  127. Spacer(),
  128. ],
  129. ),
  130. ),
  131. );
  132. },
  133. ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement