andreciornavei / flutter-getx-concept

A flutter project to make use of all concepts of GetX
MIT License
231 stars 86 forks source link

The project is not working now #2

Open ghost opened 3 years ago

ghost commented 3 years ago

Maybe due to the flutter upgrade, the application is not functioning now. The following is the error when trying to run it.

Launching lib/main.dart on Redmi Note 8 Pro in debug mode...
lib/main.dart:1
../../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/get-3.3.0/lib/src/get_main.dart:389:43: Error: No named parameter with the name 'shadowThemeOnly'.
      theme: Theme.of(key.currentContext, shadowThemeOnly: true),
                                          ^^^^^^^^^^^^^^^
../../../snap/flutter/common/flutter/packages/flutter/lib/src/material/theme.dart:106:20: Context: Found this candidate, but the arguments don't match.
  static ThemeData of(BuildContext context) {
                   ^^
3

FAILURE: Build failed with an exception.

* Where:
Script '/home/anoop/snap/flutter/common/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1029

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/anoop/snap/flutter/common/flutter/bin/flutter'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
jhosepharaujo commented 3 years ago

Make the following changes to your models and controllers:

RxInt _quantity = RxInt(); to RxInt _quantity = RxInt(0); or RxInt _quantity = 0.obs;
Rx<ProductModel> _product = Rx<ProductModel>() to Rx<ProductModel> _product = ProductModel().obs
RxString _name = RxString(); to RxString _name = RxString(''); or RxString _name = ''.obs;
RxBool _like = RxBool(); to RxBool _like = RxBool(false); or RxBool _like = false.obs;
Rx<CategoryModel> _selectedCategory = Rx<CategoryModel>(); to Rx<CategoryModel> _selectedCategory = CategoryModel().obs;