123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- import 'package:flutter/material.dart';
- import 'database.dart';
- import 'drawer.dart';
- class Home extends StatelessWidget {
- // The indexes of each array match the assigned recipe.
- // DO NOT loop through each of these individually
- // to generate the recipes.
- @override
- Widget build(BuildContext context) {
- var text_style = new TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 20,
- );
- movieData.sort((a, b) => a['movietitle'].compareTo(b['movietitle']));
- return Scaffold(
- appBar: AppBar(
- // The title text which will be shown on the action bar
- title: Center(child: Text("Wes Anderson")),
- ),
- drawer: Container(
- color: Colors.grey,
- child: AppDrawer(),
- ), //Appbar
- body: ListView(children: [
- for (var point = 0; point < movieData.length; point++)
- new Container(
- child: new Flex(
- direction: Axis.horizontal,
- textDirection: TextDirection.ltr,
- children: [
- new Expanded(
- flex: 1,
- child: new Container(
- child: Image.asset('assets/poster/' +
- movieData[point]["postimages"]),
- margin: EdgeInsets.fromLTRB(0, 0, 10, 0))),
- new Expanded(
- flex: 1,
- child: new Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- new Container(
- child: Text(movieData[point]["movietitle"],
- style: text_style),
- margin: EdgeInsets.fromLTRB(0, 0, 2, 2)),
- new Container(
- child: Row(
- children: [
- Text(
- "Release Date",
- style: TextStyle(
- fontSize: 18,
- ),
- ),
- Text(movieData[point]["releasedate"],
- style: TextStyle(
- fontSize: 18,
- fontStyle: FontStyle.italic)),
- ],
- ),
- ),
- new Container(
- child: Text(
- 'Score' +
- movieData[point]["ratings"].toString() +
- "%",
- style: TextStyle(
- fontSize: 18,
- )),
- )
- ]))
- ],
- ),
- margin: EdgeInsets.fromLTRB(0, 0, 0, 10))
- ]),
- ); //Scaffold
- } //build
- }
|