import 'package:flutter/cupertino.dart'; import 'package:provider/provider.dart'; import 'package:flutter/material.dart'; import 'package:teso/Classes/API%20Clasess/CouponDetails.dart'; import 'package:teso/providers/user_provider.dart'; class RedeemingCoupon extends StatefulWidget { final CouponDetails couponDetails; const RedeemingCoupon({Key key, @required this.couponDetails}) : super(key: key); @override _RedeemingCouponState createState() => _RedeemingCouponState(); } class _RedeemingCouponState extends State { @override void initState() { super.initState(); Provider.of(context, listen: false) .redeemCoupon(widget.couponDetails, context); } @override Widget build(BuildContext context) { return Scaffold( body: Center( child: Container( width: 200, height: 200, child: Column( children: [ Container( child: CupertinoActivityIndicator( animating: true, radius: 15, ), ), Container( child: Text("Please wait, redeeming coupon!!"), ), ], ), ), ), ); } }