Search packages, repositories and app categories

GitHub repositoryoptimist-dev/vk_bridge

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.

vk_bridge project cover
Stars
17
Forks
8
Last push (UTC)
Aug 5, 2024
Project status
Active

Original README

English project snapshot. Visit GitHub 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
Optimist GitHub avatar
GitHub author

Optimist ↗

LanguagesDartHTMLJavaScript

Categories

Packages published by this repository

Dependencies used

Dependency list 8 items

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗