1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-10 14:58:34 +00:00
Files
samples/web/filipino_cuisine/lib/cook.dart
John Ryan 3f5ab56485 Add workflow to deploy the sample index (#791)
* Add workflow to build and deploy the sample index

* update gh-pages action

* fix yaml

* create web/ directory in build

* grammar

* add ignored directories

* revert pubspec.lock files

* add job to run _tool/verify_samples.dart

* Update filipino_cuisine for Flutter 2

* remove timeflow demo.

The unnamed List constructor is now deprecated, refactoring
this code to use add() requires more knowledge about the code for
this demo.
https://dart.dev/null-safety/understanding-null-safety#no-unnamed-list-constructor

* update slide_puzzle

* ensure stable channel is used to verify

* move verify web demos action into separate yaml file - avoid running
on each flutter version.

* add on: pull_request

* update slide_puzzle

* Update gh-pages.yml

* Add copyright header
2021-05-06 10:26:15 -07:00

57 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
class Cook extends StatefulWidget {
final List dr;
final img;
final nme;
Cook(this.dr, this.img, this.nme);
CState createState() => CState();
}
class CState extends State<Cook> {
List cb;
initState() {
super.initState();
cb = [];
}
Widget build(ct) {
List dr = widget.dr;
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.red,
title: Text("INSTRUCTIONS"),
centerTitle: true),
body: Column(children: <Widget>[
Container(
child: ListTile(
leading: ClipRRect(
borderRadius: BorderRadius.circular(50),
child: Hero(
tag: widget.nme,
child: Image.asset(widget.img,
fit: BoxFit.cover, width: 100, height: 100))),
title: Text(widget.nme,
style: Theme.of(ct)
.textTheme
.headline3
.copyWith(fontFamily: 'ark', color: Colors.black))),
margin: EdgeInsets.only(top: 40, bottom: 30, left: 20)),
Expanded(
child: ListView.builder(
itemCount: dr.length,
padding: EdgeInsets.all(10),
itemBuilder: (ct, i) {
cb.add(false);
return ListTile(
title: Text(dr[i]),
trailing: Checkbox(
value: cb[i],
onChanged: (v) => setState(() => cb[i] = v)));
})),
]));
}
}