year.dart 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import 'package:flutter/material.dart';
  2. import 'database.dart';
  3. import 'drawer.dart';
  4. class Year extends StatelessWidget {
  5. // The indexes of each array match the assigned recipe.
  6. // DO NOT loop through each of these individually
  7. // to generate the recipes.
  8. @override
  9. Widget build(BuildContext context) {
  10. var text_style = TextStyle(
  11. fontWeight: FontWeight.bold,
  12. fontSize: 20,
  13. );
  14. movieData.sort((a, b) => a['releasedate'].compareTo(b['releasedate']));
  15. return Scaffold(
  16. appBar: AppBar(
  17. // The title text which will be shown on the action bar
  18. title: Center(child: Text("By Year")),
  19. ),
  20. drawer: Container(
  21. color: Colors.grey,
  22. child: AppDrawer(),
  23. ), //Appbar
  24. body: ListView(children: [
  25. for (var point = 0; point < movieData.length; point++)
  26. Container(
  27. child: Flex(
  28. direction: Axis.horizontal,
  29. textDirection: TextDirection.ltr,
  30. children: [
  31. Expanded(
  32. flex: 1,
  33. child: Container(
  34. child: Image.asset('assets/poster/' +
  35. movieData[point]["postimages"]),
  36. margin: EdgeInsets.fromLTRB(0, 0, 10, 0))),
  37. Expanded(
  38. flex: 1,
  39. child: Column(
  40. crossAxisAlignment: CrossAxisAlignment.start,
  41. children: [
  42. Container(
  43. child: Text(movieData[point]["movietitle"],
  44. style: text_style),
  45. margin: EdgeInsets.fromLTRB(0, 0, 2, 2)),
  46. Container(
  47. child: Row(
  48. children: [
  49. Text(
  50. "Release Date",
  51. style: TextStyle(
  52. fontSize: 18,
  53. ),
  54. ),
  55. Text(movieData[point]["releasedate"],
  56. style: TextStyle(
  57. fontSize: 18,
  58. fontStyle: FontStyle.italic)),
  59. ],
  60. ),
  61. ),
  62. Container(
  63. child: Text(
  64. 'Score' +
  65. movieData[point]["ratings"].toString() +
  66. "%",
  67. style: TextStyle(
  68. fontSize: 18,
  69. )),
  70. )
  71. ]))
  72. ],
  73. ),
  74. margin: EdgeInsets.fromLTRB(0, 0, 0, 10))
  75. ]),
  76. ); //Scaffold
  77. } //build
  78. }