Search packages, repositories and app categories

Package detailsv2.5.0

vk_bridge

A dart package for working with VK Mini Apps via VK Bridge. Works web, mobile-web

AndroidiOSWebmacOSWindowsLinux
30-day downloads
707
Likes
25
Pub points
130

Install package

flutter pub add vk_bridge

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Dart package that enables integration with VK Mini Apps using the VK Bridge API, facilitating communication between the app and the VK environment. It supports web, mobile-web, and multiple platforms including Android, iOS, macOS, Windows, and Linux. The package simplifies handling VK-specific features such as user data retrieval, theme switching, and navigation within VK's ecosystem. Designed for developers building apps that run inside VK, it ensures seamless interaction with VK’s infrastructure across different environments.

Use cases

  • Integrating with VK Mini Apps
  • Handling VK Bridge events
  • Fetching user data from VK
  • Supporting dark mode in VK apps
  • Navigating within VK context

Key features

  • Cross-platform support
  • VK Bridge event handling
  • User data access
  • Theme mode detection
  • Easy integration with Flutter

Suitable for

  • Flutter developers building VK Mini Apps
  • Apps requiring VK ecosystem integration
  • Projects targeting multiple platforms
  • Developers working with VK's web and mobile environments

Considerations

  • Requires VK Mini Apps environment
  • Limited to VK-specific use cases
  • Depends on VK Bridge availability
  • Not suitable for standalone apps
  • May require additional configuration for web deployment

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

VK Bridge

A package for integrating Flutter VK Mini Apps with official VK clients for iOS, Android and Web.

This package is a wrapper around official VK-Bridge JS package.

Usage

On app start call VKBridge.instance.init() method before runApp to ensure correct VK Bridge initialization.

import 'package:vk_bridge/vk_bridge.dart';

Future<void> main() async {
  await VKBridge.instance.init();

  runApp(MyApp());
}

Add this part of code in your index.html before Flutter part.


<script src="https://unpkg.com/@vkontakte/vk-bridge@2.5.1/dist/browser.min.js"></script>

<script>
    vkBridge.subscribe((event) => {
        if (window.vkBridgeDartListener != null) {
            window.vkBridgeDartListener(event.detail);
        }
    });
</script>

<script src="main.dart.js" type="application/javascript"></script>

To add logger use VKBridge.instance.setLogger().

Original VK Bridge documentation: https://vk.com/dev/vk_bridge_events
Original VK Bridge JS package: https://github.com/VKCOM/vk-bridge

Categories

Dependencies

Dependency list 5 items

Source repository

Projects using this package

No data available yet.