123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import 'package:flutter/material.dart';
- import 'dart:convert';
- import 'Offices.dart';
- import '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]
- ),
- );
- 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])),
- );
- },
- );
- },
- ),
- );
- }
- }
|