vkdart 1.3.6 copy "vkdart: ^1.3.6" to clipboard
vkdart: ^1.3.6 copied to clipboard

Package helps simplify working with the VK API. Completely wraps VK methods, has event support and much more.

example/example.dart

// ignore_for_file: prefer_const_declarations, avoid_dynamic_calls, avoid_print

import 'package:vkdart/vkdart.dart';

void main() async {
  // Group ID is indicated if Longpoll API is used
  // if the fetcher parameter is not specified, Longpoll will be used by default
  final vkdart = VkDart('accessToken', Event(), groupId: 123);

  // Use callback
  // final callback = Callback(
  //  secretKey: 'mySecretKey', // optional
  //  confirmationHandler: (_) async => 'confirimationCode',
  //  );
  // final vkdart = VkDart('accessToken', Event(), fetcher: callback);

  vkdart.onMessage().listen((event) {
    print('new message!');
    print('message text: ${event.object['message']['text']}');
  });

  await vkdart.start().then((_) => print('Longpoll API run!'));

  // use API
  // await vkdart.users.get({'user_id': 'durov'});
}
6
likes
150
points
60
downloads

Publisher

unverified uploader

Weekly Downloads

Package helps simplify working with the VK API. Completely wraps VK methods, has event support and much more.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

dia, dia_body, dio, json_annotation

More

Packages that depend on vkdart