MockFacebookLoginChannel class

Replaces platform channel responses to requests from flutter_facebook_login.dart in the flutter_facebook_login package.

Instantiate this by calling

MockFacebookLoginChannel();

There are static members that can be set prior to authentication that will affect the behavior of this mock. You can override the responses by providing your own json data (logIn and getCurrentToken), as well as enabling extra debugging and assertions by setting

throwOnUnhandledChannelMessages = true|false

See also static String members

MockFacebookLoginChannel.loginResponse

and

MockFacebookLoginChannel.getCurrentAccessTokenResponse

documentation for more information. In VSCode, just hover over any declaration of either to get more information.

Constructors

MockFacebookLoginChannel()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Static Properties

currentAccessTokenResponse Map
NOTE: NOT YET IMPLEMENTED The facebook auth plugin calls this method, but there is no test to trigger it yet. If you have a test case that can trigger this, please share it with a merge request and/or an issue. [...]
read / write
loginResponse Map
change this to override the response to a "logIn" request from facebook The default is (from json) [...]
read / write
throwOnEveryChannelMessage Exception
When set to an exception, this will throw the specified exception. This is useful for testing boilerplate try/catch code in tests for coverage and correctness. [...]
read / write
throwOnUnhandledChannelMessages bool
When set to true it will throw when channel calls are not handled. If this happens, it means that a call that was made to the mocked platform channel was unhandled and needs to be implemented in. Defaults to false.
read / write

Static Methods

resetCurrentAccessTokenResponse() → void
This will set the currentAccessTokenResponse map to default values.
resetLoginResponse() → void
This will reset the loginResponse to default values.

Constants

platformChannelName → const String
'com.roughike/flutter_facebook_login'