skip to Main Content

Widget Test – "MethodChannelFirebase.channel" the getter channel isn't defined for the type MethodChannelFirebase. What is the current best practice?

Previously I used the following code to ensure Firebase was initialised ... typedef Callback = void Function(MethodCall call); void setupFirebaseAuthMocks([Callback? customHandlers]) { TestWidgetsFlutterBinding.ensureInitialized(); setupFirebaseCoreMocks(); ///todo fix this MethodChannelFirebase.channel.setMockMethodCallHandler((call) async { if (call.method == 'Firebase#initializeCore') { return [ { 'name': defaultFirebaseAppName,…

VIEW QUESTION

how to mock Supabase with Flutter for unit testing?

I'm trying to do unit test with Supabase in Flutter like the code bellow: import 'package:bloc_test/bloc_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:supabase_flutter/supabase_flutter.dart'; class TestMClass { SupabaseClient client; TestMClass({ required this.client, }); Future<AuthResponse> signinMc() async { final respnse = await client.auth…

VIEW QUESTION
Back To Top
Search