twitter_auth_v2 1.0.2 copy "twitter_auth_v2: ^1.0.2" to clipboard
twitter_auth_v2: ^1.0.2 copied to clipboard

Package for twitter v2 authentication.

Twitter Authentication #

Twitter v2 authentication

Usage #

to /example folder.

void _authentication() async {
    final TwitterAuthClient client = TwitterAuthClient(
        callbackUrlScheme: '[CALLBACK_SCHEME]',
        clientId: '[CLIENT_ID]',
        clientSecret: '[CLIENT_SECRET]',
        navigatorKey: navigatorKey,
        loader: const Center(
          child: CircularProgressIndicator(),
        ),
        redirectUri: '[REDIRECT_URI]');
    TwitterAuthResult? data = await client.login(scopes: Scope.values);
    if (data == null) return;
    setState(() {
      _token = data.accessToken;
      _refreshToken = data.refreshToken;
      _expireIn = data.expiresIn.toString();
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'Access Token: $_token',
            ),
            Text(
              'Refresh Token: $_refreshToken',
            ),
            Text(
              'Expire In: $_expireIn',
            ),
            ElevatedButton(
                onPressed: _authentication, child: const Text('Authentication'))
          ],
        ),
      ),
    );
  }
2
likes
110
pub points
11%
popularity

Publisher

unverified uploader

Package for twitter v2 authentication.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

crypto, flutter, http, webview_flutter

More

Packages that depend on twitter_auth_v2