import 'package:intl/intl.dart'; class AllProblemsModel { String problem=''; String audio=''; String description=''; String video=''; String date=''; String problemId=''; List picture = []; String image=''; bool isAudioButtonEnabled=false; DateTime dateForFilter=new DateTime.now(); String dateNew=''; AllProblemsModel(); factory AllProblemsModel.fromJson(Map json){ AllProblemsModel rtvm = new AllProblemsModel(); rtvm.problem = json['name'] ?? ''; rtvm.audio = json['audio'] ?? ''; rtvm.description = json['description'] ?? ''; rtvm.video = json['video'] ?? ''; rtvm.date = json['date'] ?? ''; rtvm.dateForFilter = DateFormat('dd-MM-yyyy').parse(rtvm.date); rtvm.problemId = json['reportId'] ?? ''; rtvm.picture = json['picture'] ?? []; rtvm.image=json['picture'][0]['url']??''; return rtvm; } }