dart_discord_rpc 0.0.2 copy "dart_discord_rpc: ^0.0.2" to clipboard
dart_discord_rpc: ^0.0.2 copied to clipboard

Discord Rich Presence for Flutter & Dart apps & games.

example/lib/main.dart

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

void main() {
  DiscordRPC.initialize();
  runApp(MyApp());
}

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

class _MyAppState extends State<MyApp> {
  DiscordRPC discord = DiscordRPC(
    applicationId: '877853131025809438',
  );

  @override
  void initState() {
    super.initState();
    discord.start(autoRegister: true);
    discord.updatePresence(
      DiscordPresence(
        state: 'Discord Rich Presence from Dart. 🎯',
        details: 'github.com/alexmercerind/dart_discord_rpc',
        startTimeStamp: DateTime.now().millisecondsSinceEpoch,
        largeImageKey: 'large_image',
        largeImageText: 'This text describes the large image.',
        smallImageKey: 'small_image',
        smallImageText: 'This text describes the small image.',
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('dart_discord_rpc'),
        ),
        body: Center(
          child: Text('Open Discord to see the plugin working.'),
        ),
      ),
    );
  }
}
14
likes
150
pub points
37%
popularity

Publisher

unverified uploader

Discord Rich Presence for Flutter & Dart apps & games.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

dart_discord_rpc_ffi, flutter, path

More

Packages that depend on dart_discord_rpc