'flutter type 'Rx<DateTime>' is not a subtype of type 'DateTime' in type cast

I want to use a DateTime variable in getx and use selectedDate in otherPage as variable in Condition my Controller code :

class HomeController extends GetxController {
  RxBool getMyPerm = false.obs;
  Rx<DateTime> selectedDate = DateTime.now().obs;
  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    selectedDate =
        DateTime(selectedDate.year, selectedDate.month, selectedDate.day);
  }
}

but flutter show me this error : type Rx< DateTime> is not a subtype of type 'DateTime' in type cast



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source