import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:job_app/config/palette.dart'; import 'package:job_app/models/employmentoffer.dart'; import 'package:job_app/models/wishlist.dart'; import 'package:job_app/singletons/wishlist.dart'; import 'package:job_app/widgets/employment_offer_card.dart'; import 'package:provider/provider.dart'; class Wishlist extends StatefulWidget { Wishlist({Key key}) : super(key: key); @override _WishlistState createState() => _WishlistState(); } class _WishlistState extends State { WishListModel wishlist= wishlistSingleTons.wishlist; List employmentOffers =[]; @override Widget build(BuildContext context) { employmentOffers =wishlist.offer; return Scaffold( backgroundColor: Palette.backgroundColor, body: Padding( padding: EdgeInsets.fromLTRB(20, 30, 20, 0), child: ChangeNotifierProvider.value( value: WishlistSingleTons(), child: Consumer( builder: (context,data,child)=>Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.start, children: [ IconButton( onPressed: () { Navigator.pop(context); }, icon: SvgPicture.asset( "assets/icons/arrow_left.svg", height: 20, color: Colors.black, )), SizedBox(width: 60,), Row( children: [ Text( "Your wishlist", style: TextStyle(fontFamily: 'Montserrat', fontSize: 22), ), SizedBox(width: 12,), Container( width: 25, height: 25, decoration: BoxDecoration( color: Palette.primary, borderRadius: BorderRadius.circular(100) ), child: Center(child: Text(data.wishlist.count.toString(),style: TextStyle( fontFamily: 'MontserratExtraLight', fontWeight: FontWeight.bold, fontSize: 16, color: Colors.white ),)), ), ], ), ], ), Expanded( child: ListView.builder( itemCount: data.wishlist.offer.length, itemBuilder: (context,index){ return EmploymentOfferCard(offerIndex: index,passedOffers: employmentOffers,); }, ), ), ], ), ), ), ), ); } }