since last night I’ve been having the problem that my Flutter project can no longer be built because I’m getting compile errors in IntelliJ.
My code looks as follows
class GuestBookingDetailController extends GetxController {
final loading = true.obs;
final storage = GetStorage();
final guestBookingService = GuestBookingService();
final localStorageService = LocalStorageService();
final RxInt selectedIndex = 0.obs;
final booking = Rxn<BookingDto>();
@override
void onInit() {
super.onInit();
fetchBooking();
}
void logout() {
storage.remove('accessToken');
storage.remove('refreshToken');
Get.offAllNamed('/guest/login');
}
void fetchBooking() async {
final guestNumber = localStorageService.getUsername();
loading.value = true;
try {
final result = await guestBookingService.fetchBooking(guestNumber: guestNumber);
if (result.isSuccess) {
booking.value = result.data;
}
} finally {
loading.value = false;
}
}
}
I declare and initialize the variable
final loading = true.obs;
Further down, I assign new values to the variable.
loading.value = true;
Exactly at this point and further down, I’m getting the error for all GetX variables.
There isn't a setter named 'value' in class 'RxObjectMixin'.
I performed the following steps to try to resolve the issue, but unfortunately without success:
- Cleared IntelliJ cache
- Ran flutter upgrade
- Ran flutter clean and flutter pub get
- Flutter downgrade
- Checked out the project again
Unfortunately, none of these steps were able to solve the problem.
The issue just appeared out of nowhere — I was developing, and it suddenly happened last night.
My pubspec.yaml looks as follows:
name: booking_manager_app
description: "A new Flutter project."
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ^3.5.4
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
cupertino_icons: ^1.0.8
get: ^4.7.2
dio: ^5.8.0+1
app_links: ^6.4.0
get_storage: ^2.1.1
jwt_decoder: ^2.0.1
image_picker: ^1.1.2
intl: ^0.20.2
table_calendar: ^3.2.0
signature: ^6.3.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
flutter:
uses-material-design: true
assets:
- assets/images/room.png
Does anyone have an idea what could be causing this or know of a possible solution? I really don’t want to have to throw the project away and start developing it all over again.
set xvalue(T val) { if (subject.isClosed) return; sentToStream = false; if (_value == val && !firstRebuild) return; firstRebuild = false; _value = val; sentToStream = true; subject.add(_value); }set xvalue(? hmmm, whyx? are you sure you did not touch it by mistake? to fix it i would just remove the whole folder<pub_root>/get-4.7.2and reinstallgetxsignalsandstate_beaconvery handy for providing reactive data