Issue 1:
https://codelabs.developers.google.com/codelabs/first-flutter-app-pt2/#0 has lots of new keyword. It can be removed since newer Dart versions don't require it :)

Issue 2:
I have a Flutter/Firebase application that works on an Android emulator, but not on a real device (HTC 10 with Android 8.0). It fails with a NullPointerException from inside the Firebase auth code, but the stack trace doesn't include the location in my app's code where the call originated from.

Launching lib/main.dart on HTC6545LVW in debug mode...
Initializing gradle...
Resolving dependencies...
Running 'gradlew assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...
I/FlutterActivityDelegate(18602): onResume setting current activity to this
W/zygote64(18602): Skipping duplicate class check due to unrecognized classloader
W/DynamiteModule(18602): Local module descriptor class for com.google.firebase.auth not found.
W/BiChannelGoogleApi(18602): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzal@d8cd9dc
W/DynamiteModule(18602): Local module descriptor class for com.google.firebase.auth not found.
I/FirebaseAuth(18602): [FirebaseAuth:] Loading module via FirebaseOptions.
I/FirebaseAuth(18602): [FirebaseAuth:] Preparing to create service connection to gms implementation
D/SQLiteConnection(18602): DB info: open connection, path: /data/user/0/com.example.something/databases/google_app_measurement_local.db, handle: 0x735654f600, flag: 0x6, FH handler: 0x73494ae600, count: 1
D/SQLiteConnection(18602): DB info: close connection, path: /data/user/0/com.example.something/databases/google_app_measurement_local.db, handle: 0x735654f600, FH handler: 0x73494ae600, count: 0
Syncing files to device HTC6545LVW...
D/SQLiteConnection(18602): DB info: open connection, path: /data/user/0/com.example.something/databases/google_app_measurement_local.db, handle: 0x735654f600, flag: 0x6, FH handler: 0x73494ae600, count: 1
D/SQLiteConnection(18602): DB info: close connection, path: /data/user/0/com.example.something/databases/google_app_measurement_local.db, handle: 0x735654f600, FH handler: 0x73494ae600, count: 0
E/StorageHelpers(18602): Failed to turn object into JSON
E/StorageHelpers(18602): java.lang.NullPointerException: Attempt to invoke virtual method 'org.json.JSONObject com.google.firebase.auth.internal.zzm.zzbf()' on a null object reference
E/StorageHelpers(18602):	at com.google.firebase.auth.internal.zzz.zzi(Unknown Source:126)
E/StorageHelpers(18602):	at com.google.firebase.auth.internal.zzz.zzg(Unknown Source:3)
E/StorageHelpers(18602):	at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:28)
E/StorageHelpers(18602):	at com.google.firebase.auth.FirebaseAuth$zza.zza(Unknown Source:12)
E/StorageHelpers(18602):	at com.google.firebase.auth.api.internal.zzbn.zzaa(Unknown Source:15)
E/StorageHelpers(18602):	at com.google.firebase.auth.api.internal.zzcy.zzal(Unknown Source:0)
E/StorageHelpers(18602):	at com.google.firebase.auth.api.internal.zzcy.zza(Unknown Source:0)
E/StorageHelpers(18602):	at com.google.firebase.auth.api.internal.zzdb.zza(Unknown Source:47)
E/StorageHelpers(18602):	at com.google.firebase.auth.api.internal.zzci.dispatchTransaction(Unknown Source:34)
E/StorageHelpers(18602):	at com.google.android.gms.internal.firebase_auth.zzb.onTransact(Unknown Source:22)
E/StorageHelpers(18602):	at android.os.Binder.execTransact(Binder.java:682)
W/Binder (18602): Caught a RuntimeException from the binder stub implementation.
W/Binder (18602): com.google.android.gms.internal.firebase_auth.zzv: java.lang.NullPointerException: Attempt to invoke virtual method 'org.json.JSONObject com.google.firebase.auth.internal.zzm.zzbf()' on a null object reference
W/Binder (18602):	at com.google.firebase.auth.internal.zzz.zzi(Unknown Source:151)
W/Binder (18602):	at com.google.firebase.auth.internal.zzz.zzg(Unknown Source:3)
W/Binder (18602):	at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source:28)
W/Binder (18602):	at com.google.firebase.auth.FirebaseAuth$zza.zza(Unknown Source:12)
W/Binder (18602):	at com.google.firebase.auth.api.internal.zzbn.zzaa(Unknown Source:15)
W/Binder (18602):	at com.google.firebase.auth.api.internal.zzcy.zzal(Unknown Source:0)
W/Binder (18602):	at com.google.firebase.auth.api.internal.zzcy.zza(Unknown Source:0)
W/Binder (18602):	at com.google.firebase.auth.api.internal.zzdb.zza(Unknown Source:47)
W/Binder (18602):	at com.google.firebase.auth.api.internal.zzci.dispatchTransaction(Unknown Source:34)
W/Binder (18602):	at com.google.android.gms.internal.firebase_auth.zzb.onTransact(Unknown Source:22)
W/Binder (18602):	at android.os.Binder.execTransact(Binder.java:682)
W/Binder (18602): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'org.json.JSONObject com.google.firebase.auth.internal.zzm.zzbf()' on a null object reference
W/Binder (18602):	at com.google.firebase.auth.internal.zzz.zzi(Unknown Source:126)
W/Binder (18602):	... 10 more
D/SQLiteConnection(18602): DB info: open connection, path: /data/user/0/com.example.something/databases/google_app_measurement_local.db, handle: 0x735654f600, flag: 0x6, FH handler: 0x73494ae600, count: 1
I/zygote64(18602): Do partial code cache collection, code=29KB, data=22KB
I/zygote64(18602): After code cache collection, code=27KB, data=22KB
I/zygote64(18602): Increasing code cache capacity to 128KB
D/SQLiteConnection(18602): DB info: close connection, path: /data/user/0/com.example.something/databases/google_app_measurement_local.db, handle: 0x735654f600, FH handler: 0x73494ae600, count: 0
D/SQLiteConnection(18602): DB info: open connection, path: /data/user/0/com.example.something/databases/google_app_measurement_local.db, handle: 0x735654f600, flag: 0x6, FH handler: 0x7349511ac0, count: 1
D/SQLiteConnection(18602): DB info: close connection, path: /data/user/0/com.example.something/databases/google_app_measurement_local.db, handle: 0x735654f600, FH handler: 0x7349511ac0, count: 0

Here's the relevant code where I'm calling the anonymous sign in:

Future<Null> main() async {
final FirebaseApp app = FirebaseApp.instance;
_currentUser = await _signInAnonymously();
runApp(new MyApp());
}

Future<FirebaseUser> _signInAnonymously() async {
final user = await _auth.signInAnonymously();
print('User is signed in: $user');
return user;
}

I have no idea why it isn't working on my device. I have Google Play Services and it's updated.

I tried with the basic Flutter app (increment a number when you hit the FAB). I added Firebase Anonymous Auth to it, and no problems. I didn't get the same error. If worked on both the emulator and my device.