0
votes

Here is my terminal error:

Error: MissingPluginException(No implementation found for method authorize on channel com.roughike/flutter_twitter_login) at Object.throw_ [as throw] (http://localhost:62884/dart_sdk.js:4463:11) at MethodChannel._invokeMethod (http://localhost:62884/packages/flutter/src/services/platform_channel.dart.lib.js:409:21) at _invokeMethod.next () at http://localhost:62884/dart_sdk.js:37175:33 at _RootZone.runUnary (http://localhost:62884/dart_sdk.js:37029:58) at _FutureListener.thenAwait.handleValue (http://localhost:62884/dart_sdk.js:32116:29) at handleValueCallback (http://localhost:62884/dart_sdk.js:32663:49) at Function._propagateToListeners (http://localhost:62884/dart_sdk.js:32701:17) at _Future.new.[_completeWithValue] (http://localhost:62884/dart_sdk.js:32544:23) at async._AsyncCallbackEntry.new.callback (http://localhost:62884/dart_sdk.js:32566:35) at Object._microtaskLoop (http://localhost:62884/dart_sdk.js:37290:13) at _startMicrotaskLoop (http://localhost:62884/dart_sdk.js:37296:13) at http://localhost:62884/dart_sdk.js:32918:

Here is my Twitter Button Code:

import 'package:flutter/material.dart';
import 'package:flutter_twitter/flutter_twitter.dart';

class TwitterSignInButton extends StatelessWidget {
  void _signInTwitter() async {
    var twitterLogin = new TwitterLogin(
      consumerKey: 'DNgiahPDsqjROp8Ke',
      consumerSecret: 'mQU1gCPuOnrCrym431ltSP',
    );

    final TwitterLoginResult result = await twitterLogin.authorize();

    switch (result.status) {
      case TwitterLoginStatus.loggedIn:
        var session = result.session;
        print('successful sign in: ${session.username}');
// _sendTokenAndSecretToServer(session.token, session.secret);
        break;
      case TwitterLoginStatus.cancelledByUser:
// _showCancelMessage();
        print('cancelled by user');
        break;
      case TwitterLoginStatus.error:
        print(result.errorMessage);
        break;
    }
  }

  @override
  Widget build(BuildContext context) {
    return Center(
      child: ClipRRect(
        borderRadius: BorderRadius.circular(5.0),
        child: Stack(
          children: [
            Container(
              height: 50,
              width: 410,
              child: RaisedButton(
                onPressed: _signInTwitter,
                elevation: 16,
                color: Colors.blue,
                shape: new RoundedRectangleBorder(
                    borderRadius: new BorderRadius.circular(6)),
                padding: EdgeInsets.all(4),
                child: Text(
                  'Continue With Twitter',
                  style: TextStyle(
                    fontSize: 16,
                    color: Colors.white,
                    letterSpacing: .5,
                    fontFamily: 'Montserrat Bold',
                  ),
                ),
              ),
            ),
            Padding(
              padding: const EdgeInsets.all(13),
              child: Image.asset('assets/TwitterLogo.png'),
            ),
          ],
        ),
      ),
    );
  }
}

1

1 Answers

0
votes

I am new to Flutter and did not take the time to configure ios integration and the flutter api tokens. I simply followed the package installation guide It was straightforward after that. I also switched to native development instead of FLutter Web due to the lack of community package support and implementation practices for Flutter Web.