trakt_dart 1.0.1 copy "trakt_dart: ^1.0.1" to clipboard
trakt_dart: ^1.0.1 copied to clipboard

A Dart client-side API package for the Trakt.tv API, a database on what tv shows and movies everyone is watching.

example/lib/main.dart

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

void main() async {
  runApp(TraktDartApp());
}

// ignore: must_be_immutable
class TraktDartApp extends StatelessWidget {
  late TraktManager traktManager;

  TraktDartApp({Key? key}) : super(key: key) {
    // Replace with your clientId and clientId from Trakt API.
    traktManager = TraktManager(
        clientId: "clientId", clientSecret: "clientId", redirectURI: "");
  }

  Future<List<TrendingMovie>> getTrendingMovies() {
    return traktManager.movies.getTrendingMovies();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Trending Movies'),
        ),
        body: FutureBuilder<List<TrendingMovie>>(
          future: getTrendingMovies(),
          builder: (context, snapshot) {
            if (!snapshot.hasData) {
              return const CircularProgressIndicator();
            }
            final trendingMovies = snapshot.data!;
            return ListView.builder(
              itemCount: trendingMovies.length,
              itemBuilder: (context, index) {
                final movie = trendingMovies[index];
                return Text(movie.movie.title);
              },
            );
          },
        ),
      ),
    );
  }
}
5
likes
110
pub points
28%
popularity

Publisher

verified publisherdamonique.dev

A Dart client-side API package for the Trakt.tv API, a database on what tv shows and movies everyone is watching.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

build_runner, dotenv, flutter, flutter_inappwebview, http, json_annotation, json_serializable, tuple

More

Packages that depend on trakt_dart