skip to Main Content

Can we add a null value to a StreamController? (Flutter, Dart)

I want to add a null value to a stream, but it will show an error. When I do: final StreamController<Car?> streamController = StreamController<Car?>.broadcast(); streamController.add(null) I'll get flutter: ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── flutter: │ #0 _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:242:14) flutter: │ #1 CarService.selectCar (package:app/services/car_service.dart:109:39) flutter:…

VIEW QUESTION

Flutter – Convert String to TimeOfDay issue

I'm getting the issue when converting string to TimeOfday. It was working before but now I am getting the issue. try { final format = DateFormat.jm(); //"6:00 AM" TimeOfDay day = TimeOfDay.fromDateTime(format.parse("6:00")); } catch(ex) { PLPrint(name: "CheckTest",value: "${ex.toString()}"); } I…

VIEW QUESTION
Back To Top
Search