Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'dart:convert';
- import 'package:barbershop/selectday_page.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter/services.dart' show rootBundle;
- import 'JsonModel_page.dart';
- // Future<String> localJsonAsset() async {
- // return await rootBundle.loadString('assets/data/example.json');
- // }
- var jsonUrl = 'https://www.pointscard.moeasy.it/jsonUrl.json';
- class PrenotationsPage extends StatefulWidget {
- PrenotationsPage({Key key, this.title}) : super(key: key);
- final String title;
- @override
- _MyPrenotationsPage createState() => _MyPrenotationsPage();
- }
- class _MyPrenotationsPage extends State<PrenotationsPage> {
- @override
- void initState() {
- super.initState();
- }
- ServiceList serviceList = ServiceList.fromRawJson(jsonUrl);
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- home: Scaffold(
- appBar: new AppBar(
- backgroundColor: Colors.transparent,
- elevation: 0,
- title: new Text(
- "SELEZIONA SERVIZI",
- style: TextStyle(
- fontSize: 16.0,
- color: Colors.black,
- fontWeight: FontWeight.bold,
- letterSpacing: 1),
- ),
- centerTitle: true,
- leading: IconButton(
- icon: Icon(Icons.arrow_back),
- color: Colors.black,
- onPressed: () => Navigator.pop(context),
- ),
- ),
- body: Column(
- children: <Widget>[
- ListView.builder(
- shrinkWrap: true,
- padding: const EdgeInsets.all(8.0),
- itemCount: 3,
- itemBuilder: (BuildContext context, int index) {
- return ExpansionTile(
- title: Text("serviceList[index].tipologia"),
- children: <Widget>[
- CheckboxListTile(
- title: Text("serviceList[index].servizi[index].nome"),
- value: false,
- // onChanged: (val) {
- // setState(() {
- // ServiceList().servizio[index].isActive = val;
- // });
- // },
- ),
- ],
- );
- },
- ),
- RaisedButton(
- // SENDING TO BACKEND
- onPressed: () => Navigator.push(
- context,
- MaterialPageRoute(builder: (context) => SelectdayPage()),
- ),
- child: Text("Aventi"),
- ),
- ],
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement