twitter_kit 0.0.1 copy "twitter_kit: ^0.0.1" to clipboard
twitter_kit: ^0.0.1 copied to clipboard

outdated

Project to make it easier to access the Twitter API. Referring to the Twitter kit for Android.

example/lib/main.dart

import 'dart:async';
import 'dart:convert';

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

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  Tweet _tweet;

  @override
  void initState() {
    super.initState();
    requestShowTweet();
  }

  Future<void> requestShowTweet() async {
    // TODO Your key.
    await Twitter("", "", "", "")
        .statusesService
        .show(
          "1242645624106807297",
          true,
          true,
          true,
        )
        .then((response) {
      if (response.isSuccessful) {
        setState(() {
          _tweet = response.body;
        });
      } else {
        print(response.error);
      }
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text(_tweet != null ? jsonEncode(_tweet.toJson()) : "ready"),
        ),
      ),
    );
  }
}
2
likes
0
pub points
0%
popularity

Publisher

verified publisherkitproject.info

Project to make it easier to access the Twitter API. Referring to the Twitter kit for Android.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

chopper, flutter, json_annotation, oauth1

More

Packages that depend on twitter_kit