Pārlūkot izejas kodu

fix: handle pickup gambar attachment jika null

Masarifyuli 1 mēnesi atpakaļ
vecāks
revīzija
6f60055871
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 3 2
      lib/src/layouts/mobile/request_create.dart

+ 3 - 2
lib/src/layouts/mobile/request_create.dart

@@ -637,8 +637,9 @@ class _MobReqCreatePageState extends State<MobReqCreatePage> {
   pickupImageNew() async{
   pickupImageNew() async{
     if(Provider.of<CreateSerModule>(context, listen: false).images().length < 5){
     if(Provider.of<CreateSerModule>(context, listen: false).images().length < 5){
       if (kIsWeb) {
       if (kIsWeb) {
-        var image = await reqFunc.getImageNew(context, ImageSource.gallery);
-        Provider.of<CreateSerModule>(context, listen: false).setImages(image);
+        await reqFunc.getImageNew(context, ImageSource.gallery).then((img){
+          img != null ? Provider.of<CreateSerModule>(context, listen: false).setImages(img) : (){};
+        });
       } else{
       } else{
         showModalBottomSheet<void>(
         showModalBottomSheet<void>(
             context: context,
             context: context,