Skip to content

Commit

Permalink
fix missing_return warnings (flutter#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
a14n authored and mravn-google committed Aug 3, 2018
1 parent 0c05cc1 commit ce3a913
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/cloud_firestore/lib/src/firestore.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Firestore {

Firestore({FirebaseApp app}) : this.app = app ?? FirebaseApp.instance {
if (_initialized) return;
channel.setMethodCallHandler((MethodCall call) {
channel.setMethodCallHandler((MethodCall call) async {
if (call.method == 'QuerySnapshot') {
final QuerySnapshot snapshot =
new QuerySnapshot._(call.arguments, this);
Expand Down
1 change: 1 addition & 0 deletions packages/firebase_admob/test/firebase_admob_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void main() {
return new Future<bool>.value(true);
default:
assert(false);
return null;
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_core/test/firebase_core_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void main() {
},
];
default:
break;
return null;
}
});
log.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void main() {
equals(<String, dynamic>{'fakeKey': 'updated fakeValue'}));
expect(
database.reference().child('foo').runTransaction(
(MutableData mutableData) {},
(MutableData mutableData) async => null,
timeout: const Duration(milliseconds: 0),
),
throwsA(isInstanceOf<AssertionError>()),
Expand Down
6 changes: 3 additions & 3 deletions packages/firebase_messaging/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ class _PushMessagingExampleState extends State<PushMessagingExample> {
void initState() {
super.initState();
_firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) {
onMessage: (Map<String, dynamic> message) async {
print("onMessage: $message");
_showItemDialog(message);
},
onLaunch: (Map<String, dynamic> message) {
onLaunch: (Map<String, dynamic> message) async {
print("onLaunch: $message");
_navigateToItemDetail(message);
},
onResume: (Map<String, dynamic> message) {
onResume: (Map<String, dynamic> message) async {
print("onResume: $message");
_navigateToItemDetail(message);
},
Expand Down
6 changes: 3 additions & 3 deletions packages/firebase_messaging/test/firebase_messaging_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ void main() {
final Completer<dynamic> onLaunch = new Completer<dynamic>();
final Completer<dynamic> onResume = new Completer<dynamic>();

firebaseMessaging.configure(onMessage: (dynamic m) {
firebaseMessaging.configure(onMessage: (dynamic m) async {
onMessage.complete(m);
}, onLaunch: (dynamic m) {
}, onLaunch: (dynamic m) async {
onLaunch.complete(m);
}, onResume: (dynamic m) {
}, onResume: (dynamic m) async {
onResume.complete(m);
});
final dynamic handler =
Expand Down
4 changes: 1 addition & 3 deletions packages/firebase_storage/test/firebase_storage_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -275,16 +275,14 @@ void main() {
return <String, String>{
'name': 'image.jpg',
};
break;
case 'StorageReference#updateMetadata':
return <String, dynamic>{
'name': 'image.jpg',
'contentLanguage': 'en',
'customMetadata': <String, String>{'activity': 'test'},
};
break;
default:
break;
return null;
}
});
ref =
Expand Down
2 changes: 1 addition & 1 deletion packages/google_maps_flutter/lib/src/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class GoogleMapController extends ChangeNotifier {
static Future<void> init() async {
await _channel.invokeMethod('init');
_controllers.clear();
_channel.setMethodCallHandler((MethodCall call) {
_channel.setMethodCallHandler((MethodCall call) async {
final int mapId = call.arguments['map'];
final GoogleMapController controller = _controllers[mapId];
if (controller != null) {
Expand Down
2 changes: 1 addition & 1 deletion packages/quick_actions/lib/quick_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class QuickActions {
///
/// Call this once before any further interaction with the the plugin.
void initialize(QuickActionHandler handler) {
_kChannel.setMethodCallHandler((MethodCall call) {
_kChannel.setMethodCallHandler((MethodCall call) async {
assert(call.method == 'launch');
handler(call.arguments);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/share/test/share_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void main() {
setUp(() {
mockChannel = new MockMethodChannel();
// Re-pipe to mockito for easier verifies.
Share.channel.setMockMethodCallHandler((MethodCall call) {
Share.channel.setMockMethodCallHandler((MethodCall call) async {
mockChannel.invokeMethod(call.method, call.arguments);
});
});
Expand Down

0 comments on commit ce3a913

Please sign in to comment.