brianegan / flutter_architecture_samples

TodoMVC for Flutter
http://fluttersamples.com/
BSD 3-Clause "New" or "Revised" License
8.75k stars 1.71k forks source link

error while running bloc_flutter #70

Closed juliocbcotta closed 4 years ago

juliocbcotta commented 6 years ago

running flutter run --debug in the folder example/bloc_flutter I am getting this output:

Installing build/app/outputs/apk/app.apk...                  2,2s
E/flutter ( 8583): [ERROR:flutter/shell/common/shell.cc(181)] Dart Error: Unhandled exception:
E/flutter ( 8583): NoSuchMethodError: The getter 'updateTodo' was called on null.
E/flutter ( 8583): Receiver: null
E/flutter ( 8583): Tried calling: updateTodo
E/flutter ( 8583): #0      Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:48:5)
E/flutter ( 8583): #1      new TodosListBloc (package:blocs/src/todos_list_bloc.dart:52:53)
E/flutter ( 8583): #2      main (file:///Users/juliocotta/git/flutter_architecture_samples/example/bloc_flutter/lib/main.dart:27:13)
E/flutter ( 8583): #3      _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:289:19)
E/flutter ( 8583): #4      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
Syncing files to device Android SDK built for x86...         4,1s

Should I be running it in a different way?

brianegan commented 6 years ago

Hey there -- sorry about that. I really need to add complete directions to that sample. The bloc examples have two different options:

Local Storage w/ SharedPrefs

flutter run --debug -t lib/main_local_storage.dart

Firebase Version

flutter run --debug -t lib/main_firebase.dart
juliocbcotta commented 6 years ago

How about to have a default value and allow to override it when the parameters are given? This would allow a standard run.

brianegan commented 4 years ago

Good call -- fixed now!