You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
healthcare-frontend/lib/prescriptions/get_quotations_request_list...

61 lines
1.4 KiB

import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:healthcare_user/models/get_quotation_requests_list_model.dart';
class GetQuotationRequestsList extends StatefulWidget {
const GetQuotationRequestsList({Key? key}) : super(key: key);
@override
State<GetQuotationRequestsList> createState() => _GetQuotationRequestsListState();
}
class _GetQuotationRequestsListState extends State<GetQuotationRequestsList> {
bool isLoading = false;
bool isSereverIssue = false;
List<GetQuotationsRequsetListModel> quotationRequestsList = [];
Future<void> getAllQuotationRequestsList() async {
isLoading = true;
try {
var resopnse = await AppSettings.getAllQuotationRequests();
setState(() {
quotationRequestsList = ((jsonDecode(resopnse)) as List)
.map((dynamic model) {
return GetQuotationsRequsetListModel.fromJson(model);
}).toList();
isLoading = false;
});
} catch (e) {
setState(() {
isLoading = false;
isSereverIssue = true;
});
}
}
@override
void initState() {
getAllQuotationRequestsList();
super.initState();
}
Widget renderUi(){
return Container();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Quotation Requests'),
body: renderUi(),
);
}
}