This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'package:dio/dio.dart'; | |
import '../../Globales/BaseUrl.dart'; | |
import '../modules/livres/models/livres.dart'; | |
class LivreServices { | |
Future<List<Livres>>? getListLivresByAuteurs(List<String> idAuteurs) async { | |
List<Livres> lstLivres = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
void main() { | |
var response ='{"statut":"OK","msg":"liste des livres en base","object":[{"id":2,"titre":"Bataille pour la jeunesse","couvertureNameFile":"Couverture.jpg","livreNameFile":"Bataille pour la jeunesse.pdf","telechargement":0,"auteur":{"id":1,"name":"GBILE AKANNI"}}]}'; | |
var jsonresponse=json.decode(response); | |
print (jsonresponse["object"]); | |
List<Livres> p=(jsonresponse["object"] as List<dynamic>).map(((e)=>livresFromJson(e) as Livres)).toList(); | |
print(p); | |
} | |
class Auteur { |