Skip to content
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 right at the beginning (getX-turtorial) "Error: Type 'CounterController' not found" #24

Closed
MrFunkeyfreak opened this issue Apr 19, 2022 · 0 comments

Comments

@MrFunkeyfreak
Copy link

MrFunkeyfreak commented Apr 19, 2022

Hey,

I am trying to learn flutter from your video, but right at the beginning I get this errors:
(in the getX tutorial)

this is a screenshot of the error message

lib/screens/home.dart:6:9: Error: Type 'CounterController' not found.
  final CounterController counterController = Get.put(CounterController());
        ^^^^^^^^^^^^^^^^^
lib/screens/home.dart:6:9: Error: 'CounterController' isn't a type.
  final CounterController counterController = Get.put(CounterController());
        ^^^^^^^^^^^^^^^^^
lib/screens/home.dart:6:55: Error: Method not found: 'CounterController'.
  final CounterController counterController = Get.put(CounterController());
                                                      ^^^^^^^^^^^^^^^^^
lib/screens/home.dart:26:93: Error: Expected ';' after this.
      floatingActionButton: FloatingActionButton(onPressed: () {counterController.increment()},
                                                                                          ^

I have definied the class "CounterController" in the file "counterController.dart".

import 'package:get/get.dart';

class CounterController extends GetxController{
  var counter = 0.obs;

  void increment(){
    counter++;
  }
}

I did everything which is mentioned in the video till 23min.

Can u please check my code and help me? I think it's a simple beginner mistake, but I don't know how to fix it.
I hope u can help me.

https://github.com/MrFunkeyfreak/Flutter-Web-Course

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant