basic layout of the PlannedPizzaWidget done
This commit is contained in:
parent
01b069bb6f
commit
fba9df5436
1 changed files with 43 additions and 16 deletions
|
@ -10,9 +10,11 @@ class PlannedPizzasPage extends StatefulWidget {
|
||||||
|
|
||||||
class PlannedPizzasState extends State<PlannedPizzasPage> {
|
class PlannedPizzasState extends State<PlannedPizzasPage> {
|
||||||
final List<PlannedPizza> plannedPizzas = <PlannedPizza>[
|
final List<PlannedPizza> plannedPizzas = <PlannedPizza>[
|
||||||
PlannedPizza("Movie Night", DateTime(2021, 6, 30)),
|
PlannedPizza("Movie Night", DateTime(2021, 6, 30, 12, 8)),
|
||||||
PlannedPizza("Birthday Pizza", DateTime(2021, 7, 14)),
|
PlannedPizza("Birthday Pizza", DateTime(2021, 7, 14)),
|
||||||
PlannedPizza("Something else", DateTime(2021, 9, 3)),
|
PlannedPizza("Something else", DateTime(2021, 9, 3)),
|
||||||
|
PlannedPizza("Something else", DateTime(2021, 9, 3)),
|
||||||
|
PlannedPizza("Something else", DateTime(2021, 9, 3)),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -26,7 +28,7 @@ class PlannedPizzasState extends State<PlannedPizzasPage> {
|
||||||
itemCount: plannedPizzas.length,
|
itemCount: plannedPizzas.length,
|
||||||
itemBuilder: (BuildContext context, int i) {
|
itemBuilder: (BuildContext context, int i) {
|
||||||
return Container(
|
return Container(
|
||||||
height: 150,
|
height: 120,
|
||||||
color: Colors.blueAccent,
|
color: Colors.blueAccent,
|
||||||
child: PlannedPizzaWidget(plannedPizzas[i])
|
child: PlannedPizzaWidget(plannedPizzas[i])
|
||||||
);
|
);
|
||||||
|
@ -38,7 +40,7 @@ class PlannedPizzasState extends State<PlannedPizzasPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
class PlannedPizzaWidget extends StatelessWidget {
|
class PlannedPizzaWidget extends StatelessWidget {
|
||||||
final DateFormat dateFormatter = DateFormat("yyyy-MM-dd");
|
final DateFormat dateFormatter = DateFormat("yyyy-MM-dd hh:mm");
|
||||||
final PlannedPizza plannedPizza;
|
final PlannedPizza plannedPizza;
|
||||||
|
|
||||||
PlannedPizzaWidget(this.plannedPizza);
|
PlannedPizzaWidget(this.plannedPizza);
|
||||||
|
@ -61,19 +63,44 @@ class PlannedPizzaWidget extends StatelessWidget {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(10),
|
||||||
height: 70,
|
height: 72,
|
||||||
child: ListView.separated(
|
child: Row(
|
||||||
scrollDirection: Axis.horizontal,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
itemCount: 4,
|
children: <Widget>[
|
||||||
itemBuilder: (BuildContext context, int i) {
|
SizedBox(
|
||||||
return Container(
|
width: 50,
|
||||||
height: 50,
|
height: 50,
|
||||||
color: Colors.green,
|
child: Container(
|
||||||
child: Text("TEST")
|
color: Colors.green,
|
||||||
);
|
child: Container()
|
||||||
},
|
)
|
||||||
separatorBuilder: (BuildContext context, int i) => const Divider(),
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
child: Container(
|
||||||
|
color: Colors.green,
|
||||||
|
child: Container()
|
||||||
|
)
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
child: Container(
|
||||||
|
color: Colors.green,
|
||||||
|
child: Container()
|
||||||
|
)
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
child: Container(
|
||||||
|
color: Colors.green,
|
||||||
|
child: Container()
|
||||||
|
)
|
||||||
|
),
|
||||||
|
]
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(dateFormatter.format(plannedPizza.dateTime)),
|
Text(dateFormatter.format(plannedPizza.dateTime)),
|
||||||
|
|
Loading…
Add table
Reference in a new issue