actor.dart 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import 'package:flutter/material.dart';
  2. import 'database.dart';
  3. import 'drawer.dart';
  4. class Actor 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['actorname'].compareTo(b['actorname']));
  15. return Scaffold(
  16. appBar: AppBar(
  17. // The title text which will be shown on the action bar
  18. title: Center(child: Text("By Actor")),
  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]["actorimage"]),
  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]["actorname"],
  44. style: text_style),
  45. margin: EdgeInsets.fromLTRB(0, 0, 2, 2)),
  46. Container(
  47. child: Text(
  48. 'Movie:' + movieData[point]["movietitle"],
  49. style: TextStyle(
  50. fontSize: 18,
  51. fontStyle: FontStyle.italic)),
  52. ),
  53. Container(
  54. child: Row(
  55. children: [
  56. Text(
  57. "Release Date",
  58. style: TextStyle(
  59. fontSize: 18,
  60. ),
  61. ),
  62. Text(movieData[point]["releasedate"],
  63. style: TextStyle(
  64. fontSize: 18,
  65. fontStyle: FontStyle.italic)),
  66. ],
  67. ),
  68. )
  69. ]))
  70. ],
  71. ),
  72. margin: EdgeInsets.fromLTRB(0, 0, 0, 10))
  73. ]),
  74. ); //Scaffold
  75. } //build
  76. }