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 when running the project #1

Closed
rossheat opened this issue Nov 6, 2019 · 3 comments
Closed

Error when running the project #1

rossheat opened this issue Nov 6, 2019 · 3 comments

Comments

@rossheat
Copy link

rossheat commented Nov 6, 2019

I have completed all of the outlined setup steps. When I run flutter run -d all, I get the following terminal out which displays multiple errors:

`rossheaton@Rosss-MacBook-Pro fmovies % flutter run -d all
Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts,
consider enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle... 0.9s
Resolving dependencies... 2.6s

Compiler message:
lib/src/features/favorites/domain/favorite_movies_bloc.dart:46:22: Error: Getter not found: 'currentState'.
List.from((currentState as FavoriteMoviesLoaded).movies)
^^^^^^^^^^^^
lib/src/features/favorites/domain/favorite_movies_bloc.dart:52:15: Error: Getter not found: 'currentState'.
yield currentState;
^^^^^^^^^^^^
lib/src/features/favorites/domain/favorite_movies_bloc.dart:54:13: Error: Getter not found: 'currentState'.
yield currentState;
^^^^^^^^^^^^
lib/src/features/favorites/domain/favorite_movies_bloc.dart:46:22: Error: The getter 'currentState' isn't defined for the class 'FavoriteMoviesBloc'.

  • 'FavoriteMoviesBloc' is from 'package:fmovies/src/features/favorites/domain/favorite_movies_bloc.dart' ('lib/src/features/favorites/domain/favorite_movies_bloc.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'currentState'.
    List.from((currentState as FavoriteMoviesLoaded).movies)
    ^^^^^^^^^^^^
    lib/src/features/favorites/domain/favorite_movies_bloc.dart:52:15: Error: The getter 'currentState' isn't defined for the class 'FavoriteMoviesBloc'.
  • 'FavoriteMoviesBloc' is from 'package:fmovies/src/features/favorites/domain/favorite_movies_bloc.dart' ('lib/src/features/favorites/domain/favorite_movies_bloc.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'currentState'.
    yield currentState;
    ^^^^^^^^^^^^
    lib/src/features/favorites/domain/favorite_movies_bloc.dart:54:13: Error: The getter 'currentState' isn't defined for the class 'FavoriteMoviesBloc'.
  • 'FavoriteMoviesBloc' is from 'package:fmovies/src/features/favorites/domain/favorite_movies_bloc.dart' ('lib/src/features/favorites/domain/favorite_movies_bloc.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'currentState'.
    yield currentState;
    ^^^^^^^^^^^^
    lib/src/features/home/domain/tab_bloc.dart:16:34: Error: Getter not found: 'currentState'.
    final AppTab currentTab = (currentState as ChangeTabState).activeTab;
    ^^^^^^^^^^^^
    lib/src/features/home/domain/tab_bloc.dart:16:34: Error: The getter 'currentState' isn't defined for the class 'TabBloc'.
  • 'TabBloc' is from 'package:fmovies/src/features/home/domain/tab_bloc.dart' ('lib/src/features/home/domain/tab_bloc.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'currentState'.
    final AppTab currentTab = (currentState as ChangeTabState).activeTab;
    ^^^^^^^^^^^^
    lib/src/features/popular/domain/popular_movies_bloc.dart:42:11: Error: Getter not found: 'currentState'.
    if (currentState is PopularMoviesLoaded) {
    ^^^^^^^^^^^^
    lib/src/features/popular/domain/popular_movies_bloc.dart:44:14: Error: Getter not found: 'currentState'.
    (currentState as PopularMoviesLoaded).movies.toList();
    ^^^^^^^^^^^^
    lib/src/features/popular/domain/popular_movies_bloc.dart:42:11: Error: The getter 'currentState' isn't defined for the class 'PopularMoviesBloc'.
  • 'PopularMoviesBloc' is from 'package:fmovies/src/features/popular/domain/popular_movies_bloc.dart' ('lib/src/features/popular/domain/popular_movies_bloc.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'currentState'.
    if (currentState is PopularMoviesLoaded) {
    ^^^^^^^^^^^^
    lib/src/features/popular/domain/popular_movies_bloc.dart:44:14: Error: The getter 'currentState' isn't defined for the class 'PopularMoviesBloc'.
  • 'PopularMoviesBloc' is from 'package:fmovies/src/features/popular/domain/popular_movies_bloc.dart' ('lib/src/features/popular/domain/popular_movies_bloc.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'currentState'.
    (currentState as PopularMoviesLoaded).movies.toList();
    ^^^^^^^^^^^^
    lib/src/features/popular/domain/popular_movies_bloc.dart:74:11: Error: Getter not found: 'currentState'.
    if (currentState is PopularMoviesLoaded) {
    ^^^^^^^^^^^^
    lib/src/features/popular/domain/popular_movies_bloc.dart:75:24: Error: Getter not found: 'currentState'.
    updatedList = (currentState as PopularMoviesLoaded).movies.map((movie) {
    ^^^^^^^^^^^^
    lib/src/features/popular/domain/popular_movies_bloc.dart:81:13: Error: Getter not found: 'currentState'.
    yield currentState;
    ^^^^^^^^^^^^
    lib/src/features/popular/domain/popular_movies_bloc.dart:74:11: Error: The getter 'currentState' isn't defined for the class 'PopularMoviesBloc'.
  • 'PopularMoviesBloc' is from 'package:fmovies/src/features/popular/domain/popular_movies_bloc.dart' ('lib/src/features/popular/domain/popular_movies_bloc.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'currentState'.
    if (currentState is PopularMoviesLoaded) {
    ^^^^^^^^^^^^
    lib/src/features/popular/domain/popular_movies_bloc.dart:75:24: Error: The getter 'currentState' isn't defined for the class 'PopularMoviesBloc'.
  • 'PopularMoviesBloc' is from 'package:fmovies/src/features/popular/domain/popular_movies_bloc.dart' ('lib/src/features/popular/domain/popular_movies_bloc.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'currentState'.
    updatedList = (currentState as PopularMoviesLoaded).movies.map((movie) {
    ^^^^^^^^^^^^
    lib/src/features/popular/domain/popular_movies_bloc.dart:81:13: Error: The getter 'currentState' isn't defined for the class 'PopularMoviesBloc'.
  • 'PopularMoviesBloc' is from 'package:fmovies/src/features/popular/domain/popular_movies_bloc.dart' ('lib/src/features/popular/domain/popular_movies_bloc.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'currentState'.
    yield currentState;
    ^^^^^^^^^^^^
    lib/src/features/home/presentation/home_page.dart:36:42: Error: The method 'dispatch' isn't defined for the class 'TabBloc'.
  • 'TabBloc' is from 'package:fmovies/src/features/home/domain/tab_bloc.dart' ('lib/src/features/home/domain/tab_bloc.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'dispatch'.
    onTabSelected: (tab) => bloc.dispatch(UpdateTab(tab)),
    ^^^^^^^^
    lib/src/features/cinemas/presentation/cinemas_page.dart:90:12: Error: The method 'dispatch' isn't defined for the class 'CinemasBloc'.
  • 'CinemasBloc' is from 'package:fmovies/src/features/cinemas/domain/cinemas_bloc.dart' ('lib/src/features/cinemas/domain/cinemas_bloc.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'dispatch'.
    bloc.dispatch(FetchCinemas(position));
    ^^^^^^^^
    lib/src/features/cinemas/presentation/cinemas_page.dart:92:12: Error: The method 'dispatch' isn't defined for the class 'CinemasBloc'.
  • 'CinemasBloc' is from 'package:fmovies/src/features/cinemas/domain/cinemas_bloc.dart' ('lib/src/features/cinemas/domain/cinemas_bloc.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'dispatch'.
    bloc.dispatch(CannotFetchLocation());
    ^^^^^^^^
    lib/src/features/favorites/presentation/favorite_movies_page.dart:13:10: Error: The method 'dispatch' isn't defined for the class 'FavoriteMoviesBloc'.
  • 'FavoriteMoviesBloc' is from 'package:fmovies/src/features/favorites/domain/favorite_movies_bloc.dart' ('lib/src/features/favorites/domain/favorite_movies_bloc.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'dispatch'.
    bloc.dispatch(GetFavoriteMovies());
    ^^^^^^^^
    lib/src/features/popular/presentation/popular_movies_page.dart:18:23: Error: The method 'dispatch' isn't defined for the class 'PopularMoviesBloc'.
  • 'PopularMoviesBloc' is from 'package:fmovies/src/features/popular/domain/popular_movies_bloc.dart' ('lib/src/features/popular/domain/popular_movies_bloc.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'dispatch'.
    popularMoviesBloc.dispatch(FetchPopularMovies());
    ^^^^^^^^
    lib/src/features/popular/presentation/popular_movies_page.dart:35:25: Error: The method 'dispatch' isn't defined for the class 'TabBloc'.
  • 'TabBloc' is from 'package:fmovies/src/features/home/domain/tab_bloc.dart' ('lib/src/features/home/domain/tab_bloc.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'dispatch'.
    tabBloc.dispatch(MovieSavedToFavorites(true));
    ^^^^^^^^
    lib/src/features/popular/presentation/popular_movies_page.dart:58:41: Error: The method 'dispatch' isn't defined for the class 'PopularMoviesBloc'.
  • 'PopularMoviesBloc' is from 'package:fmovies/src/features/popular/domain/popular_movies_bloc.dart' ('lib/src/features/popular/domain/popular_movies_bloc.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'dispatch'.
    popularMoviesBloc.dispatch(FetchPopularMovies()),
    ^^^^^^^^
    lib/src/features/favorites/presentation/favorite_movies_list.dart:189:16: Error: The method 'dispatch' isn't defined for the class 'FavoriteMoviesBloc'.
  • 'FavoriteMoviesBloc' is from 'package:fmovies/src/features/favorites/domain/favorite_movies_bloc.dart' ('lib/src/features/favorites/domain/favorite_movies_bloc.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'dispatch'.
    bloc.dispatch(DeleteFavoriteMovie(movie: movie));
    ^^^^^^^^
    lib/src/features/popular/presentation/popular_movies_list.dart:63:12: Error: The method 'dispatch' isn't defined for the class 'PopularMoviesBloc'.
  • 'PopularMoviesBloc' is from 'package:fmovies/src/features/popular/domain/popular_movies_bloc.dart' ('lib/src/features/popular/domain/popular_movies_bloc.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'dispatch'.
    bloc.dispatch(FetchPopularMovies());
    ^^^^^^^^
    lib/src/features/popular/presentation/popular_movies_list.dart:111:37: Error: The method 'dispatch' isn't defined for the class 'PopularMoviesBloc'.
  • 'PopularMoviesBloc' is from 'package:fmovies/src/features/popular/domain/popular_movies_bloc.dart' ('lib/src/features/popular/domain/popular_movies_bloc.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'dispatch'.
    onTap: () => bloc.dispatch(SavePopularMovie(movie)),
    ^^^^^^^^
    lib/src/features/movie/presentation/movie_details.dart:27:10: Error: The method 'dispatch' isn't defined for the class 'MovieDetailsBloc'.
  • 'MovieDetailsBloc' is from 'package:fmovies/src/features/movie/domain/movie_details_bloc.dart' ('lib/src/features/movie/domain/movie_details_bloc.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'dispatch'.
    bloc.dispatch(FetchMovieDetails(movie));
    ^^^^^^^^
    lib/src/features/movie/presentation/movie_details.dart:28:10: Error: The method 'dispatch' isn't defined for the class 'MovieDetailsBloc'.
  • 'MovieDetailsBloc' is from 'package:fmovies/src/features/movie/domain/movie_details_bloc.dart' ('lib/src/features/movie/domain/movie_details_bloc.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'dispatch'.
    bloc.dispatch(FetchMovieCredits(movie));
    ^^^^^^^^
    Compiler failed on /Users/rossheaton/Documents/development/flutter/fmovies/lib/main.dart
    Running Gradle task 'assembleDebug'...
    Running Gradle task 'assembleDebug'... Done 10.8s
    Gradle task assembleDebug failed with exit code 1`
@n1k3c
Copy link
Contributor

n1k3c commented Nov 6, 2019

@rossalanheaton try to upgrade Flutter to the latest version (flutter upgrade). Also, make sure that you have everything installed (flutter doctor -v).

@rossheat
Copy link
Author

rossheat commented Nov 6, 2019

Updated everything and same problem stills persists. It has a problem with .dispatch.

@n1k3c
Copy link
Contributor

n1k3c commented Nov 6, 2019

@rossalanheaton Make sure that you are using a 0.21.0 version of theflutter_bloc package. dispatch is deprecated in the newer version (with add).

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

3 participants