-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in super class #12
Comments
hi vbhsnh did you migrate your app to Null Safety? Please use the migration tool. I started the project without null safety, and then I migrated to it - apologies if that caused you an issue, but the benefits are greater by being on Null Safety. Since Subcategory extends Category and Category is null safe, then both your Category and Subcategory must be null-safe. Let me know if you are encountering other issues after migrating to Null Safety, so I can help you unblock. Thanks for your feedback and your support - i'm here to help!!! |
Your issue is that you're setting the values of the Category class as required and you're not passing the subCategories (it is required). If you still want to keep it this way, then pass some default value to the subcategories constructor parameter, such as (subCategories: []) like the code below:
|
Thanks romanejaquez for your help. "Super" issue got fixed thanks allot for that. Now I have issue in "SelectedCategoryPage" when trying pass item name below error is showing in code. If i mention required modifier i get error in CategoryListPage from where navigation is happening. As suggested by you i will definitely go through null safety. I am new to flutter so troubling you more. |
Hello , thanks for this course its very very useful. i have the same error Performing hot reload...
Syncing files to device iPhone 11 Pro...
lib/pages/selectedcategorypage.dart:50:65: Error: The argument type 'Category' can't be assigned to the parameter type 'SubCategory'.
- 'Category' is from 'package:orilla_fresca/models/category.dart' ('lib/models/category.dart').
- 'SubCategory' is from 'package:orilla_fresca/models/subcategory.dart' ('lib/models/subcategory.dart').
selectedCategory.subCategories[index],
^ |
Make sure you're casting the selectedCategory.subCategories[index] into a SubCategory object, as in: |
is:issue is:open S1E4 video time 1:33...getting error when applying super class.how to remove that error
The text was updated successfully, but these errors were encountered: