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

discontinued
PlatformLinuxWindows

Discord Rich Presence for Flutter & Dart apps & games. Updated ffi version.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:discord_rpc/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/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('discord_rpc'),
        ),
        body: Center(
          child: Text('Open Discord to see the plugin working.'),
        ),
      ),
    );
  }
}
1
likes
130
pub points
60%
popularity

Publisher

unverified uploader

Discord Rich Presence for Flutter & Dart apps & games. Updated ffi version.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

ffi, path

More

Packages that depend on discord_rpc