12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import 'package:flutter/material.dart';
- import 'dart:convert';
- import 'package:hello/Offices.dart';
- import 'package:hello/appointments.dart';
- import 'package:flutter/foundation.dart';
-
-
- class OfficesScreen extends StatelessWidget {
- final List<Offices> off;
- Offices ofi;
- // final Offices Of;
- // final offlist = List<Offices>.generate(
- // 2,
- // (i) => Offices(
- // 'Office $i',
- // docs[i], spec[i], addrs[i],
- // ),
- // );
-
- var docs = ["Collazo", "Albizu"];
- var spec = ["General", "Pediatra"];
- var addrs = ["Bo. Montellano, Cayey", "Las Dalias, Mayagüez"];
-
- //requiring the list of todos
- OfficesScreen({Key key, @required this.off}) : super(key: key);
-
- @override
- Widget build(BuildContext context) {
- // print(docs[0]);
-
- final offlist = List<Offices>.generate(
- 2,
- (i) => Offices(
- 'Office $i',
- // "sds", "gfdf", "fvfgv",
- docs[i], spec[i], addrs[i]
- ),
- );
- print(ofi.variable);
- return Scaffold(
-
- appBar: AppBar(
- title: Text('Todos'),
- ),
- //passing in the ListView.builder
- body: ListView.builder(
- itemCount: offlist.length,
- itemBuilder: (context, index) {
- return ListTile(
- title: Text(offlist[index].office),
- onTap: (){
- Navigator.push(context, MaterialPageRoute(builder: (context) =>
- AppointmentPage(O: offlist[index])),
- );
- },
- );
- },
- ),
- );
- }
- }
|