├── .github ├── FUNDING.yml └── workflows │ └── dart.yml ├── .gitignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── example ├── .gitignore ├── .metadata ├── README.md ├── lib │ ├── examples_page.dart │ └── main.dart ├── pubspec.lock ├── pubspec.yaml ├── test │ └── widget_test.dart └── web │ ├── favicon.png │ ├── flutter_bootstrap.js │ ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png │ ├── index.html │ └── manifest.json ├── lib ├── src │ ├── bridge │ │ ├── logger.dart │ │ ├── unsupported.dart │ │ ├── vk_bridge.dart │ │ └── vk_bridge_web.dart │ ├── data │ │ └── model │ │ │ ├── errors │ │ │ ├── error_data.dart │ │ │ ├── error_data.g.dart │ │ │ ├── vk_web_app_error.dart │ │ │ └── vk_web_app_error.g.dart │ │ │ ├── events │ │ │ ├── vk_web_app_location_changed │ │ │ │ ├── vk_web_app_location_changed.dart │ │ │ │ └── vk_web_app_location_changed.g.dart │ │ │ ├── vk_web_app_update_config │ │ │ │ ├── appearance.dart │ │ │ │ ├── appearance.g.dart │ │ │ │ ├── insets.dart │ │ │ │ ├── insets.g.dart │ │ │ │ ├── vk_web_app_update_config.dart │ │ │ │ └── vk_web_app_update_config.g.dart │ │ │ └── vk_web_app_view_hide │ │ │ │ ├── vk_web_app_view_hide.dart │ │ │ │ └── vk_web_app_view_hide.g.dart │ │ │ ├── launch_params.dart │ │ │ ├── launch_params.g.dart │ │ │ ├── options │ │ │ ├── allow_messages_from_group_options │ │ │ │ ├── allow_messages_from_group_options.dart │ │ │ │ └── allow_messages_from_group_options.g.dart │ │ │ ├── check_native_ads │ │ │ │ ├── ad_format.dart │ │ │ │ ├── ad_format.g.dart │ │ │ │ ├── check_native_ads_options.dart │ │ │ │ └── check_native_ads_options.g.dart │ │ │ ├── close_options │ │ │ │ ├── close_options.dart │ │ │ │ └── close_options.g.dart │ │ │ ├── copy_text_options │ │ │ │ ├── copy_text_options.dart │ │ │ │ └── copy_text_options.g.dart │ │ │ ├── donut_is_don_options │ │ │ │ ├── donut_is_don_options.dart │ │ │ │ ├── donut_is_don_options.g.dart │ │ │ │ ├── donut_is_don_params.dart │ │ │ │ └── donut_is_don_params.g.dart │ │ │ ├── download_file_options │ │ │ │ ├── download_file_options.dart │ │ │ │ └── download_file_options.g.dart │ │ │ ├── flash_set_level_options │ │ │ │ ├── flash_set_level_options.dart │ │ │ │ └── flash_set_level_options.g.dart │ │ │ ├── get_auth_token_options │ │ │ │ ├── get_auth_token_options.dart │ │ │ │ ├── get_auth_token_options.g.dart │ │ │ │ ├── scope.dart │ │ │ │ └── scope.g.dart │ │ │ ├── get_community_token_options │ │ │ │ ├── get_community_token_options.dart │ │ │ │ └── get_community_token_options.g.dart │ │ │ ├── get_friends_options │ │ │ │ ├── get_friends_options.dart │ │ │ │ └── get_friends_options.g.dart │ │ │ ├── get_group_info_options │ │ │ │ ├── get_group_info_options.dart │ │ │ │ └── get_group_info_options.g.dart │ │ │ ├── get_personal_card_options │ │ │ │ ├── get_personal_card_options.dart │ │ │ │ └── get_personal_card_options.g.dart │ │ │ ├── join_group_options │ │ │ │ ├── join_group_options.dart │ │ │ │ └── join_group_options.g.dart │ │ │ ├── leave_group_options │ │ │ │ ├── leave_group_options.dart │ │ │ │ └── leave_group_options.g.dart │ │ │ ├── location_options │ │ │ │ ├── location_options.dart │ │ │ │ └── location_options.g.dart │ │ │ ├── open_app_options │ │ │ │ ├── open_app_options.dart │ │ │ │ └── open_app_options.g.dart │ │ │ ├── resize_window_options │ │ │ │ ├── resize_window_options.dart │ │ │ │ └── resize_window_options.g.dart │ │ │ ├── scroll_options │ │ │ │ ├── scroll_options.dart │ │ │ │ └── scroll_options.g.dart │ │ │ ├── send_to_client_options │ │ │ │ ├── send_to_client_options.dart │ │ │ │ └── send_to_client_options.g.dart │ │ │ ├── set_swipe_settings_options │ │ │ │ ├── set_swipe_settings_options.dart │ │ │ │ └── set_swipe_settings_options.g.dart │ │ │ ├── set_view_settings_options │ │ │ │ ├── set_view_settings_options.dart │ │ │ │ ├── set_view_settings_options.g.dart │ │ │ │ ├── status_bar_style.dart │ │ │ │ └── status_bar_style.g.dart │ │ │ ├── share_options │ │ │ │ ├── share_options.dart │ │ │ │ └── share_options.g.dart │ │ │ ├── show_community_widget_preview_box_options │ │ │ │ ├── show_community_widget_preview_box_options.dart │ │ │ │ └── show_community_widget_preview_box_options.g.dart │ │ │ ├── show_images_options │ │ │ │ ├── show_images_options.dart │ │ │ │ └── show_images_options.g.dart │ │ │ ├── show_native_ads_options │ │ │ │ ├── show_native_ads_options.dart │ │ │ │ └── show_native_ads_options.g.dart │ │ │ ├── show_order_box_options │ │ │ │ ├── show_order_box_options.dart │ │ │ │ └── show_order_box_options.g.dart │ │ │ ├── show_story_box_options │ │ │ │ ├── action.dart │ │ │ │ ├── action_app.dart │ │ │ │ ├── action_app.g.dart │ │ │ │ ├── action_link.dart │ │ │ │ ├── action_link.g.dart │ │ │ │ ├── attachment.dart │ │ │ │ ├── attachment.g.dart │ │ │ │ ├── background_type.dart │ │ │ │ ├── background_type.g.dart │ │ │ │ ├── clickable_zone.dart │ │ │ │ ├── clickable_zone.g.dart │ │ │ │ ├── renderable_sticker.dart │ │ │ │ ├── renderable_sticker.g.dart │ │ │ │ ├── show_story_box_options.dart │ │ │ │ ├── show_story_box_options.g.dart │ │ │ │ ├── sticker_container.dart │ │ │ │ ├── sticker_container.g.dart │ │ │ │ ├── transform.dart │ │ │ │ └── transform.g.dart │ │ │ ├── show_wall_post_box_options │ │ │ │ ├── show_wall_post_box_options.dart │ │ │ │ └── show_wall_post_box_options.g.dart │ │ │ ├── show_wall_post_options │ │ │ │ ├── show_wall_post_options.dart │ │ │ │ └── show_wall_post_options.g.dart │ │ │ ├── storage_get_keys_options │ │ │ │ ├── storage_get_keys_options.dart │ │ │ │ └── storage_get_keys_options.g.dart │ │ │ ├── storage_get_options │ │ │ │ ├── storage_get_options.dart │ │ │ │ └── storage_get_options.g.dart │ │ │ ├── storage_set_options │ │ │ │ ├── storage_set_options.dart │ │ │ │ └── storage_set_options.g.dart │ │ │ ├── subscribe_story_app_options │ │ │ │ ├── subscribe_story_app_options.dart │ │ │ │ └── subscribe_story_app_options.g.dart │ │ │ ├── taptic_impact_occured_options │ │ │ │ ├── taptic_impact_occured_options.dart │ │ │ │ ├── taptic_impact_occured_options.g.dart │ │ │ │ ├── taptic_style.dart │ │ │ │ └── taptic_style.g.dart │ │ │ └── taptic_notification_occured_options │ │ │ │ ├── taptic_notification_occured_options.dart │ │ │ │ ├── taptic_notification_occured_options.g.dart │ │ │ │ ├── taptic_type.dart │ │ │ │ └── taptic_type.g.dart │ │ │ ├── results │ │ │ ├── common │ │ │ │ ├── city.dart │ │ │ │ ├── city.g.dart │ │ │ │ ├── country.dart │ │ │ │ └── country.g.dart │ │ │ ├── donut_is_don_result │ │ │ │ ├── donut_is_don_result.dart │ │ │ │ └── donut_is_don_result.g.dart │ │ │ ├── vk_web_app_add_to_community_result │ │ │ │ ├── vk_web_app_add_to_community_result.dart │ │ │ │ └── vk_web_app_add_to_community_result.g.dart │ │ │ ├── vk_web_app_add_to_home_screen_info_result │ │ │ │ ├── vk_web_app_add_to_home_screen_info_result.dart │ │ │ │ └── vk_web_app_add_to_home_screen_info_result.g.dart │ │ │ ├── vk_web_app_bool_result │ │ │ │ ├── vk_web_app_bool_result.dart │ │ │ │ └── vk_web_app_bool_result.g.dart │ │ │ ├── vk_web_app_community_access_token_result │ │ │ │ ├── vk_web_app_community_access_token_result.dart │ │ │ │ └── vk_web_app_community_access_token_result.g.dart │ │ │ ├── vk_web_app_contacts_done │ │ │ │ ├── vk_web_app_contacts_done.dart │ │ │ │ └── vk_web_app_contacts_done.g.dart │ │ │ ├── vk_web_app_flash_get_info_result │ │ │ │ ├── vk_web_app_flash_get_info_result.dart │ │ │ │ └── vk_web_app_flash_get_info_result.g.dart │ │ │ ├── vk_web_app_get_ads_result │ │ │ │ ├── stats.dart │ │ │ │ ├── stats.g.dart │ │ │ │ ├── stats_type.dart │ │ │ │ ├── stats_type.g.dart │ │ │ │ ├── vk_web_app_get_ads_result.dart │ │ │ │ └── vk_web_app_get_ads_result.g.dart │ │ │ ├── vk_web_app_get_auth_token_result │ │ │ │ ├── vk_web_app_get_auth_token_result.dart │ │ │ │ └── vk_web_app_get_auth_token_result.g.dart │ │ │ ├── vk_web_app_get_client_version_result │ │ │ │ ├── vk_web_app_get_client_version_result.dart │ │ │ │ └── vk_web_app_get_client_version_result.g.dart │ │ │ ├── vk_web_app_get_email_result │ │ │ │ ├── vk_web_app_get_email_result.dart │ │ │ │ └── vk_web_app_get_email_result.g.dart │ │ │ ├── vk_web_app_get_friends_result │ │ │ │ ├── user.dart │ │ │ │ ├── user.g.dart │ │ │ │ ├── vk_web_app_get_friends_result.dart │ │ │ │ └── vk_web_app_get_friends_result.g.dart │ │ │ ├── vk_web_app_get_geodata_result │ │ │ │ ├── vk_web_app_get_geodata_result.dart │ │ │ │ └── vk_web_app_get_geodata_result.g.dart │ │ │ ├── vk_web_app_get_group_info_result │ │ │ │ ├── vk_web_app_get_group_info_result.dart │ │ │ │ └── vk_web_app_get_group_info_result.g.dart │ │ │ ├── vk_web_app_get_personal_card_result │ │ │ │ ├── address.dart │ │ │ │ ├── address.g.dart │ │ │ │ ├── vk_web_app_get_personal_card_result.dart │ │ │ │ └── vk_web_app_get_personal_card_result.g.dart │ │ │ ├── vk_web_app_get_phone_number_result │ │ │ │ ├── vk_web_app_get_phone_number_result.dart │ │ │ │ └── vk_web_app_get_phone_number_result.g.dart │ │ │ ├── vk_web_app_get_user_info_result │ │ │ │ ├── vk_web_app_get_user_info_result.dart │ │ │ │ └── vk_web_app_get_user_info_result.g.dart │ │ │ ├── vk_web_app_open_app_result │ │ │ │ ├── vk_web_app_open_app_result.dart │ │ │ │ └── vk_web_app_open_app_result.g.dart │ │ │ ├── vk_web_app_open_code_reader_result │ │ │ │ ├── vk_web_app_open_code_reader_result.dart │ │ │ │ └── vk_web_app_open_code_reader_result.g.dart │ │ │ ├── vk_web_app_resize_window_result │ │ │ │ ├── size.dart │ │ │ │ ├── size.g.dart │ │ │ │ ├── vk_web_app_resize_window_result.dart │ │ │ │ └── vk_web_app_resize_window_result.g.dart │ │ │ ├── vk_web_app_scroll_result │ │ │ │ ├── scroll_result.dart │ │ │ │ ├── scroll_result.g.dart │ │ │ │ ├── vk_web_app_scroll_result.dart │ │ │ │ └── vk_web_app_scroll_result.g.dart │ │ │ ├── vk_web_app_share_result │ │ │ │ ├── vk_web_app_share_result.dart │ │ │ │ └── vk_web_app_share_result.g.dart │ │ │ ├── vk_web_app_show_wall_post_box_result │ │ │ │ ├── vk_web_app_show_wall_post_box_result.dart │ │ │ │ └── vk_web_app_show_wall_post_box_result.g.dart │ │ │ ├── vk_web_app_storage_get_keys_result │ │ │ │ ├── vk_web_app_storage_get_keys_result.dart │ │ │ │ └── vk_web_app_storage_get_keys_result.g.dart │ │ │ ├── vk_web_app_storage_get_result │ │ │ │ ├── key_value_pair.dart │ │ │ │ ├── key_value_pair.g.dart │ │ │ │ ├── vk_web_app_storage_get_result.dart │ │ │ │ └── vk_web_app_storage_get_result.g.dart │ │ │ └── vk_web_app_subscribe_story_app_result │ │ │ │ ├── vk_web_app_subscribe_story_app_result.dart │ │ │ │ └── vk_web_app_subscribe_story_app_result.g.dart │ │ │ ├── serializers.dart │ │ │ └── serializers.g.dart │ └── utils.dart └── vk_bridge.dart ├── pubspec.lock ├── pubspec.yaml └── test └── serializers_test.dart /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [otopba, sanekyy] 4 | -------------------------------------------------------------------------------- /.github/workflows/dart.yml: -------------------------------------------------------------------------------- 1 | name: Dart CI 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | format-check: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - uses: subosito/flutter-action@v2 15 | with: 16 | channel: 'stable' 17 | - run: flutter pub get 18 | - run: dart format --set-exit-if-changed . 19 | 20 | package-analysis: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - uses: actions/checkout@v2 24 | - uses: subosito/flutter-action@v2 25 | with: 26 | channel: 'stable' 27 | - run: flutter pub get 28 | - uses: axel-op/dart-package-analyzer@v3 29 | with: 30 | githubToken: ${{ secrets.GITHUB_TOKEN }} 31 | 32 | build: 33 | runs-on: ubuntu-latest 34 | steps: 35 | - uses: actions/checkout@v2 36 | - uses: subosito/flutter-action@v2 37 | with: 38 | channel: 'stable' 39 | - name: Install dependencies 40 | run: flutter pub get 41 | - name: Run tests 42 | run: flutter test 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .classpath 20 | .project 21 | .settings/ 22 | .vscode/ 23 | 24 | # Flutter repo-specific 25 | /bin/cache/ 26 | /bin/internal/bootstrap.bat 27 | /bin/internal/bootstrap.sh 28 | /bin/mingit/ 29 | /dev/benchmarks/mega_gallery/ 30 | /dev/bots/.recipe_deps 31 | /dev/bots/android_tools/ 32 | /dev/devicelab/ABresults*.json 33 | /dev/docs/doc/ 34 | /dev/docs/flutter.docs.zip 35 | /dev/docs/lib/ 36 | /dev/docs/pubspec.yaml 37 | /dev/integration_tests/**/xcuserdata 38 | /dev/integration_tests/**/Pods 39 | /packages/flutter/coverage/ 40 | version 41 | analysis_benchmark.json 42 | 43 | # packages file containing multi-root paths 44 | .packages.generated 45 | 46 | # Flutter/Dart/Pub related 47 | **/doc/api/ 48 | .dart_tool/ 49 | .flutter-plugins 50 | .flutter-plugins-dependencies 51 | **/generated_plugin_registrant.dart 52 | .packages 53 | .pub-cache/ 54 | .pub/ 55 | build/ 56 | flutter_*.png 57 | linked_*.ds 58 | unlinked.ds 59 | unlinked_spec.ds 60 | 61 | # Android related 62 | **/android/**/gradle-wrapper.jar 63 | **/android/.gradle 64 | **/android/captures/ 65 | **/android/gradlew 66 | **/android/gradlew.bat 67 | **/android/local.properties 68 | **/android/**/GeneratedPluginRegistrant.java 69 | **/android/key.properties 70 | *.jks 71 | 72 | # iOS/XCode related 73 | **/ios/**/*.mode1v3 74 | **/ios/**/*.mode2v3 75 | **/ios/**/*.moved-aside 76 | **/ios/**/*.pbxuser 77 | **/ios/**/*.perspectivev3 78 | **/ios/**/*sync/ 79 | **/ios/**/.sconsign.dblite 80 | **/ios/**/.tags* 81 | **/ios/**/.vagrant/ 82 | **/ios/**/DerivedData/ 83 | **/ios/**/Icon? 84 | **/ios/**/Pods/ 85 | **/ios/**/.symlinks/ 86 | **/ios/**/profile 87 | **/ios/**/xcuserdata 88 | **/ios/.generated/ 89 | **/ios/Flutter/.last_build_id 90 | **/ios/Flutter/App.framework 91 | **/ios/Flutter/Flutter.framework 92 | **/ios/Flutter/Flutter.podspec 93 | **/ios/Flutter/Generated.xcconfig 94 | **/ios/Flutter/app.flx 95 | **/ios/Flutter/app.zip 96 | **/ios/Flutter/flutter_assets/ 97 | **/ios/Flutter/flutter_export_environment.sh 98 | **/ios/ServiceDefinitions.json 99 | **/ios/Runner/GeneratedPluginRegistrant.* 100 | 101 | # macOS 102 | **/macos/Flutter/GeneratedPluginRegistrant.swift 103 | **/macos/Flutter/Flutter-Debug.xcconfig 104 | **/macos/Flutter/Flutter-Release.xcconfig 105 | **/macos/Flutter/Flutter-Profile.xcconfig 106 | 107 | # Coverage 108 | coverage/ 109 | 110 | # Symbols 111 | app.*.symbols 112 | 113 | # Exceptions to above rules. 114 | !**/ios/**/default.mode1v3 115 | !**/ios/**/default.mode2v3 116 | !**/ios/**/default.pbxuser 117 | !**/ios/**/default.perspectivev3 118 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 119 | !/dev/ci/**/Gemfile.lock -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 2.5.0 2 | 3 | - Update deps 4 | 5 | 6 | ## 2.4.0 7 | 8 | - Add ads methods 9 | 10 | ## 2.3.0 11 | 12 | - Add VKWebAppShowOrderBox 13 | 14 | ## 2.2.2 15 | 16 | - Add forgotten VKWebAppAddToCommunityResult, VKWebAppOpenCodeReaderResult, VKWebAppViewHide serializers 17 | - Set fixed version to vk-bridge script 18 | 19 | ## 2.2.1 20 | 21 | - Add Appearance enum for VKWebAppUpdateConfig 22 | - Add StatusBarStyle enum for SetViewSettingsOptions 23 | 24 | ## 2.2.0 25 | 26 | - Add new method openWallPost 27 | - Update build_runner to 2.1.5 28 | 29 | ## 2.1.0 30 | 31 | - Add new method donutIsDon 32 | - Update some method arguments to enum 33 | 34 | ## 2.0.2 35 | 36 | - Fix LaunchParams parsing: vk_group_id and vk_viewer_group_role can be null 37 | 38 | ## 2.0.1 39 | 40 | - Update dependencies 41 | 42 | ## 2.0.0 43 | 44 | - Migrate to null safety 45 | 46 | ## 1.3.1 47 | 48 | - Update dependencies 49 | 50 | ## 1.3.0 51 | 52 | - Added methods for show native ads 53 | 54 | ## 1.2.7 55 | 56 | - Fix deserialization in event handler 57 | 58 | ## 1.2.6+1 59 | 60 | - Update dependencies 61 | 62 | ## 1.2.6 63 | 64 | - Country and city for VKWebAppGetUserInfoResult are marked as optional 65 | 66 | ## 1.2.5+1 67 | 68 | - Update rxdart version from 0.24.1 to 0.25.0 69 | 70 | ## 1.2.5 71 | 72 | - Fix isLayer type in VKWebAppUpdateConfig 73 | 74 | ## 1.2.4 75 | 76 | - Improve VKWebAppGetGeodataResult parsing 77 | 78 | ## 1.2.3 79 | 80 | - Fix: mark bdate in VKWebAppGetUserInfoResult as nullable 81 | 82 | ## 1.2.2 83 | 84 | - Don't call VKWebAppStorageGet if list of keys is empty and return empty result. 85 | 86 | ## 1.2.1+2 87 | 88 | - Remove unused imports 89 | 90 | ## 1.2.1+1 91 | 92 | - Remove unused imports 93 | 94 | ## 1.2.1 95 | 96 | - Remove app_id from update config event due difference type on iOS and Android ( String / int ) 97 | - Set default value for offset ( 0 ) in StorageGetKeys because it requires on iOS 98 | 99 | ## 1.2.0 100 | 101 | - Improve internal error handling 102 | 103 | - Add new methods: 104 | - getFriends 105 | - openContacts 106 | - getAuthToken 107 | - getGroupInfo 108 | - joinGroup 109 | - leaveGroup 110 | - allowMessagesFromGroup 111 | - getCommunityToken 112 | - addToCommunity 113 | - showCommunityWidgetPreviewBox 114 | - flashGetInfo 115 | - flashSetLevel 116 | - locationChangedStream 117 | - viewHideStream 118 | - resizeWindow 119 | - scroll 120 | - setLocation 121 | - setViewSettings 122 | - setSwipeSettings 123 | - tapticNotificationOccurred 124 | - tapticSelectionChanged 125 | - tapticImpactOccurred 126 | - subscribeStoryApp 127 | 128 | ## 1.1.1 129 | 130 | - Fix internal error handling 131 | 132 | ## 1.1.0 133 | 134 | - Add methods for storage 135 | 136 | ## 1.0.0+1 137 | 138 | - Remove unused import 139 | 140 | ## 1.0.0 141 | 142 | - Initial version -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at hello@optimist.dev. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VK Bridge 2 | 3 | A package for integrating Flutter VK Mini Apps with official VK clients for iOS, Android and Web. 4 | 5 | This package is a wrapper around official [VK-Bridge](https://github.com/VKCOM/vk-bridge) JS package. 6 | 7 | ## Usage 8 | 9 | On app start call `VKBridge.instance.init()` method before `runApp` to ensure correct VK Bridge initialization. 10 | 11 | ```dart 12 | import 'package:vk_bridge/vk_bridge.dart'; 13 | 14 | Future main() async { 15 | await VKBridge.instance.init(); 16 | 17 | runApp(MyApp()); 18 | } 19 | ``` 20 | 21 | Add this part of code in your index.html before Flutter part. 22 | 23 | ```html 24 | 25 | 26 | 27 | 34 | 35 | 36 | ``` 37 | 38 | To add logger use `VKBridge.instance.setLogger()`. 39 | 40 | ### Original VK Bridge documentation: https://vk.com/dev/vk_bridge_events 41 | 42 | ### Original VK Bridge JS package: https://github.com/VKCOM/vk-bridge 43 | 44 | 45 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | 36 | # Symbolication related 37 | app.*.symbols 38 | 39 | # Obfuscation related 40 | app.*.map.json 41 | 42 | # Android Studio will place build artifacts here 43 | /android/app/debug 44 | /android/app/profile 45 | /android/app/release 46 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 12bea61c2902784fec73b7f5f2ff3415f873fead 8 | channel: dev 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | ## Build 2 | 3 | ```bash 4 | flutter build web --web-renderer=canvaskit --release 5 | ``` 6 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:vk_bridge/vk_bridge.dart'; 3 | 4 | import 'examples_page.dart'; 5 | 6 | /// Simple logger implementations 7 | class SimpleLogger implements Logger { 8 | @override 9 | void d(Object message) { 10 | print('vk_bridge.d: $message'); 11 | } 12 | 13 | @override 14 | void e(Object message) { 15 | print('vk_bridge.e: $message'); 16 | } 17 | } 18 | 19 | Future main() async { 20 | VKBridge.instance.setLogger(SimpleLogger()); 21 | 22 | final result = await VKBridge.instance.init(); 23 | 24 | print('VKBridge.init: $result'); 25 | 26 | runApp(MyApp()); 27 | } 28 | 29 | /// Sample app 30 | class MyApp extends StatelessWidget { 31 | @override 32 | Widget build(BuildContext context) { 33 | return MaterialApp( 34 | theme: ThemeData( 35 | primarySwatch: Colors.blue, 36 | ), 37 | home: ExamplesPage(), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | 3 | version: 1.0.0+1 4 | publish_to: none 5 | 6 | environment: 7 | sdk: '>=3.4.1 <4.0.0' 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | vk_bridge: 13 | path: ../ 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | 19 | flutter: 20 | uses-material-design: true 21 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/optimist-dev/vk_bridge/c752a8fe65eb9dc6f7f7836efbe92a8741f02845/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/flutter_bootstrap.js: -------------------------------------------------------------------------------- 1 | {{flutter_js}} 2 | {{flutter_build_config}} 3 | 4 | window.addEventListener('load', async function (ev) { 5 | const versionResponse = await fetch('/version.json?version=' + Date.now()); 6 | const versionJson = await versionResponse.json(); 7 | const version = versionJson['version']; 8 | console.log(version); 9 | // Download main.dart.js 10 | _flutter.loader.load({ 11 | serviceWorkerSettings: { 12 | timeoutMillis: 40000, 13 | serviceWorkerUrl: "flutter_service_worker.js?version_worker=" + version, 14 | serviceWorkerVersion: {{flutter_service_worker_version}}, 15 | }, 16 | }); 17 | }); -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/optimist-dev/vk_bridge/c752a8fe65eb9dc6f7f7836efbe92a8741f02845/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/optimist-dev/vk_bridge/c752a8fe65eb9dc6f7f7836efbe92a8741f02845/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/optimist-dev/vk_bridge/c752a8fe65eb9dc6f7f7836efbe92a8741f02845/example/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/optimist-dev/vk_bridge/c752a8fe65eb9dc6f7f7836efbe92a8741f02845/example/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | example 20 | 21 | 22 | 23 | 24 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /lib/src/bridge/logger.dart: -------------------------------------------------------------------------------- 1 | /// Logger interface 2 | abstract class Logger { 3 | /// Print debug log with [message] 4 | void d(Object message); 5 | 6 | /// Print error log with [message] 7 | void e(Object message); 8 | } 9 | -------------------------------------------------------------------------------- /lib/src/data/model/errors/error_data.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'error_data.g.dart'; 5 | 6 | /// VK Bridge event error data 7 | abstract class ErrorData implements Built { 8 | /// [ErrorData] factory 9 | factory ErrorData([void Function(ErrorDataBuilder) updates]) = _$ErrorData; 10 | 11 | ErrorData._(); 12 | 13 | /// [ErrorData] serializer 14 | static Serializer get serializer => _$errorDataSerializer; 15 | 16 | /// Error code 17 | @BuiltValueField(wireName: 'error_code') 18 | int get errorCode; 19 | 20 | /// Error description. 21 | @BuiltValueField(wireName: 'error_reason') 22 | String get errorReason; 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/data/model/errors/vk_web_app_error.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/data/model/errors/error_data.dart'; 4 | 5 | part 'vk_web_app_error.g.dart'; 6 | 7 | /// VK Bridge event error 8 | abstract class VKWebAppError 9 | implements Built { 10 | /// [VKWebAppError] factory 11 | factory VKWebAppError([void Function(VKWebAppErrorBuilder) updates]) = 12 | _$VKWebAppError; 13 | 14 | VKWebAppError._(); 15 | 16 | /// [VKWebAppError] serializer 17 | static Serializer get serializer => _$vKWebAppErrorSerializer; 18 | 19 | /// Type of the error 20 | @BuiltValueField(wireName: 'error_type') 21 | String get errorType; 22 | 23 | /// Data of the error 24 | @BuiltValueField(wireName: 'error_data') 25 | ErrorData get errorData; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/events/vk_web_app_location_changed/vk_web_app_location_changed.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'vk_web_app_location_changed.g.dart'; 5 | 6 | /// If the hash changes, the [VKWebAppLocationChanged] event is generated 7 | /// with the "location" field, whose value is the fragment after the "#": 8 | abstract class VKWebAppLocationChanged 9 | implements Built { 10 | /// [VKWebAppLocationChanged] factory 11 | factory VKWebAppLocationChanged( 12 | [void Function(VKWebAppLocationChangedBuilder) updates]) = 13 | _$VKWebAppLocationChanged; 14 | 15 | VKWebAppLocationChanged._(); 16 | 17 | /// [VKWebAppLocationChanged] serializer 18 | static Serializer get serializer => 19 | _$vKWebAppLocationChangedSerializer; 20 | 21 | ///the value is the fragment after the "#": 22 | String get location; 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/data/model/events/vk_web_app_update_config/appearance.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | 5 | part 'appearance.g.dart'; 6 | 7 | /// Appearance for [VKWebAppUpdateConfig] 8 | class Appearance extends EnumClass { 9 | const Appearance._(String name) : super(name); 10 | 11 | /// Appearance serializer 12 | static Serializer get serializer => _$appearanceSerializer; 13 | 14 | /// light 15 | static const Appearance light = _$light; 16 | 17 | /// dark 18 | static const Appearance dark = _$dark; 19 | 20 | /// List of all appearances 21 | static BuiltSet get values => _$values; 22 | 23 | /// Parse appearance from string 24 | static Appearance valueOf(String name) => _$valueOf(name); 25 | } 26 | -------------------------------------------------------------------------------- /lib/src/data/model/events/vk_web_app_update_config/appearance.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'appearance.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | const Appearance _$light = const Appearance._('light'); 10 | const Appearance _$dark = const Appearance._('dark'); 11 | 12 | Appearance _$valueOf(String name) { 13 | switch (name) { 14 | case 'light': 15 | return _$light; 16 | case 'dark': 17 | return _$dark; 18 | default: 19 | throw new ArgumentError(name); 20 | } 21 | } 22 | 23 | final BuiltSet _$values = 24 | new BuiltSet(const [ 25 | _$light, 26 | _$dark, 27 | ]); 28 | 29 | Serializer _$appearanceSerializer = new _$AppearanceSerializer(); 30 | 31 | class _$AppearanceSerializer implements PrimitiveSerializer { 32 | @override 33 | final Iterable types = const [Appearance]; 34 | @override 35 | final String wireName = 'Appearance'; 36 | 37 | @override 38 | Object serialize(Serializers serializers, Appearance object, 39 | {FullType specifiedType = FullType.unspecified}) => 40 | object.name; 41 | 42 | @override 43 | Appearance deserialize(Serializers serializers, Object serialized, 44 | {FullType specifiedType = FullType.unspecified}) => 45 | Appearance.valueOf(serialized as String); 46 | } 47 | 48 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 49 | -------------------------------------------------------------------------------- /lib/src/data/model/events/vk_web_app_update_config/insets.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'insets.g.dart'; 5 | 6 | /// Insets from the edge of the screen to the content 7 | abstract class Insets implements Built { 8 | /// [Insets] factory 9 | factory Insets([void Function(InsetsBuilder) updates]) = _$Insets; 10 | 11 | Insets._(); 12 | 13 | /// [Insets] serializer 14 | static Serializer get serializer => _$insetsSerializer; 15 | 16 | /// Right inset 17 | double get right; 18 | 19 | /// Top inset 20 | double get top; 21 | 22 | /// Left inset 23 | double get left; 24 | 25 | /// Bottom inset 26 | double get bottom; 27 | } 28 | -------------------------------------------------------------------------------- /lib/src/data/model/events/vk_web_app_update_config/vk_web_app_update_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/data/model/events/vk_web_app_update_config/appearance.dart'; 4 | import 'package:vk_bridge/src/data/model/events/vk_web_app_update_config/insets.dart'; 5 | 6 | part 'vk_web_app_update_config.g.dart'; 7 | 8 | /// Application configuration 9 | abstract class VKWebAppUpdateConfig 10 | implements Built { 11 | /// [VKWebAppUpdateConfig] factory 12 | factory VKWebAppUpdateConfig( 13 | [void Function(VKWebAppUpdateConfigBuilder) updates]) = 14 | _$VKWebAppUpdateConfig; 15 | 16 | VKWebAppUpdateConfig._(); 17 | 18 | /// [VKWebAppUpdateConfig] serializer 19 | static Serializer get serializer => 20 | _$vKWebAppUpdateConfigSerializer; 21 | 22 | // TODO(sanekyy): enum 23 | /// Customer type. Possible values: 24 | /// vkclient 25 | /// vkme 26 | /// 27 | /// Platforms: iOS, Android 28 | String? get app; 29 | 30 | // TODO: iOS return string, Android return int :( 31 | // /// Mini App's ID 32 | // /// 33 | // /// Platforms: iOS, Android 34 | // @BuiltValueField(wireName: 'app_id') 35 | 36 | // int? get appId; 37 | 38 | /// Appearance 39 | /// 40 | /// Platforms: iOS, Android 41 | Appearance? get appearance; 42 | 43 | /// The current insets that need to be maintained from the edge of the screen 44 | /// to the content (there is a keyboard display, its height will be at the 45 | /// bottom). 46 | /// 47 | /// Platforms: iOS 48 | Insets? get insets; 49 | 50 | /// Application color scheme. 51 | /// 52 | /// Platforms: iOS, Android, Web, Mobile Web 53 | String get scheme; 54 | 55 | /// Unix time of opening modal screen - 56 | /// only passed when opening a modal screen. 57 | /// 58 | /// Platforms: iOS, Android 59 | @BuiltValueField(wireName: 'start_time') 60 | int? get startTime; 61 | 62 | /// The height of the application's parent window. 63 | /// 64 | /// Platforms: Web 65 | @BuiltValueField(wireName: 'viewport_height') 66 | int? get viewportHeight; 67 | 68 | /// The width of the application's parent window. 69 | /// 70 | /// Platforms: Web 71 | @BuiltValueField(wireName: 'viewport_width') 72 | int? get viewportWidth; 73 | 74 | /// Server API host for direct requests. 75 | /// 76 | /// Platforms: Web 77 | @BuiltValueField(wireName: 'api_host') 78 | String? get apiHost; 79 | 80 | /// The parameter comes in if the application is open in the layer. 81 | /// 82 | /// Platforms: Web 83 | @BuiltValueField(wireName: 'is_layer') 84 | bool? get isLayer; 85 | } 86 | -------------------------------------------------------------------------------- /lib/src/data/model/events/vk_web_app_view_hide/vk_web_app_view_hide.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'vk_web_app_view_hide.g.dart'; 5 | 6 | /// After minimizing the service, the client dispatches an event 7 | /// with VKWebAppViewHide with an empty data field. 8 | abstract class VKWebAppViewHide 9 | implements Built { 10 | /// [VKWebAppViewHide] factory 11 | factory VKWebAppViewHide([void Function(VKWebAppViewHideBuilder) updates]) = 12 | _$VKWebAppViewHide; 13 | 14 | VKWebAppViewHide._(); 15 | 16 | /// [VKWebAppViewHide] serializer 17 | static Serializer get serializer => 18 | _$vKWebAppViewHideSerializer; 19 | } 20 | -------------------------------------------------------------------------------- /lib/src/data/model/events/vk_web_app_view_hide/vk_web_app_view_hide.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'vk_web_app_view_hide.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$vKWebAppViewHideSerializer = 10 | new _$VKWebAppViewHideSerializer(); 11 | 12 | class _$VKWebAppViewHideSerializer 13 | implements StructuredSerializer { 14 | @override 15 | final Iterable types = const [VKWebAppViewHide, _$VKWebAppViewHide]; 16 | @override 17 | final String wireName = 'VKWebAppViewHide'; 18 | 19 | @override 20 | Iterable serialize(Serializers serializers, VKWebAppViewHide object, 21 | {FullType specifiedType = FullType.unspecified}) { 22 | return []; 23 | } 24 | 25 | @override 26 | VKWebAppViewHide deserialize( 27 | Serializers serializers, Iterable serialized, 28 | {FullType specifiedType = FullType.unspecified}) { 29 | return new VKWebAppViewHideBuilder().build(); 30 | } 31 | } 32 | 33 | class _$VKWebAppViewHide extends VKWebAppViewHide { 34 | factory _$VKWebAppViewHide( 35 | [void Function(VKWebAppViewHideBuilder)? updates]) => 36 | (new VKWebAppViewHideBuilder()..update(updates))._build(); 37 | 38 | _$VKWebAppViewHide._() : super._(); 39 | 40 | @override 41 | VKWebAppViewHide rebuild(void Function(VKWebAppViewHideBuilder) updates) => 42 | (toBuilder()..update(updates)).build(); 43 | 44 | @override 45 | VKWebAppViewHideBuilder toBuilder() => 46 | new VKWebAppViewHideBuilder()..replace(this); 47 | 48 | @override 49 | bool operator ==(Object other) { 50 | if (identical(other, this)) return true; 51 | return other is VKWebAppViewHide; 52 | } 53 | 54 | @override 55 | int get hashCode { 56 | return 439335039; 57 | } 58 | 59 | @override 60 | String toString() { 61 | return newBuiltValueToStringHelper(r'VKWebAppViewHide').toString(); 62 | } 63 | } 64 | 65 | class VKWebAppViewHideBuilder 66 | implements Builder { 67 | _$VKWebAppViewHide? _$v; 68 | 69 | VKWebAppViewHideBuilder(); 70 | 71 | @override 72 | void replace(VKWebAppViewHide other) { 73 | ArgumentError.checkNotNull(other, 'other'); 74 | _$v = other as _$VKWebAppViewHide; 75 | } 76 | 77 | @override 78 | void update(void Function(VKWebAppViewHideBuilder)? updates) { 79 | if (updates != null) updates(this); 80 | } 81 | 82 | @override 83 | VKWebAppViewHide build() => _build(); 84 | 85 | _$VKWebAppViewHide _build() { 86 | final _$result = _$v ?? new _$VKWebAppViewHide._(); 87 | replace(_$result); 88 | return _$result; 89 | } 90 | } 91 | 92 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 93 | -------------------------------------------------------------------------------- /lib/src/data/model/options/allow_messages_from_group_options/allow_messages_from_group_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'allow_messages_from_group_options.g.dart'; 6 | 7 | /// Options of [VKBridge.allowMessagesFromGroup] 8 | abstract class AllowMessagesFromGroupOptions 9 | implements 10 | Built { 12 | /// [AllowMessagesFromGroupOptions] factory 13 | factory AllowMessagesFromGroupOptions( 14 | [void Function(AllowMessagesFromGroupOptionsBuilder) updates]) = 15 | _$AllowMessagesFromGroupOptions; 16 | 17 | AllowMessagesFromGroupOptions._(); 18 | 19 | /// [AllowMessagesFromGroupOptions] serializer 20 | static Serializer get serializer => 21 | _$allowMessagesFromGroupOptionsSerializer; 22 | 23 | /// Group ID 24 | @BuiltValueField(wireName: 'group_id') 25 | int get groupId; 26 | 27 | /// arbitrary string. 28 | /// This parameter can be used to authenticate the user. 29 | /// Its value will be returned in the message_allow event of the Callback API 30 | String? get key; 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/data/model/options/check_native_ads/ad_format.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | 5 | part 'ad_format.g.dart'; 6 | 7 | /// AdFormat for [GetAuthTokenOptions] 8 | class AdFormat extends EnumClass { 9 | const AdFormat._(String name) : super(name); 10 | 11 | /// AdFormat serializer 12 | static Serializer get serializer => _$adFormatSerializer; 13 | 14 | /// Video with a viewing reward (up to 30 seconds) 15 | static const AdFormat reward = _$reward; 16 | 17 | /// Inter-screen advertising (video or static image for up to 5 seconds) 18 | static const AdFormat interstitial = _$interstitial; 19 | 20 | /// List of all AdFormats 21 | static BuiltSet get values => _$values; 22 | 23 | /// Parse AdFormat from string 24 | static AdFormat valueOf(String name) => _$valueOf(name); 25 | } 26 | -------------------------------------------------------------------------------- /lib/src/data/model/options/check_native_ads/ad_format.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'ad_format.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | const AdFormat _$reward = const AdFormat._('reward'); 10 | const AdFormat _$interstitial = const AdFormat._('interstitial'); 11 | 12 | AdFormat _$valueOf(String name) { 13 | switch (name) { 14 | case 'reward': 15 | return _$reward; 16 | case 'interstitial': 17 | return _$interstitial; 18 | default: 19 | throw new ArgumentError(name); 20 | } 21 | } 22 | 23 | final BuiltSet _$values = new BuiltSet(const [ 24 | _$reward, 25 | _$interstitial, 26 | ]); 27 | 28 | Serializer _$adFormatSerializer = new _$AdFormatSerializer(); 29 | 30 | class _$AdFormatSerializer implements PrimitiveSerializer { 31 | @override 32 | final Iterable types = const [AdFormat]; 33 | @override 34 | final String wireName = 'AdFormat'; 35 | 36 | @override 37 | Object serialize(Serializers serializers, AdFormat object, 38 | {FullType specifiedType = FullType.unspecified}) => 39 | object.name; 40 | 41 | @override 42 | AdFormat deserialize(Serializers serializers, Object serialized, 43 | {FullType specifiedType = FullType.unspecified}) => 44 | AdFormat.valueOf(serialized as String); 45 | } 46 | 47 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 48 | -------------------------------------------------------------------------------- /lib/src/data/model/options/check_native_ads/check_native_ads_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | import 'package:vk_bridge/src/data/model/options/check_native_ads/ad_format.dart'; 5 | 6 | part 'check_native_ads_options.g.dart'; 7 | 8 | /// Options of [VKBridge.checkNativeAds] 9 | abstract class CheckNativeAdsOptions 10 | implements Built { 11 | /// [CheckNativeAdsOptions] factory 12 | factory CheckNativeAdsOptions( 13 | [void Function(CheckNativeAdsOptionsBuilder) updates]) = 14 | _$CheckNativeAdsOptions; 15 | 16 | CheckNativeAdsOptions._(); 17 | 18 | /// [CheckNativeAdsOptions] serializer 19 | static Serializer get serializer => 20 | _$checkNativeAdsOptionsSerializer; 21 | 22 | /// Type of advertisement 23 | @BuiltValueField(wireName: 'ad_format') 24 | AdFormat get adFormat; 25 | 26 | /// Only for adFormat = reward. 27 | /// Whether to use the interstitial advertising mechanism when there is no rewarded video 28 | @BuiltValueField(wireName: 'use_waterfall') 29 | bool? get useWaterfall; 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/data/model/options/close_options/close_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'close_options.g.dart'; 6 | 7 | /// Options of [VKBridge.appClose] 8 | abstract class CloseOptions 9 | implements Built { 10 | /// [CloseOptions] factory 11 | factory CloseOptions([void Function(CloseOptionsBuilder) updates]) = 12 | _$CloseOptions; 13 | 14 | CloseOptions._(); 15 | 16 | /// [CloseOptions] serializer 17 | static Serializer get serializer => _$closeOptionsSerializer; 18 | 19 | // TODO(sanekyy): enum 20 | /// The application close status passed to the parent application. 21 | /// Possible values: Possible values: failed, success 22 | String get status; 23 | 24 | /// Data passed to the parent application. 25 | Object? get payload; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/options/copy_text_options/copy_text_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'copy_text_options.g.dart'; 6 | 7 | /// Options for [VKBridge.copyText] 8 | abstract class CopyTextOptions 9 | implements Built { 10 | /// [CopyTextOptions] factory 11 | factory CopyTextOptions([void Function(CopyTextOptionsBuilder) updates]) = 12 | _$CopyTextOptions; 13 | 14 | CopyTextOptions._(); 15 | 16 | /// [CopyTextOptions] serializer 17 | static Serializer get serializer => 18 | _$copyTextOptionsSerializer; 19 | 20 | /// The string to be placed on the clipboard 21 | String get text; 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/data/model/options/copy_text_options/copy_text_options.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'copy_text_options.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$copyTextOptionsSerializer = 10 | new _$CopyTextOptionsSerializer(); 11 | 12 | class _$CopyTextOptionsSerializer 13 | implements StructuredSerializer { 14 | @override 15 | final Iterable types = const [CopyTextOptions, _$CopyTextOptions]; 16 | @override 17 | final String wireName = 'CopyTextOptions'; 18 | 19 | @override 20 | Iterable serialize(Serializers serializers, CopyTextOptions object, 21 | {FullType specifiedType = FullType.unspecified}) { 22 | final result = [ 23 | 'text', 24 | serializers.serialize(object.text, specifiedType: const FullType(String)), 25 | ]; 26 | 27 | return result; 28 | } 29 | 30 | @override 31 | CopyTextOptions deserialize( 32 | Serializers serializers, Iterable serialized, 33 | {FullType specifiedType = FullType.unspecified}) { 34 | final result = new CopyTextOptionsBuilder(); 35 | 36 | final iterator = serialized.iterator; 37 | while (iterator.moveNext()) { 38 | final key = iterator.current! as String; 39 | iterator.moveNext(); 40 | final Object? value = iterator.current; 41 | switch (key) { 42 | case 'text': 43 | result.text = serializers.deserialize(value, 44 | specifiedType: const FullType(String))! as String; 45 | break; 46 | } 47 | } 48 | 49 | return result.build(); 50 | } 51 | } 52 | 53 | class _$CopyTextOptions extends CopyTextOptions { 54 | @override 55 | final String text; 56 | 57 | factory _$CopyTextOptions([void Function(CopyTextOptionsBuilder)? updates]) => 58 | (new CopyTextOptionsBuilder()..update(updates))._build(); 59 | 60 | _$CopyTextOptions._({required this.text}) : super._() { 61 | BuiltValueNullFieldError.checkNotNull(text, r'CopyTextOptions', 'text'); 62 | } 63 | 64 | @override 65 | CopyTextOptions rebuild(void Function(CopyTextOptionsBuilder) updates) => 66 | (toBuilder()..update(updates)).build(); 67 | 68 | @override 69 | CopyTextOptionsBuilder toBuilder() => 70 | new CopyTextOptionsBuilder()..replace(this); 71 | 72 | @override 73 | bool operator ==(Object other) { 74 | if (identical(other, this)) return true; 75 | return other is CopyTextOptions && text == other.text; 76 | } 77 | 78 | @override 79 | int get hashCode { 80 | var _$hash = 0; 81 | _$hash = $jc(_$hash, text.hashCode); 82 | _$hash = $jf(_$hash); 83 | return _$hash; 84 | } 85 | 86 | @override 87 | String toString() { 88 | return (newBuiltValueToStringHelper(r'CopyTextOptions')..add('text', text)) 89 | .toString(); 90 | } 91 | } 92 | 93 | class CopyTextOptionsBuilder 94 | implements Builder { 95 | _$CopyTextOptions? _$v; 96 | 97 | String? _text; 98 | String? get text => _$this._text; 99 | set text(String? text) => _$this._text = text; 100 | 101 | CopyTextOptionsBuilder(); 102 | 103 | CopyTextOptionsBuilder get _$this { 104 | final $v = _$v; 105 | if ($v != null) { 106 | _text = $v.text; 107 | _$v = null; 108 | } 109 | return this; 110 | } 111 | 112 | @override 113 | void replace(CopyTextOptions other) { 114 | ArgumentError.checkNotNull(other, 'other'); 115 | _$v = other as _$CopyTextOptions; 116 | } 117 | 118 | @override 119 | void update(void Function(CopyTextOptionsBuilder)? updates) { 120 | if (updates != null) updates(this); 121 | } 122 | 123 | @override 124 | CopyTextOptions build() => _build(); 125 | 126 | _$CopyTextOptions _build() { 127 | final _$result = _$v ?? 128 | new _$CopyTextOptions._( 129 | text: BuiltValueNullFieldError.checkNotNull( 130 | text, r'CopyTextOptions', 'text')); 131 | replace(_$result); 132 | return _$result; 133 | } 134 | } 135 | 136 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 137 | -------------------------------------------------------------------------------- /lib/src/data/model/options/donut_is_don_options/donut_is_don_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/unsupported.dart'; 4 | import 'package:vk_bridge/src/data/model/options/donut_is_don_options/donut_is_don_params.dart'; 5 | 6 | part 'donut_is_don_options.g.dart'; 7 | 8 | /// Options of [VKBridge.donutIsDon] 9 | abstract class DonutIsDonOptions 10 | implements Built { 11 | /// [DonutIsDonOptions] factory 12 | factory DonutIsDonOptions([void Function(DonutIsDonOptionsBuilder) updates]) = 13 | _$DonutIsDonOptions; 14 | 15 | DonutIsDonOptions._(); 16 | 17 | /// [DonutIsDonOptions] serializer 18 | static Serializer get serializer => 19 | _$donutIsDonOptionsSerializer; 20 | 21 | /// API method name https://vk.com/dev/methods 22 | String get method; 23 | 24 | /// Method parameters 25 | DonutIsDonParams get params; 26 | 27 | /// An arbitrary string that will be returned along with the query result. 28 | /// Use [requestId] to track the uniqueness of requests 29 | @BuiltValueField(wireName: 'request_id') 30 | String get requestId; 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/data/model/options/donut_is_don_options/donut_is_don_params.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'donut_is_don_params.g.dart'; 5 | 6 | /// Params of [DonutIsDonOptions] 7 | abstract class DonutIsDonParams 8 | implements Built { 9 | /// [DonutIsDonParams] factory 10 | factory DonutIsDonParams([void Function(DonutIsDonParamsBuilder) updates]) = 11 | _$DonutIsDonParams; 12 | 13 | DonutIsDonParams._(); 14 | 15 | /// [DonutIsDonParams] serializer 16 | static Serializer get serializer => 17 | _$donutIsDonParamsSerializer; 18 | 19 | /// Community identifier 20 | @BuiltValueField(wireName: 'owner_id') 21 | int get ownerId; 22 | 23 | /// Query version 24 | @BuiltValueField(wireName: 'v') 25 | double get version; 26 | 27 | /// Token from [getAuthToken] with [Scope.groups] scope 28 | @BuiltValueField(wireName: 'access_token') 29 | String get accessToken; 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/data/model/options/download_file_options/download_file_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'download_file_options.g.dart'; 6 | 7 | /// Options for [VKBridge.downloadFile] 8 | abstract class DownloadFileOptions 9 | implements Built { 10 | /// [DownloadFileOptions] factory 11 | factory DownloadFileOptions( 12 | [void Function(DownloadFileOptionsBuilder) updates]) = 13 | _$DownloadFileOptions; 14 | 15 | DownloadFileOptions._(); 16 | 17 | /// [DownloadFileOptions] serializer 18 | static Serializer get serializer => 19 | _$downloadFileOptionsSerializer; 20 | 21 | /// Link to the file you want to download 22 | String get url; 23 | 24 | /// File name 25 | String get filename; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/options/flash_set_level_options/flash_set_level_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'flash_set_level_options.g.dart'; 6 | 7 | /// Options of [VKBridge.appClose] 8 | abstract class FlashSetLevelOptions 9 | implements Built { 10 | /// [FlashSetLevelOptions] factory 11 | factory FlashSetLevelOptions( 12 | [void Function(FlashSetLevelOptionsBuilder) updates]) = 13 | _$FlashSetLevelOptions; 14 | 15 | FlashSetLevelOptions._(); 16 | 17 | /// [FlashSetLevelOptions] serializer 18 | static Serializer get serializer => 19 | _$flashSetLevelOptionsSerializer; 20 | 21 | /// Flashlight brightness level from 0 to 1. 22 | int get level; 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/data/model/options/flash_set_level_options/flash_set_level_options.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'flash_set_level_options.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$flashSetLevelOptionsSerializer = 10 | new _$FlashSetLevelOptionsSerializer(); 11 | 12 | class _$FlashSetLevelOptionsSerializer 13 | implements StructuredSerializer { 14 | @override 15 | final Iterable types = const [ 16 | FlashSetLevelOptions, 17 | _$FlashSetLevelOptions 18 | ]; 19 | @override 20 | final String wireName = 'FlashSetLevelOptions'; 21 | 22 | @override 23 | Iterable serialize( 24 | Serializers serializers, FlashSetLevelOptions object, 25 | {FullType specifiedType = FullType.unspecified}) { 26 | final result = [ 27 | 'level', 28 | serializers.serialize(object.level, specifiedType: const FullType(int)), 29 | ]; 30 | 31 | return result; 32 | } 33 | 34 | @override 35 | FlashSetLevelOptions deserialize( 36 | Serializers serializers, Iterable serialized, 37 | {FullType specifiedType = FullType.unspecified}) { 38 | final result = new FlashSetLevelOptionsBuilder(); 39 | 40 | final iterator = serialized.iterator; 41 | while (iterator.moveNext()) { 42 | final key = iterator.current! as String; 43 | iterator.moveNext(); 44 | final Object? value = iterator.current; 45 | switch (key) { 46 | case 'level': 47 | result.level = serializers.deserialize(value, 48 | specifiedType: const FullType(int))! as int; 49 | break; 50 | } 51 | } 52 | 53 | return result.build(); 54 | } 55 | } 56 | 57 | class _$FlashSetLevelOptions extends FlashSetLevelOptions { 58 | @override 59 | final int level; 60 | 61 | factory _$FlashSetLevelOptions( 62 | [void Function(FlashSetLevelOptionsBuilder)? updates]) => 63 | (new FlashSetLevelOptionsBuilder()..update(updates))._build(); 64 | 65 | _$FlashSetLevelOptions._({required this.level}) : super._() { 66 | BuiltValueNullFieldError.checkNotNull( 67 | level, r'FlashSetLevelOptions', 'level'); 68 | } 69 | 70 | @override 71 | FlashSetLevelOptions rebuild( 72 | void Function(FlashSetLevelOptionsBuilder) updates) => 73 | (toBuilder()..update(updates)).build(); 74 | 75 | @override 76 | FlashSetLevelOptionsBuilder toBuilder() => 77 | new FlashSetLevelOptionsBuilder()..replace(this); 78 | 79 | @override 80 | bool operator ==(Object other) { 81 | if (identical(other, this)) return true; 82 | return other is FlashSetLevelOptions && level == other.level; 83 | } 84 | 85 | @override 86 | int get hashCode { 87 | var _$hash = 0; 88 | _$hash = $jc(_$hash, level.hashCode); 89 | _$hash = $jf(_$hash); 90 | return _$hash; 91 | } 92 | 93 | @override 94 | String toString() { 95 | return (newBuiltValueToStringHelper(r'FlashSetLevelOptions') 96 | ..add('level', level)) 97 | .toString(); 98 | } 99 | } 100 | 101 | class FlashSetLevelOptionsBuilder 102 | implements Builder { 103 | _$FlashSetLevelOptions? _$v; 104 | 105 | int? _level; 106 | int? get level => _$this._level; 107 | set level(int? level) => _$this._level = level; 108 | 109 | FlashSetLevelOptionsBuilder(); 110 | 111 | FlashSetLevelOptionsBuilder get _$this { 112 | final $v = _$v; 113 | if ($v != null) { 114 | _level = $v.level; 115 | _$v = null; 116 | } 117 | return this; 118 | } 119 | 120 | @override 121 | void replace(FlashSetLevelOptions other) { 122 | ArgumentError.checkNotNull(other, 'other'); 123 | _$v = other as _$FlashSetLevelOptions; 124 | } 125 | 126 | @override 127 | void update(void Function(FlashSetLevelOptionsBuilder)? updates) { 128 | if (updates != null) updates(this); 129 | } 130 | 131 | @override 132 | FlashSetLevelOptions build() => _build(); 133 | 134 | _$FlashSetLevelOptions _build() { 135 | final _$result = _$v ?? 136 | new _$FlashSetLevelOptions._( 137 | level: BuiltValueNullFieldError.checkNotNull( 138 | level, r'FlashSetLevelOptions', 'level')); 139 | replace(_$result); 140 | return _$result; 141 | } 142 | } 143 | 144 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 145 | -------------------------------------------------------------------------------- /lib/src/data/model/options/get_auth_token_options/get_auth_token_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'get_auth_token_options.g.dart'; 6 | 7 | /// Options of [VKBridge.appClose] 8 | abstract class GetAuthTokenOptions 9 | implements Built { 10 | /// [GetAuthTokenOptions] factory 11 | factory GetAuthTokenOptions( 12 | [void Function(GetAuthTokenOptionsBuilder) updates]) = 13 | _$GetAuthTokenOptions; 14 | 15 | GetAuthTokenOptions._(); 16 | 17 | /// [GetAuthTokenOptions] serializer 18 | static Serializer get serializer => 19 | _$getAuthTokenOptionsSerializer; 20 | 21 | /// Application ID. 22 | @BuiltValueField(wireName: 'app_id') 23 | int get appId; 24 | 25 | /// List of access rights, separated by commas 26 | String get scope; 27 | } 28 | -------------------------------------------------------------------------------- /lib/src/data/model/options/get_auth_token_options/scope.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | 5 | part 'scope.g.dart'; 6 | 7 | /// Scopes for [GetAuthTokenOptions] 8 | class Scope extends EnumClass { 9 | const Scope._(String name) : super(name); 10 | 11 | /// Scope serializer 12 | static Serializer get serializer => _$scopeSerializer; 13 | 14 | /// Access to the user's friends list 15 | static const Scope friends = _$friends; 16 | 17 | /// Access to photos 18 | static const Scope photos = _$photos; 19 | 20 | /// Access to videos 21 | static const Scope video = _$video; 22 | 23 | /// Access to stories 24 | static const Scope stories = _$stories; 25 | 26 | /// Access to wiki pages 27 | static const Scope pages = _$pages; 28 | 29 | /// Access to user status 30 | static const Scope status = _$status; 31 | 32 | /// Access to user notes 33 | static const Scope notes = _$notes; 34 | 35 | /// Access to methods of working with a wall 36 | static const Scope wall = _$wall; 37 | 38 | /// Access to documents 39 | static const Scope docs = _$docs; 40 | 41 | /// Access to user communities 42 | static const Scope groups = _$groups; 43 | 44 | /// Access to statistics of groups and applications of the user, of which he is the administrator 45 | static const Scope stats = _$stats; 46 | 47 | /// Access to goods 48 | static const Scope market = _$market; 49 | 50 | /// List of all scopes 51 | static BuiltSet get values => _$values; 52 | 53 | /// Parse scope from string 54 | static Scope valueOf(String name) => _$valueOf(name); 55 | } 56 | -------------------------------------------------------------------------------- /lib/src/data/model/options/get_auth_token_options/scope.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'scope.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | const Scope _$friends = const Scope._('friends'); 10 | const Scope _$photos = const Scope._('photos'); 11 | const Scope _$video = const Scope._('video'); 12 | const Scope _$stories = const Scope._('stories'); 13 | const Scope _$pages = const Scope._('pages'); 14 | const Scope _$status = const Scope._('status'); 15 | const Scope _$notes = const Scope._('notes'); 16 | const Scope _$wall = const Scope._('wall'); 17 | const Scope _$docs = const Scope._('docs'); 18 | const Scope _$groups = const Scope._('groups'); 19 | const Scope _$stats = const Scope._('stats'); 20 | const Scope _$market = const Scope._('market'); 21 | 22 | Scope _$valueOf(String name) { 23 | switch (name) { 24 | case 'friends': 25 | return _$friends; 26 | case 'photos': 27 | return _$photos; 28 | case 'video': 29 | return _$video; 30 | case 'stories': 31 | return _$stories; 32 | case 'pages': 33 | return _$pages; 34 | case 'status': 35 | return _$status; 36 | case 'notes': 37 | return _$notes; 38 | case 'wall': 39 | return _$wall; 40 | case 'docs': 41 | return _$docs; 42 | case 'groups': 43 | return _$groups; 44 | case 'stats': 45 | return _$stats; 46 | case 'market': 47 | return _$market; 48 | default: 49 | throw new ArgumentError(name); 50 | } 51 | } 52 | 53 | final BuiltSet _$values = new BuiltSet(const [ 54 | _$friends, 55 | _$photos, 56 | _$video, 57 | _$stories, 58 | _$pages, 59 | _$status, 60 | _$notes, 61 | _$wall, 62 | _$docs, 63 | _$groups, 64 | _$stats, 65 | _$market, 66 | ]); 67 | 68 | Serializer _$scopeSerializer = new _$ScopeSerializer(); 69 | 70 | class _$ScopeSerializer implements PrimitiveSerializer { 71 | @override 72 | final Iterable types = const [Scope]; 73 | @override 74 | final String wireName = 'Scope'; 75 | 76 | @override 77 | Object serialize(Serializers serializers, Scope object, 78 | {FullType specifiedType = FullType.unspecified}) => 79 | object.name; 80 | 81 | @override 82 | Scope deserialize(Serializers serializers, Object serialized, 83 | {FullType specifiedType = FullType.unspecified}) => 84 | Scope.valueOf(serialized as String); 85 | } 86 | 87 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 88 | -------------------------------------------------------------------------------- /lib/src/data/model/options/get_community_token_options/get_community_token_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'get_community_token_options.g.dart'; 6 | 7 | /// Options of [VKBridge.getCommunityToken] 8 | abstract class GetCommunityTokenOptions 9 | implements 10 | Built { 11 | /// [GetCommunityTokenOptions] factory 12 | factory GetCommunityTokenOptions( 13 | [void Function(GetCommunityTokenOptionsBuilder) updates]) = 14 | _$GetCommunityTokenOptions; 15 | 16 | GetCommunityTokenOptions._(); 17 | 18 | /// [GetCommunityTokenOptions] serializer 19 | static Serializer get serializer => 20 | _$getCommunityTokenOptionsSerializer; 21 | 22 | /// App ID. 23 | @BuiltValueField(wireName: 'app_id') 24 | int get appId; 25 | 26 | /// Group ID. 27 | @BuiltValueField(wireName: 'group_id') 28 | int get groupId; 29 | 30 | /// List of access rights, separated by commas. 31 | /// Available Values: 32 | /// stories - access to stories. 33 | /// photos - access to photos. 34 | /// app_widget - Access to community widgets. 35 | /// messages - access to community messages. 36 | /// docs - access to documents. 37 | /// manage - access to community administration. 38 | String get scope; 39 | } 40 | -------------------------------------------------------------------------------- /lib/src/data/model/options/get_friends_options/get_friends_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'get_friends_options.g.dart'; 5 | 6 | /// Options for [VKBridge.share] 7 | abstract class GetFriendsOptions 8 | implements Built { 9 | /// [GetFriendsOptions] factory 10 | factory GetFriendsOptions([void Function(GetFriendsOptionsBuilder) updates]) = 11 | _$GetFriendsOptions; 12 | 13 | GetFriendsOptions._(); 14 | 15 | /// [GetFriendsOptions] serializer 16 | static Serializer get serializer => 17 | _$getFriendsOptionsSerializer; 18 | 19 | /// false: selection of one friend from the list. 20 | /// true: selection of several friends from the list. 21 | /// The default is false. 22 | bool? get multi; 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/data/model/options/get_friends_options/get_friends_options.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'get_friends_options.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$getFriendsOptionsSerializer = 10 | new _$GetFriendsOptionsSerializer(); 11 | 12 | class _$GetFriendsOptionsSerializer 13 | implements StructuredSerializer { 14 | @override 15 | final Iterable types = const [GetFriendsOptions, _$GetFriendsOptions]; 16 | @override 17 | final String wireName = 'GetFriendsOptions'; 18 | 19 | @override 20 | Iterable serialize(Serializers serializers, GetFriendsOptions object, 21 | {FullType specifiedType = FullType.unspecified}) { 22 | final result = []; 23 | Object? value; 24 | value = object.multi; 25 | if (value != null) { 26 | result 27 | ..add('multi') 28 | ..add( 29 | serializers.serialize(value, specifiedType: const FullType(bool))); 30 | } 31 | return result; 32 | } 33 | 34 | @override 35 | GetFriendsOptions deserialize( 36 | Serializers serializers, Iterable serialized, 37 | {FullType specifiedType = FullType.unspecified}) { 38 | final result = new GetFriendsOptionsBuilder(); 39 | 40 | final iterator = serialized.iterator; 41 | while (iterator.moveNext()) { 42 | final key = iterator.current! as String; 43 | iterator.moveNext(); 44 | final Object? value = iterator.current; 45 | switch (key) { 46 | case 'multi': 47 | result.multi = serializers.deserialize(value, 48 | specifiedType: const FullType(bool)) as bool?; 49 | break; 50 | } 51 | } 52 | 53 | return result.build(); 54 | } 55 | } 56 | 57 | class _$GetFriendsOptions extends GetFriendsOptions { 58 | @override 59 | final bool? multi; 60 | 61 | factory _$GetFriendsOptions( 62 | [void Function(GetFriendsOptionsBuilder)? updates]) => 63 | (new GetFriendsOptionsBuilder()..update(updates))._build(); 64 | 65 | _$GetFriendsOptions._({this.multi}) : super._(); 66 | 67 | @override 68 | GetFriendsOptions rebuild(void Function(GetFriendsOptionsBuilder) updates) => 69 | (toBuilder()..update(updates)).build(); 70 | 71 | @override 72 | GetFriendsOptionsBuilder toBuilder() => 73 | new GetFriendsOptionsBuilder()..replace(this); 74 | 75 | @override 76 | bool operator ==(Object other) { 77 | if (identical(other, this)) return true; 78 | return other is GetFriendsOptions && multi == other.multi; 79 | } 80 | 81 | @override 82 | int get hashCode { 83 | var _$hash = 0; 84 | _$hash = $jc(_$hash, multi.hashCode); 85 | _$hash = $jf(_$hash); 86 | return _$hash; 87 | } 88 | 89 | @override 90 | String toString() { 91 | return (newBuiltValueToStringHelper(r'GetFriendsOptions') 92 | ..add('multi', multi)) 93 | .toString(); 94 | } 95 | } 96 | 97 | class GetFriendsOptionsBuilder 98 | implements Builder { 99 | _$GetFriendsOptions? _$v; 100 | 101 | bool? _multi; 102 | bool? get multi => _$this._multi; 103 | set multi(bool? multi) => _$this._multi = multi; 104 | 105 | GetFriendsOptionsBuilder(); 106 | 107 | GetFriendsOptionsBuilder get _$this { 108 | final $v = _$v; 109 | if ($v != null) { 110 | _multi = $v.multi; 111 | _$v = null; 112 | } 113 | return this; 114 | } 115 | 116 | @override 117 | void replace(GetFriendsOptions other) { 118 | ArgumentError.checkNotNull(other, 'other'); 119 | _$v = other as _$GetFriendsOptions; 120 | } 121 | 122 | @override 123 | void update(void Function(GetFriendsOptionsBuilder)? updates) { 124 | if (updates != null) updates(this); 125 | } 126 | 127 | @override 128 | GetFriendsOptions build() => _build(); 129 | 130 | _$GetFriendsOptions _build() { 131 | final _$result = _$v ?? new _$GetFriendsOptions._(multi: multi); 132 | replace(_$result); 133 | return _$result; 134 | } 135 | } 136 | 137 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 138 | -------------------------------------------------------------------------------- /lib/src/data/model/options/get_group_info_options/get_group_info_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'get_group_info_options.g.dart'; 6 | 7 | /// Options of [VKBridge.getGroupInfo] 8 | abstract class GetGroupInfoOptions 9 | implements Built { 10 | /// [GetGroupInfoOptions] factory 11 | factory GetGroupInfoOptions( 12 | [void Function(GetGroupInfoOptionsBuilder) updates]) = 13 | _$GetGroupInfoOptions; 14 | 15 | GetGroupInfoOptions._(); 16 | 17 | /// [GetGroupInfoOptions] serializer 18 | static Serializer get serializer => 19 | _$getGroupInfoOptionsSerializer; 20 | 21 | /// Group ID. 22 | @BuiltValueField(wireName: 'group_id') 23 | int get groupId; 24 | } 25 | -------------------------------------------------------------------------------- /lib/src/data/model/options/get_group_info_options/get_group_info_options.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'get_group_info_options.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$getGroupInfoOptionsSerializer = 10 | new _$GetGroupInfoOptionsSerializer(); 11 | 12 | class _$GetGroupInfoOptionsSerializer 13 | implements StructuredSerializer { 14 | @override 15 | final Iterable types = const [ 16 | GetGroupInfoOptions, 17 | _$GetGroupInfoOptions 18 | ]; 19 | @override 20 | final String wireName = 'GetGroupInfoOptions'; 21 | 22 | @override 23 | Iterable serialize( 24 | Serializers serializers, GetGroupInfoOptions object, 25 | {FullType specifiedType = FullType.unspecified}) { 26 | final result = [ 27 | 'group_id', 28 | serializers.serialize(object.groupId, specifiedType: const FullType(int)), 29 | ]; 30 | 31 | return result; 32 | } 33 | 34 | @override 35 | GetGroupInfoOptions deserialize( 36 | Serializers serializers, Iterable serialized, 37 | {FullType specifiedType = FullType.unspecified}) { 38 | final result = new GetGroupInfoOptionsBuilder(); 39 | 40 | final iterator = serialized.iterator; 41 | while (iterator.moveNext()) { 42 | final key = iterator.current! as String; 43 | iterator.moveNext(); 44 | final Object? value = iterator.current; 45 | switch (key) { 46 | case 'group_id': 47 | result.groupId = serializers.deserialize(value, 48 | specifiedType: const FullType(int))! as int; 49 | break; 50 | } 51 | } 52 | 53 | return result.build(); 54 | } 55 | } 56 | 57 | class _$GetGroupInfoOptions extends GetGroupInfoOptions { 58 | @override 59 | final int groupId; 60 | 61 | factory _$GetGroupInfoOptions( 62 | [void Function(GetGroupInfoOptionsBuilder)? updates]) => 63 | (new GetGroupInfoOptionsBuilder()..update(updates))._build(); 64 | 65 | _$GetGroupInfoOptions._({required this.groupId}) : super._() { 66 | BuiltValueNullFieldError.checkNotNull( 67 | groupId, r'GetGroupInfoOptions', 'groupId'); 68 | } 69 | 70 | @override 71 | GetGroupInfoOptions rebuild( 72 | void Function(GetGroupInfoOptionsBuilder) updates) => 73 | (toBuilder()..update(updates)).build(); 74 | 75 | @override 76 | GetGroupInfoOptionsBuilder toBuilder() => 77 | new GetGroupInfoOptionsBuilder()..replace(this); 78 | 79 | @override 80 | bool operator ==(Object other) { 81 | if (identical(other, this)) return true; 82 | return other is GetGroupInfoOptions && groupId == other.groupId; 83 | } 84 | 85 | @override 86 | int get hashCode { 87 | var _$hash = 0; 88 | _$hash = $jc(_$hash, groupId.hashCode); 89 | _$hash = $jf(_$hash); 90 | return _$hash; 91 | } 92 | 93 | @override 94 | String toString() { 95 | return (newBuiltValueToStringHelper(r'GetGroupInfoOptions') 96 | ..add('groupId', groupId)) 97 | .toString(); 98 | } 99 | } 100 | 101 | class GetGroupInfoOptionsBuilder 102 | implements Builder { 103 | _$GetGroupInfoOptions? _$v; 104 | 105 | int? _groupId; 106 | int? get groupId => _$this._groupId; 107 | set groupId(int? groupId) => _$this._groupId = groupId; 108 | 109 | GetGroupInfoOptionsBuilder(); 110 | 111 | GetGroupInfoOptionsBuilder get _$this { 112 | final $v = _$v; 113 | if ($v != null) { 114 | _groupId = $v.groupId; 115 | _$v = null; 116 | } 117 | return this; 118 | } 119 | 120 | @override 121 | void replace(GetGroupInfoOptions other) { 122 | ArgumentError.checkNotNull(other, 'other'); 123 | _$v = other as _$GetGroupInfoOptions; 124 | } 125 | 126 | @override 127 | void update(void Function(GetGroupInfoOptionsBuilder)? updates) { 128 | if (updates != null) updates(this); 129 | } 130 | 131 | @override 132 | GetGroupInfoOptions build() => _build(); 133 | 134 | _$GetGroupInfoOptions _build() { 135 | final _$result = _$v ?? 136 | new _$GetGroupInfoOptions._( 137 | groupId: BuiltValueNullFieldError.checkNotNull( 138 | groupId, r'GetGroupInfoOptions', 'groupId')); 139 | replace(_$result); 140 | return _$result; 141 | } 142 | } 143 | 144 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 145 | -------------------------------------------------------------------------------- /lib/src/data/model/options/get_personal_card_options/get_personal_card_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 5 | 6 | part 'get_personal_card_options.g.dart'; 7 | 8 | /// Options of [VKBridge.appClose] 9 | abstract class GetPersonalCardOptions 10 | implements Built { 11 | /// [GetPersonalCardOptions] factory 12 | factory GetPersonalCardOptions( 13 | [void Function(GetPersonalCardOptionsBuilder) updates]) = 14 | _$GetPersonalCardOptions; 15 | 16 | GetPersonalCardOptions._(); 17 | 18 | /// [GetPersonalCardOptions] serializer 19 | static Serializer get serializer => 20 | _$getPersonalCardOptionsSerializer; 21 | 22 | /// Array of strings. Possible values: 23 | /// phone - phone number. 24 | /// email - mailing address. 25 | /// address - user's address. 26 | BuiltList get type; 27 | } 28 | -------------------------------------------------------------------------------- /lib/src/data/model/options/join_group_options/join_group_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'join_group_options.g.dart'; 6 | 7 | /// Options of [VKBridge.joinGroup] 8 | abstract class JoinGroupOptions 9 | implements Built { 10 | /// [JoinGroupOptions] factory 11 | factory JoinGroupOptions([void Function(JoinGroupOptionsBuilder) updates]) = 12 | _$JoinGroupOptions; 13 | 14 | JoinGroupOptions._(); 15 | 16 | /// [JoinGroupOptions] serializer 17 | static Serializer get serializer => 18 | _$joinGroupOptionsSerializer; 19 | 20 | /// Group ID. 21 | @BuiltValueField(wireName: 'group_id') 22 | int get groupId; 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/data/model/options/join_group_options/join_group_options.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'join_group_options.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$joinGroupOptionsSerializer = 10 | new _$JoinGroupOptionsSerializer(); 11 | 12 | class _$JoinGroupOptionsSerializer 13 | implements StructuredSerializer { 14 | @override 15 | final Iterable types = const [JoinGroupOptions, _$JoinGroupOptions]; 16 | @override 17 | final String wireName = 'JoinGroupOptions'; 18 | 19 | @override 20 | Iterable serialize(Serializers serializers, JoinGroupOptions object, 21 | {FullType specifiedType = FullType.unspecified}) { 22 | final result = [ 23 | 'group_id', 24 | serializers.serialize(object.groupId, specifiedType: const FullType(int)), 25 | ]; 26 | 27 | return result; 28 | } 29 | 30 | @override 31 | JoinGroupOptions deserialize( 32 | Serializers serializers, Iterable serialized, 33 | {FullType specifiedType = FullType.unspecified}) { 34 | final result = new JoinGroupOptionsBuilder(); 35 | 36 | final iterator = serialized.iterator; 37 | while (iterator.moveNext()) { 38 | final key = iterator.current! as String; 39 | iterator.moveNext(); 40 | final Object? value = iterator.current; 41 | switch (key) { 42 | case 'group_id': 43 | result.groupId = serializers.deserialize(value, 44 | specifiedType: const FullType(int))! as int; 45 | break; 46 | } 47 | } 48 | 49 | return result.build(); 50 | } 51 | } 52 | 53 | class _$JoinGroupOptions extends JoinGroupOptions { 54 | @override 55 | final int groupId; 56 | 57 | factory _$JoinGroupOptions( 58 | [void Function(JoinGroupOptionsBuilder)? updates]) => 59 | (new JoinGroupOptionsBuilder()..update(updates))._build(); 60 | 61 | _$JoinGroupOptions._({required this.groupId}) : super._() { 62 | BuiltValueNullFieldError.checkNotNull( 63 | groupId, r'JoinGroupOptions', 'groupId'); 64 | } 65 | 66 | @override 67 | JoinGroupOptions rebuild(void Function(JoinGroupOptionsBuilder) updates) => 68 | (toBuilder()..update(updates)).build(); 69 | 70 | @override 71 | JoinGroupOptionsBuilder toBuilder() => 72 | new JoinGroupOptionsBuilder()..replace(this); 73 | 74 | @override 75 | bool operator ==(Object other) { 76 | if (identical(other, this)) return true; 77 | return other is JoinGroupOptions && groupId == other.groupId; 78 | } 79 | 80 | @override 81 | int get hashCode { 82 | var _$hash = 0; 83 | _$hash = $jc(_$hash, groupId.hashCode); 84 | _$hash = $jf(_$hash); 85 | return _$hash; 86 | } 87 | 88 | @override 89 | String toString() { 90 | return (newBuiltValueToStringHelper(r'JoinGroupOptions') 91 | ..add('groupId', groupId)) 92 | .toString(); 93 | } 94 | } 95 | 96 | class JoinGroupOptionsBuilder 97 | implements Builder { 98 | _$JoinGroupOptions? _$v; 99 | 100 | int? _groupId; 101 | int? get groupId => _$this._groupId; 102 | set groupId(int? groupId) => _$this._groupId = groupId; 103 | 104 | JoinGroupOptionsBuilder(); 105 | 106 | JoinGroupOptionsBuilder get _$this { 107 | final $v = _$v; 108 | if ($v != null) { 109 | _groupId = $v.groupId; 110 | _$v = null; 111 | } 112 | return this; 113 | } 114 | 115 | @override 116 | void replace(JoinGroupOptions other) { 117 | ArgumentError.checkNotNull(other, 'other'); 118 | _$v = other as _$JoinGroupOptions; 119 | } 120 | 121 | @override 122 | void update(void Function(JoinGroupOptionsBuilder)? updates) { 123 | if (updates != null) updates(this); 124 | } 125 | 126 | @override 127 | JoinGroupOptions build() => _build(); 128 | 129 | _$JoinGroupOptions _build() { 130 | final _$result = _$v ?? 131 | new _$JoinGroupOptions._( 132 | groupId: BuiltValueNullFieldError.checkNotNull( 133 | groupId, r'JoinGroupOptions', 'groupId')); 134 | replace(_$result); 135 | return _$result; 136 | } 137 | } 138 | 139 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 140 | -------------------------------------------------------------------------------- /lib/src/data/model/options/leave_group_options/leave_group_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'leave_group_options.g.dart'; 6 | 7 | /// Options of [VKBridge.leaveGroup] 8 | abstract class LeaveGroupOptions 9 | implements Built { 10 | /// [LeaveGroupOptions] factory 11 | factory LeaveGroupOptions([void Function(LeaveGroupOptionsBuilder) updates]) = 12 | _$LeaveGroupOptions; 13 | 14 | LeaveGroupOptions._(); 15 | 16 | /// [LeaveGroupOptions] serializer 17 | static Serializer get serializer => 18 | _$leaveGroupOptionsSerializer; 19 | 20 | /// Group ID. 21 | @BuiltValueField(wireName: 'group_id') 22 | int get groupId; 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/data/model/options/leave_group_options/leave_group_options.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'leave_group_options.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$leaveGroupOptionsSerializer = 10 | new _$LeaveGroupOptionsSerializer(); 11 | 12 | class _$LeaveGroupOptionsSerializer 13 | implements StructuredSerializer { 14 | @override 15 | final Iterable types = const [LeaveGroupOptions, _$LeaveGroupOptions]; 16 | @override 17 | final String wireName = 'LeaveGroupOptions'; 18 | 19 | @override 20 | Iterable serialize(Serializers serializers, LeaveGroupOptions object, 21 | {FullType specifiedType = FullType.unspecified}) { 22 | final result = [ 23 | 'group_id', 24 | serializers.serialize(object.groupId, specifiedType: const FullType(int)), 25 | ]; 26 | 27 | return result; 28 | } 29 | 30 | @override 31 | LeaveGroupOptions deserialize( 32 | Serializers serializers, Iterable serialized, 33 | {FullType specifiedType = FullType.unspecified}) { 34 | final result = new LeaveGroupOptionsBuilder(); 35 | 36 | final iterator = serialized.iterator; 37 | while (iterator.moveNext()) { 38 | final key = iterator.current! as String; 39 | iterator.moveNext(); 40 | final Object? value = iterator.current; 41 | switch (key) { 42 | case 'group_id': 43 | result.groupId = serializers.deserialize(value, 44 | specifiedType: const FullType(int))! as int; 45 | break; 46 | } 47 | } 48 | 49 | return result.build(); 50 | } 51 | } 52 | 53 | class _$LeaveGroupOptions extends LeaveGroupOptions { 54 | @override 55 | final int groupId; 56 | 57 | factory _$LeaveGroupOptions( 58 | [void Function(LeaveGroupOptionsBuilder)? updates]) => 59 | (new LeaveGroupOptionsBuilder()..update(updates))._build(); 60 | 61 | _$LeaveGroupOptions._({required this.groupId}) : super._() { 62 | BuiltValueNullFieldError.checkNotNull( 63 | groupId, r'LeaveGroupOptions', 'groupId'); 64 | } 65 | 66 | @override 67 | LeaveGroupOptions rebuild(void Function(LeaveGroupOptionsBuilder) updates) => 68 | (toBuilder()..update(updates)).build(); 69 | 70 | @override 71 | LeaveGroupOptionsBuilder toBuilder() => 72 | new LeaveGroupOptionsBuilder()..replace(this); 73 | 74 | @override 75 | bool operator ==(Object other) { 76 | if (identical(other, this)) return true; 77 | return other is LeaveGroupOptions && groupId == other.groupId; 78 | } 79 | 80 | @override 81 | int get hashCode { 82 | var _$hash = 0; 83 | _$hash = $jc(_$hash, groupId.hashCode); 84 | _$hash = $jf(_$hash); 85 | return _$hash; 86 | } 87 | 88 | @override 89 | String toString() { 90 | return (newBuiltValueToStringHelper(r'LeaveGroupOptions') 91 | ..add('groupId', groupId)) 92 | .toString(); 93 | } 94 | } 95 | 96 | class LeaveGroupOptionsBuilder 97 | implements Builder { 98 | _$LeaveGroupOptions? _$v; 99 | 100 | int? _groupId; 101 | int? get groupId => _$this._groupId; 102 | set groupId(int? groupId) => _$this._groupId = groupId; 103 | 104 | LeaveGroupOptionsBuilder(); 105 | 106 | LeaveGroupOptionsBuilder get _$this { 107 | final $v = _$v; 108 | if ($v != null) { 109 | _groupId = $v.groupId; 110 | _$v = null; 111 | } 112 | return this; 113 | } 114 | 115 | @override 116 | void replace(LeaveGroupOptions other) { 117 | ArgumentError.checkNotNull(other, 'other'); 118 | _$v = other as _$LeaveGroupOptions; 119 | } 120 | 121 | @override 122 | void update(void Function(LeaveGroupOptionsBuilder)? updates) { 123 | if (updates != null) updates(this); 124 | } 125 | 126 | @override 127 | LeaveGroupOptions build() => _build(); 128 | 129 | _$LeaveGroupOptions _build() { 130 | final _$result = _$v ?? 131 | new _$LeaveGroupOptions._( 132 | groupId: BuiltValueNullFieldError.checkNotNull( 133 | groupId, r'LeaveGroupOptions', 'groupId')); 134 | replace(_$result); 135 | return _$result; 136 | } 137 | } 138 | 139 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 140 | -------------------------------------------------------------------------------- /lib/src/data/model/options/location_options/location_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'location_options.g.dart'; 6 | 7 | /// Options of [VKBridge.setLocation] 8 | abstract class LocationOptions 9 | implements Built { 10 | /// [LocationOptions] factory 11 | factory LocationOptions([void Function(LocationOptionsBuilder) updates]) = 12 | _$LocationOptions; 13 | 14 | LocationOptions._(); 15 | 16 | /// [LocationOptions] serializer 17 | static Serializer get serializer => 18 | _$locationOptionsSerializer; 19 | 20 | /// The new hash value. 21 | String get location; 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/data/model/options/location_options/location_options.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'location_options.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$locationOptionsSerializer = 10 | new _$LocationOptionsSerializer(); 11 | 12 | class _$LocationOptionsSerializer 13 | implements StructuredSerializer { 14 | @override 15 | final Iterable types = const [LocationOptions, _$LocationOptions]; 16 | @override 17 | final String wireName = 'LocationOptions'; 18 | 19 | @override 20 | Iterable serialize(Serializers serializers, LocationOptions object, 21 | {FullType specifiedType = FullType.unspecified}) { 22 | final result = [ 23 | 'location', 24 | serializers.serialize(object.location, 25 | specifiedType: const FullType(String)), 26 | ]; 27 | 28 | return result; 29 | } 30 | 31 | @override 32 | LocationOptions deserialize( 33 | Serializers serializers, Iterable serialized, 34 | {FullType specifiedType = FullType.unspecified}) { 35 | final result = new LocationOptionsBuilder(); 36 | 37 | final iterator = serialized.iterator; 38 | while (iterator.moveNext()) { 39 | final key = iterator.current! as String; 40 | iterator.moveNext(); 41 | final Object? value = iterator.current; 42 | switch (key) { 43 | case 'location': 44 | result.location = serializers.deserialize(value, 45 | specifiedType: const FullType(String))! as String; 46 | break; 47 | } 48 | } 49 | 50 | return result.build(); 51 | } 52 | } 53 | 54 | class _$LocationOptions extends LocationOptions { 55 | @override 56 | final String location; 57 | 58 | factory _$LocationOptions([void Function(LocationOptionsBuilder)? updates]) => 59 | (new LocationOptionsBuilder()..update(updates))._build(); 60 | 61 | _$LocationOptions._({required this.location}) : super._() { 62 | BuiltValueNullFieldError.checkNotNull( 63 | location, r'LocationOptions', 'location'); 64 | } 65 | 66 | @override 67 | LocationOptions rebuild(void Function(LocationOptionsBuilder) updates) => 68 | (toBuilder()..update(updates)).build(); 69 | 70 | @override 71 | LocationOptionsBuilder toBuilder() => 72 | new LocationOptionsBuilder()..replace(this); 73 | 74 | @override 75 | bool operator ==(Object other) { 76 | if (identical(other, this)) return true; 77 | return other is LocationOptions && location == other.location; 78 | } 79 | 80 | @override 81 | int get hashCode { 82 | var _$hash = 0; 83 | _$hash = $jc(_$hash, location.hashCode); 84 | _$hash = $jf(_$hash); 85 | return _$hash; 86 | } 87 | 88 | @override 89 | String toString() { 90 | return (newBuiltValueToStringHelper(r'LocationOptions') 91 | ..add('location', location)) 92 | .toString(); 93 | } 94 | } 95 | 96 | class LocationOptionsBuilder 97 | implements Builder { 98 | _$LocationOptions? _$v; 99 | 100 | String? _location; 101 | String? get location => _$this._location; 102 | set location(String? location) => _$this._location = location; 103 | 104 | LocationOptionsBuilder(); 105 | 106 | LocationOptionsBuilder get _$this { 107 | final $v = _$v; 108 | if ($v != null) { 109 | _location = $v.location; 110 | _$v = null; 111 | } 112 | return this; 113 | } 114 | 115 | @override 116 | void replace(LocationOptions other) { 117 | ArgumentError.checkNotNull(other, 'other'); 118 | _$v = other as _$LocationOptions; 119 | } 120 | 121 | @override 122 | void update(void Function(LocationOptionsBuilder)? updates) { 123 | if (updates != null) updates(this); 124 | } 125 | 126 | @override 127 | LocationOptions build() => _build(); 128 | 129 | _$LocationOptions _build() { 130 | final _$result = _$v ?? 131 | new _$LocationOptions._( 132 | location: BuiltValueNullFieldError.checkNotNull( 133 | location, r'LocationOptions', 'location')); 134 | replace(_$result); 135 | return _$result; 136 | } 137 | } 138 | 139 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 140 | -------------------------------------------------------------------------------- /lib/src/data/model/options/open_app_options/open_app_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'open_app_options.g.dart'; 6 | 7 | /// Options for [VKBridge.openApp] 8 | abstract class OpenAppOptions 9 | implements Built { 10 | /// [OpenAppOptions] factory 11 | factory OpenAppOptions([void Function(OpenAppOptionsBuilder) updates]) = 12 | _$OpenAppOptions; 13 | 14 | OpenAppOptions._(); 15 | 16 | /// [OpenAppOptions] serializer 17 | static Serializer get serializer => 18 | _$openAppOptionsSerializer; 19 | 20 | /// The identifier of the application to be opened. 21 | @BuiltValueField(wireName: 'app_id') 22 | int get appId; 23 | 24 | /// Hash, the line after the # in a URL like https://vk.com/app123456#. 25 | String get location; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/options/resize_window_options/resize_window_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'resize_window_options.g.dart'; 6 | 7 | /// Options of [VKBridge.resizeWindow] 8 | abstract class ResizeWindowOptions 9 | implements Built { 10 | /// [ResizeWindowOptions] factory 11 | factory ResizeWindowOptions( 12 | [void Function(ResizeWindowOptionsBuilder) updates]) = 13 | _$ResizeWindowOptions; 14 | 15 | ResizeWindowOptions._(); 16 | 17 | /// [ResizeWindowOptions] serializer 18 | static Serializer get serializer => 19 | _$resizeWindowOptionsSerializer; 20 | 21 | /// Window width. It can take values from 630px to 1000px. 22 | int get width; 23 | 24 | /// Window height. It can take values from 500px to 4050px. 25 | int get height; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/options/scroll_options/scroll_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'scroll_options.g.dart'; 6 | 7 | /// Options of [VKBridge.scroll] 8 | abstract class ScrollOptions 9 | implements Built { 10 | /// [ScrollOptions] factory 11 | factory ScrollOptions([void Function(ScrollOptionsBuilder) updates]) = 12 | _$ScrollOptions; 13 | 14 | ScrollOptions._(); 15 | 16 | /// [ScrollOptions] serializer 17 | static Serializer get serializer => _$scrollOptionsSerializer; 18 | 19 | /// Scroll offset relative to the zero coordinate of the window. 20 | /// For example, in order to scroll the window to the very top of the page, 21 | /// you must pass the value 0. 22 | int get top; 23 | 24 | /// Animation speed in milliseconds. The default is 0. 25 | int? get speed; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/options/send_to_client_options/send_to_client_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'send_to_client_options.g.dart'; 6 | 7 | /// Options of [VKBridge.appSendToClient] 8 | abstract class SendToClientOptions 9 | implements Built { 10 | /// [SendToClientOptions] factory 11 | factory SendToClientOptions( 12 | [void Function(SendToClientOptionsBuilder) updates]) = 13 | _$SendToClientOptions; 14 | 15 | SendToClientOptions._(); 16 | 17 | /// [SendToClientOptions] serializer 18 | static Serializer get serializer => 19 | _$sendToClientOptionsSerializer; 20 | 21 | /// hash in the notification. (https://vk.com/appXXXX#fragment) 22 | String? get fragment; 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/data/model/options/send_to_client_options/send_to_client_options.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'send_to_client_options.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$sendToClientOptionsSerializer = 10 | new _$SendToClientOptionsSerializer(); 11 | 12 | class _$SendToClientOptionsSerializer 13 | implements StructuredSerializer { 14 | @override 15 | final Iterable types = const [ 16 | SendToClientOptions, 17 | _$SendToClientOptions 18 | ]; 19 | @override 20 | final String wireName = 'SendToClientOptions'; 21 | 22 | @override 23 | Iterable serialize( 24 | Serializers serializers, SendToClientOptions object, 25 | {FullType specifiedType = FullType.unspecified}) { 26 | final result = []; 27 | Object? value; 28 | value = object.fragment; 29 | if (value != null) { 30 | result 31 | ..add('fragment') 32 | ..add(serializers.serialize(value, 33 | specifiedType: const FullType(String))); 34 | } 35 | return result; 36 | } 37 | 38 | @override 39 | SendToClientOptions deserialize( 40 | Serializers serializers, Iterable serialized, 41 | {FullType specifiedType = FullType.unspecified}) { 42 | final result = new SendToClientOptionsBuilder(); 43 | 44 | final iterator = serialized.iterator; 45 | while (iterator.moveNext()) { 46 | final key = iterator.current! as String; 47 | iterator.moveNext(); 48 | final Object? value = iterator.current; 49 | switch (key) { 50 | case 'fragment': 51 | result.fragment = serializers.deserialize(value, 52 | specifiedType: const FullType(String)) as String?; 53 | break; 54 | } 55 | } 56 | 57 | return result.build(); 58 | } 59 | } 60 | 61 | class _$SendToClientOptions extends SendToClientOptions { 62 | @override 63 | final String? fragment; 64 | 65 | factory _$SendToClientOptions( 66 | [void Function(SendToClientOptionsBuilder)? updates]) => 67 | (new SendToClientOptionsBuilder()..update(updates))._build(); 68 | 69 | _$SendToClientOptions._({this.fragment}) : super._(); 70 | 71 | @override 72 | SendToClientOptions rebuild( 73 | void Function(SendToClientOptionsBuilder) updates) => 74 | (toBuilder()..update(updates)).build(); 75 | 76 | @override 77 | SendToClientOptionsBuilder toBuilder() => 78 | new SendToClientOptionsBuilder()..replace(this); 79 | 80 | @override 81 | bool operator ==(Object other) { 82 | if (identical(other, this)) return true; 83 | return other is SendToClientOptions && fragment == other.fragment; 84 | } 85 | 86 | @override 87 | int get hashCode { 88 | var _$hash = 0; 89 | _$hash = $jc(_$hash, fragment.hashCode); 90 | _$hash = $jf(_$hash); 91 | return _$hash; 92 | } 93 | 94 | @override 95 | String toString() { 96 | return (newBuiltValueToStringHelper(r'SendToClientOptions') 97 | ..add('fragment', fragment)) 98 | .toString(); 99 | } 100 | } 101 | 102 | class SendToClientOptionsBuilder 103 | implements Builder { 104 | _$SendToClientOptions? _$v; 105 | 106 | String? _fragment; 107 | String? get fragment => _$this._fragment; 108 | set fragment(String? fragment) => _$this._fragment = fragment; 109 | 110 | SendToClientOptionsBuilder(); 111 | 112 | SendToClientOptionsBuilder get _$this { 113 | final $v = _$v; 114 | if ($v != null) { 115 | _fragment = $v.fragment; 116 | _$v = null; 117 | } 118 | return this; 119 | } 120 | 121 | @override 122 | void replace(SendToClientOptions other) { 123 | ArgumentError.checkNotNull(other, 'other'); 124 | _$v = other as _$SendToClientOptions; 125 | } 126 | 127 | @override 128 | void update(void Function(SendToClientOptionsBuilder)? updates) { 129 | if (updates != null) updates(this); 130 | } 131 | 132 | @override 133 | SendToClientOptions build() => _build(); 134 | 135 | _$SendToClientOptions _build() { 136 | final _$result = _$v ?? new _$SendToClientOptions._(fragment: fragment); 137 | replace(_$result); 138 | return _$result; 139 | } 140 | } 141 | 142 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 143 | -------------------------------------------------------------------------------- /lib/src/data/model/options/set_swipe_settings_options/set_swipe_settings_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'set_swipe_settings_options.g.dart'; 6 | 7 | /// Options of [VKBridge.setSwipeSettings] 8 | abstract class SetSwipeSettingsOptions 9 | implements Built { 10 | /// [SetSwipeSettingsOptions] factory 11 | factory SetSwipeSettingsOptions( 12 | [void Function(SetSwipeSettingsOptionsBuilder) updates]) = 13 | _$SetSwipeSettingsOptions; 14 | 15 | SetSwipeSettingsOptions._(); 16 | 17 | /// [SetSwipeSettingsOptions] serializer 18 | static Serializer get serializer => 19 | _$setSwipeSettingsOptionsSerializer; 20 | 21 | /// Flag for configuring the browser to work with swipe on iOS. 22 | bool get history; 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/data/model/options/set_view_settings_options/set_view_settings_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | import 'package:vk_bridge/src/data/model/options/set_view_settings_options/status_bar_style.dart'; 5 | 6 | part 'set_view_settings_options.g.dart'; 7 | 8 | /// Options of [VKBridge.setViewSettings] 9 | abstract class SetViewSettingsOptions 10 | implements Built { 11 | /// [SetViewSettingsOptions] factory 12 | factory SetViewSettingsOptions( 13 | [void Function(SetViewSettingsOptionsBuilder) updates]) = 14 | _$SetViewSettingsOptions; 15 | 16 | SetViewSettingsOptions._(); 17 | 18 | /// [SetViewSettingsOptions] serializer 19 | static Serializer get serializer => 20 | _$setViewSettingsOptionsSerializer; 21 | 22 | /// Theme for status bar icons 23 | @BuiltValueField(wireName: 'status_bar_style') 24 | StatusBarStyle get statusBarStyle; 25 | 26 | /// The color of the action bar. 27 | /// Possible options: hex-code (# 00ffff), none - transparent. 28 | /// 29 | /// This parameter only works on Android 30 | @BuiltValueField(wireName: 'action_bar_color') 31 | String? get actionBarColor; 32 | 33 | /// The color of the navigation bar. 34 | /// Possible option: hex-code (# 00ffff). 35 | /// 36 | /// This parameter only works on Android 37 | @BuiltValueField(wireName: 'navigation_bar_color') 38 | String? get navigationBarColor; 39 | } 40 | -------------------------------------------------------------------------------- /lib/src/data/model/options/set_view_settings_options/status_bar_style.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | 5 | part 'status_bar_style.g.dart'; 6 | 7 | /// Status bar style for [SetViewSettingsOptions] 8 | class StatusBarStyle extends EnumClass { 9 | const StatusBarStyle._(String name) : super(name); 10 | 11 | /// Appearance serializer 12 | static Serializer get serializer => 13 | _$statusBarStyleSerializer; 14 | 15 | /// light 16 | static const StatusBarStyle light = _$light; 17 | 18 | /// dark 19 | static const StatusBarStyle dark = _$dark; 20 | 21 | /// List of all styles 22 | static BuiltSet get values => _$values; 23 | 24 | /// Parse style from string 25 | static StatusBarStyle valueOf(String name) => _$valueOf(name); 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/options/set_view_settings_options/status_bar_style.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'status_bar_style.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | const StatusBarStyle _$light = const StatusBarStyle._('light'); 10 | const StatusBarStyle _$dark = const StatusBarStyle._('dark'); 11 | 12 | StatusBarStyle _$valueOf(String name) { 13 | switch (name) { 14 | case 'light': 15 | return _$light; 16 | case 'dark': 17 | return _$dark; 18 | default: 19 | throw new ArgumentError(name); 20 | } 21 | } 22 | 23 | final BuiltSet _$values = 24 | new BuiltSet(const [ 25 | _$light, 26 | _$dark, 27 | ]); 28 | 29 | Serializer _$statusBarStyleSerializer = 30 | new _$StatusBarStyleSerializer(); 31 | 32 | class _$StatusBarStyleSerializer 33 | implements PrimitiveSerializer { 34 | @override 35 | final Iterable types = const [StatusBarStyle]; 36 | @override 37 | final String wireName = 'StatusBarStyle'; 38 | 39 | @override 40 | Object serialize(Serializers serializers, StatusBarStyle object, 41 | {FullType specifiedType = FullType.unspecified}) => 42 | object.name; 43 | 44 | @override 45 | StatusBarStyle deserialize(Serializers serializers, Object serialized, 46 | {FullType specifiedType = FullType.unspecified}) => 47 | StatusBarStyle.valueOf(serialized as String); 48 | } 49 | 50 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 51 | -------------------------------------------------------------------------------- /lib/src/data/model/options/share_options/share_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'share_options.g.dart'; 5 | 6 | /// Options for [VKBridge.share] 7 | abstract class ShareOptions 8 | implements Built { 9 | /// [ShareOptions] factory 10 | factory ShareOptions([void Function(ShareOptionsBuilder) updates]) = 11 | _$ShareOptions; 12 | 13 | ShareOptions._(); 14 | 15 | /// [ShareOptions] serializer 16 | static Serializer get serializer => _$shareOptionsSerializer; 17 | 18 | /// Link for sharing 19 | /// (by default - the current link in the form of https://vk.com/app123#hash) 20 | String? get link; 21 | } 22 | -------------------------------------------------------------------------------- /lib/src/data/model/options/share_options/share_options.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'share_options.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$shareOptionsSerializer = 10 | new _$ShareOptionsSerializer(); 11 | 12 | class _$ShareOptionsSerializer implements StructuredSerializer { 13 | @override 14 | final Iterable types = const [ShareOptions, _$ShareOptions]; 15 | @override 16 | final String wireName = 'ShareOptions'; 17 | 18 | @override 19 | Iterable serialize(Serializers serializers, ShareOptions object, 20 | {FullType specifiedType = FullType.unspecified}) { 21 | final result = []; 22 | Object? value; 23 | value = object.link; 24 | if (value != null) { 25 | result 26 | ..add('link') 27 | ..add(serializers.serialize(value, 28 | specifiedType: const FullType(String))); 29 | } 30 | return result; 31 | } 32 | 33 | @override 34 | ShareOptions deserialize( 35 | Serializers serializers, Iterable serialized, 36 | {FullType specifiedType = FullType.unspecified}) { 37 | final result = new ShareOptionsBuilder(); 38 | 39 | final iterator = serialized.iterator; 40 | while (iterator.moveNext()) { 41 | final key = iterator.current! as String; 42 | iterator.moveNext(); 43 | final Object? value = iterator.current; 44 | switch (key) { 45 | case 'link': 46 | result.link = serializers.deserialize(value, 47 | specifiedType: const FullType(String)) as String?; 48 | break; 49 | } 50 | } 51 | 52 | return result.build(); 53 | } 54 | } 55 | 56 | class _$ShareOptions extends ShareOptions { 57 | @override 58 | final String? link; 59 | 60 | factory _$ShareOptions([void Function(ShareOptionsBuilder)? updates]) => 61 | (new ShareOptionsBuilder()..update(updates))._build(); 62 | 63 | _$ShareOptions._({this.link}) : super._(); 64 | 65 | @override 66 | ShareOptions rebuild(void Function(ShareOptionsBuilder) updates) => 67 | (toBuilder()..update(updates)).build(); 68 | 69 | @override 70 | ShareOptionsBuilder toBuilder() => new ShareOptionsBuilder()..replace(this); 71 | 72 | @override 73 | bool operator ==(Object other) { 74 | if (identical(other, this)) return true; 75 | return other is ShareOptions && link == other.link; 76 | } 77 | 78 | @override 79 | int get hashCode { 80 | var _$hash = 0; 81 | _$hash = $jc(_$hash, link.hashCode); 82 | _$hash = $jf(_$hash); 83 | return _$hash; 84 | } 85 | 86 | @override 87 | String toString() { 88 | return (newBuiltValueToStringHelper(r'ShareOptions')..add('link', link)) 89 | .toString(); 90 | } 91 | } 92 | 93 | class ShareOptionsBuilder 94 | implements Builder { 95 | _$ShareOptions? _$v; 96 | 97 | String? _link; 98 | String? get link => _$this._link; 99 | set link(String? link) => _$this._link = link; 100 | 101 | ShareOptionsBuilder(); 102 | 103 | ShareOptionsBuilder get _$this { 104 | final $v = _$v; 105 | if ($v != null) { 106 | _link = $v.link; 107 | _$v = null; 108 | } 109 | return this; 110 | } 111 | 112 | @override 113 | void replace(ShareOptions other) { 114 | ArgumentError.checkNotNull(other, 'other'); 115 | _$v = other as _$ShareOptions; 116 | } 117 | 118 | @override 119 | void update(void Function(ShareOptionsBuilder)? updates) { 120 | if (updates != null) updates(this); 121 | } 122 | 123 | @override 124 | ShareOptions build() => _build(); 125 | 126 | _$ShareOptions _build() { 127 | final _$result = _$v ?? new _$ShareOptions._(link: link); 128 | replace(_$result); 129 | return _$result; 130 | } 131 | } 132 | 133 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 134 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_community_widget_preview_box_options/show_community_widget_preview_box_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'show_community_widget_preview_box_options.g.dart'; 6 | 7 | /// Options of [VKBridge.showCommunityWidgetPreviewBox] 8 | abstract class ShowCommunityWidgetPreviewBoxOptions 9 | implements 10 | Built { 12 | /// [ShowCommunityWidgetPreviewBoxOptions] factory 13 | factory ShowCommunityWidgetPreviewBoxOptions( 14 | [void Function(ShowCommunityWidgetPreviewBoxOptionsBuilder) 15 | updates]) = _$ShowCommunityWidgetPreviewBoxOptions; 16 | 17 | ShowCommunityWidgetPreviewBoxOptions._(); 18 | 19 | /// [ShowCommunityWidgetPreviewBoxOptions] serializer 20 | static Serializer get serializer => 21 | _$showCommunityWidgetPreviewBoxOptionsSerializer; 22 | 23 | /// Group ID. 24 | @BuiltValueField(wireName: 'group_id') 25 | int get groupId; 26 | 27 | /// Widget type. Can take values: 28 | /// text, 29 | /// list, 30 | /// table, 31 | /// tiles, 32 | /// compact_list, 33 | /// cover_list, 34 | /// match, 35 | /// matches, 36 | /// donation. 37 | String get type; 38 | 39 | /// [code] - Widget code. 40 | String get code; 41 | } 42 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_images_options/show_images_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | 5 | part 'show_images_options.g.dart'; 6 | 7 | /// Options for [VKBridge.showImages] 8 | abstract class ShowImagesOptions 9 | implements Built { 10 | /// [ShowImagesOptions] factory 11 | factory ShowImagesOptions([void Function(ShowImagesOptionsBuilder) updates]) = 12 | _$ShowImagesOptions; 13 | 14 | ShowImagesOptions._(); 15 | 16 | /// [ShowImagesOptions] serializer 17 | static Serializer get serializer => 18 | _$showImagesOptionsSerializer; 19 | 20 | /// An array of strings containing image URLs. 21 | BuiltList get images; 22 | 23 | /// Index of the picture from which to start displaying, starting from 0 24 | @BuiltValueField(wireName: 'start_index') 25 | int? get startIndex; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_native_ads_options/show_native_ads_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | import 'package:vk_bridge/src/data/model/options/check_native_ads/ad_format.dart'; 5 | 6 | part 'show_native_ads_options.g.dart'; 7 | 8 | /// Options of [VKBridge.showNativeAds] 9 | abstract class ShowNativeAdsOptions 10 | implements Built { 11 | /// [ShowNativeAdsOptions] factory 12 | factory ShowNativeAdsOptions( 13 | [void Function(ShowNativeAdsOptionsBuilder) updates]) = 14 | _$ShowNativeAdsOptions; 15 | 16 | ShowNativeAdsOptions._(); 17 | 18 | /// [ShowNativeAdsOptions] serializer 19 | static Serializer get serializer => 20 | _$showNativeAdsOptionsSerializer; 21 | 22 | /// Type of advertisement 23 | @BuiltValueField(wireName: 'ad_format') 24 | AdFormat get adFormat; 25 | 26 | /// Only for adFormat = reward. 27 | /// Whether to use the interstitial advertising mechanism when there is no rewarded video 28 | @BuiltValueField(wireName: 'use_waterfall') 29 | bool? get useWaterfall; 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_order_box_options/show_order_box_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'show_order_box_options.g.dart'; 6 | 7 | /// Options of [VKBridge.showOrderBox] 8 | abstract class ShowOrderBoxOptions 9 | implements Built { 10 | /// [ShowOrderBoxOptions] factory 11 | factory ShowOrderBoxOptions( 12 | [void Function(ShowOrderBoxOptionsBuilder) updates]) = 13 | _$ShowOrderBoxOptions; 14 | 15 | ShowOrderBoxOptions._(); 16 | 17 | /// [ShowOrderBoxOptions] serializer 18 | static Serializer get serializer => 19 | _$showOrderBoxOptionsSerializer; 20 | 21 | /// The type of virtual value 22 | String get type; 23 | 24 | /// The virtual value item 25 | String get item; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_story_box_options/action.dart: -------------------------------------------------------------------------------- 1 | /// Action 2 | abstract class Action {} 3 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_story_box_options/action_app.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/data/model/options/show_story_box_options/action.dart'; 4 | 5 | part 'action_app.g.dart'; 6 | 7 | /// Action app 8 | abstract class ActionApp implements Built, Action { 9 | /// [ActionApp] factory 10 | factory ActionApp([void Function(ActionAppBuilder) updates]) = _$ActionApp; 11 | 12 | ActionApp._(); 13 | 14 | /// [ActionApp] serializer 15 | static Serializer get serializer => _$actionAppSerializer; 16 | 17 | /// Application ID 18 | @BuiltValueField(wireName: 'app_id') 19 | int get appId; 20 | 21 | /// If the application is opened from history, then in the launch parameters, 22 | /// in vk_ref, the value of story 23 | /// {owner_id}_{story_id}_{access_key}_{sticker_id}_{context} 24 | /// context - Base64 string. Maximum 500 characters 25 | @BuiltValueField(wireName: 'app_context') 26 | String? get appContext; 27 | } 28 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_story_box_options/action_link.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/data/model/options/show_story_box_options/action.dart'; 4 | 5 | part 'action_link.g.dart'; 6 | 7 | /// Action link 8 | abstract class ActionLink 9 | implements Built, Action { 10 | /// [ActionLink] factory 11 | factory ActionLink([void Function(ActionLinkBuilder) updates]) = _$ActionLink; 12 | 13 | ActionLink._(); 14 | 15 | /// [ActionLink] serializer 16 | static Serializer get serializer => _$actionLinkSerializer; 17 | 18 | /// Link to content 19 | String get link; 20 | 21 | // TODO(sanekyy): enum 22 | /// The value of the string that will be displayed on the client when the 23 | /// tooltip is clicked. Possible values: 24 | /// - tooltip_open_post - open a post 25 | /// - tooltip_open_photo - open photo 26 | /// - tooltip_open_page - open the page 27 | /// - tooltip_open_default - go. This value is passed by default 28 | @BuiltValueField(wireName: 'tooltip_text_key') 29 | String get tooltipTextKey; 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_story_box_options/attachment.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'attachment.g.dart'; 5 | 6 | /// Attachment 7 | abstract class Attachment implements Built { 8 | /// [Attachment] factory 9 | factory Attachment([void Function(AttachmentBuilder) updates]) = _$Attachment; 10 | 11 | Attachment._(); 12 | 13 | /// [Attachment] serializer 14 | static Serializer get serializer => _$attachmentSerializer; 15 | 16 | // TODO(sanekyy): enum 17 | /// Key for button text 18 | /// Possible values: 19 | /// - to_store - "To the store" 20 | /// - vote - "Vote" 21 | /// - more - "More" 22 | /// - book - "Book" 23 | /// - order - "Order" 24 | /// - enroll - "Sign up" 25 | /// - fill - "Fill" 26 | /// - signup - "Register" 27 | /// - buy - "Buy" 28 | /// - ticket - "Buy a ticket" 29 | /// - write - "Write" 30 | /// - open - "Open" 31 | /// - learn_more - "More details" (default) 32 | /// - view - "View" 33 | /// - go_to - "Go" 34 | /// - contact - "Contact" 35 | /// - watch - "Watch" 36 | /// - play - "Listen" 37 | /// - install - "Install" 38 | /// - read - "Read" 39 | /// - game - "Play" 40 | String get text; 41 | 42 | // TODO(sanekyy): enum 43 | /// Attachment type. Possible values: 44 | /// - url 45 | /// - audio 46 | /// - video 47 | /// - photo 48 | String get type; 49 | 50 | /// Link to content 51 | String? get url; 52 | } 53 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_story_box_options/background_type.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | 5 | part 'background_type.g.dart'; 6 | 7 | /// Types for [ShowStoryBoxOptions.backgroundType] 8 | class BackgroundType extends EnumClass { 9 | const BackgroundType._(String name) : super(name); 10 | 11 | /// BackgroundType serializer 12 | static Serializer get serializer => 13 | _$backgroundTypeSerializer; 14 | 15 | /// image (platforms: iOS, Android, Web, Mobile Web) 16 | static const BackgroundType image = _$image; 17 | 18 | /// video (platforms: iOS, Android) 19 | static const BackgroundType video = _$video; 20 | 21 | /// none (if the sticker is sent directly to the camera, platforms: iOS, Android) 22 | static const BackgroundType none = _$none; 23 | 24 | /// List of all types 25 | static BuiltSet get values => _$values; 26 | 27 | /// Parse BackgroundType from string 28 | static BackgroundType valueOf(String name) => _$valueOf(name); 29 | } 30 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_story_box_options/background_type.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'background_type.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | const BackgroundType _$image = const BackgroundType._('image'); 10 | const BackgroundType _$video = const BackgroundType._('video'); 11 | const BackgroundType _$none = const BackgroundType._('none'); 12 | 13 | BackgroundType _$valueOf(String name) { 14 | switch (name) { 15 | case 'image': 16 | return _$image; 17 | case 'video': 18 | return _$video; 19 | case 'none': 20 | return _$none; 21 | default: 22 | throw new ArgumentError(name); 23 | } 24 | } 25 | 26 | final BuiltSet _$values = 27 | new BuiltSet(const [ 28 | _$image, 29 | _$video, 30 | _$none, 31 | ]); 32 | 33 | Serializer _$backgroundTypeSerializer = 34 | new _$BackgroundTypeSerializer(); 35 | 36 | class _$BackgroundTypeSerializer 37 | implements PrimitiveSerializer { 38 | @override 39 | final Iterable types = const [BackgroundType]; 40 | @override 41 | final String wireName = 'BackgroundType'; 42 | 43 | @override 44 | Object serialize(Serializers serializers, BackgroundType object, 45 | {FullType specifiedType = FullType.unspecified}) => 46 | object.name; 47 | 48 | @override 49 | BackgroundType deserialize(Serializers serializers, Object serialized, 50 | {FullType specifiedType = FullType.unspecified}) => 51 | BackgroundType.valueOf(serialized as String); 52 | } 53 | 54 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 55 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_story_box_options/clickable_zone.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/data/model/options/show_story_box_options/action.dart'; 4 | 5 | part 'clickable_zone.g.dart'; 6 | 7 | /// Clickable zone 8 | abstract class ClickableZone 9 | implements Built { 10 | /// [ClickableZone] factory 11 | factory ClickableZone([void Function(ClickableZoneBuilder) updates]) = 12 | _$ClickableZone; 13 | 14 | ClickableZone._(); 15 | 16 | /// [ClickableZone] serializer 17 | static Serializer get serializer => _$clickableZoneSerializer; 18 | 19 | // TODO(sanekyy): enum 20 | /// Describes the type of click action. Possible values: 21 | /// - link 22 | @BuiltValueField(wireName: 'action_type') 23 | String get actionType; 24 | 25 | /// Action 26 | Action get action; 27 | } 28 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_story_box_options/renderable_sticker.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | import 'package:vk_bridge/src/data/model/options/show_story_box_options/clickable_zone.dart'; 5 | import 'package:vk_bridge/src/data/model/options/show_story_box_options/transform.dart'; 6 | 7 | part 'renderable_sticker.g.dart'; 8 | 9 | /// Renderable sticker 10 | abstract class RenderableSticker 11 | implements Built { 12 | /// [RenderableSticker] factory 13 | factory RenderableSticker([void Function(RenderableStickerBuilder) updates]) = 14 | _$RenderableSticker; 15 | 16 | RenderableSticker._(); 17 | 18 | /// [RenderableSticker] serializer 19 | static Serializer get serializer => 20 | _$renderableStickerSerializer; 21 | 22 | // TODO(sanekyy): enum 23 | /// Story type. Possible values 24 | /// - image 25 | @BuiltValueField(wireName: 'content_type') 26 | String get contentType; 27 | 28 | /// Link to content. Required if [blob] field is not specified 29 | String? get url; 30 | 31 | /// Transformation of the object 32 | Transform? get transform; 33 | 34 | /// An array of content areas, clicking on which can trigger some kind of 35 | /// action 36 | @BuiltValueField(wireName: 'clickable_zones') 37 | BuiltList get clickableZones; 38 | 39 | /// Whether the sticker can be removed from the screen, default is true 40 | @BuiltValueField(wireName: 'can_delete') 41 | bool get canDelete; 42 | } 43 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_story_box_options/show_story_box_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | import 'package:vk_bridge/src/data/model/options/show_story_box_options/attachment.dart'; 5 | import 'package:vk_bridge/src/data/model/options/show_story_box_options/background_type.dart'; 6 | import 'package:vk_bridge/src/data/model/options/show_story_box_options/sticker_container.dart'; 7 | 8 | part 'show_story_box_options.g.dart'; 9 | 10 | /// Options for showStoryBox method 11 | abstract class ShowStoryBoxOptions 12 | implements Built { 13 | /// [ShowStoryBoxOptions] factory 14 | factory ShowStoryBoxOptions( 15 | [void Function(ShowStoryBoxOptionsBuilder) updates]) = 16 | _$ShowStoryBoxOptions; 17 | 18 | ShowStoryBoxOptions._(); 19 | 20 | /// [ShowStoryBoxOptions] serializer 21 | static Serializer get serializer => 22 | _$showStoryBoxOptionsSerializer; 23 | 24 | /// Story type. Possible values: 25 | /// - image (Platforms: iOS, Android, Web, Mobile Web) 26 | /// - video (Platforms: iOS, Android) 27 | /// - none (for the case of transferring the sticker directly to the camera, 28 | /// Platforms: iOS, Android). 29 | @BuiltValueField(wireName: 'background_type') 30 | BackgroundType get backgroundType; 31 | 32 | /// Link to an image or video (the transmission must follow a direct link to 33 | /// mp4) 34 | String? get url; 35 | 36 | /// Base64 string with BLOB (only supported for image). 37 | /// The following prefix must be added before the string: 38 | /// data:image/png;base64, or data:image/jpeg;base64, 39 | /// depending on the image type 40 | String? get blob; 41 | 42 | /// Description of the object of attachment to history 43 | Attachment? get attachment; 44 | 45 | /// Is it possible to move a photo 46 | bool get locked; 47 | 48 | /// An array of objects describing stickers on the canvas 49 | BuiltList? get stickers; 50 | } 51 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_story_box_options/sticker_container.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/data/model/options/show_story_box_options/renderable_sticker.dart'; 4 | 5 | part 'sticker_container.g.dart'; 6 | 7 | /// Sticker container 8 | abstract class StickerContainer 9 | implements Built { 10 | /// [StickerContainer] factory 11 | factory StickerContainer([void Function(StickerContainerBuilder) updates]) = 12 | _$StickerContainer; 13 | 14 | StickerContainer._(); 15 | 16 | /// [StickerContainer] serializer 17 | static Serializer get serializer => 18 | _$stickerContainerSerializer; 19 | 20 | // TODO(sanekyy): enum 21 | /// Type of sticker. Possible values: 22 | /// - renderable 23 | @BuiltValueField(wireName: 'sticker_type') 24 | String get stickerType; 25 | 26 | /// Sticker object 27 | RenderableSticker get sticker; 28 | } 29 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_story_box_options/transform.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'transform.g.dart'; 5 | 6 | /// Transform 7 | abstract class Transform implements Built { 8 | /// [Transform] factory 9 | factory Transform([void Function(TransformBuilder) updates]) = _$Transform; 10 | 11 | Transform._(); 12 | 13 | /// [Transform] serializer 14 | static Serializer get serializer => _$transformSerializer; 15 | 16 | /// Degrees. From 0 to 359. Counterclockwise rotation 17 | int? get rotation; 18 | 19 | /// The desired width of the sticker relative to the screen is (0, 1), the 20 | /// height will be calculated taking into account the preservation of the 21 | /// aspect ratio of the content 22 | @BuiltValueField(wireName: 'relation_width') 23 | double? get relationWidth; 24 | 25 | /// -1 to 1. From the width of the screen 26 | @BuiltValueField(wireName: 'translation_x') 27 | double? get translationX; 28 | 29 | /// -1 to 1. From the height of the screen 30 | @BuiltValueField(wireName: 'translation_y') 31 | double? get translationY; 32 | 33 | // TODO(sanekyy): enum 34 | /// Gravity. Default: center. Possible values: 35 | /// - left_top 36 | /// - left_center 37 | /// - left_bottom 38 | /// - center_top 39 | /// - center 40 | /// - center_bottom 41 | /// - right_top 42 | /// - right_center 43 | /// - right_bottom 44 | String? get gravity; 45 | } 46 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_wall_post_box_options/show_wall_post_box_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'show_wall_post_box_options.g.dart'; 6 | 7 | /// Options for [VKBridge.showWallPostBox] 8 | abstract class VKWebAppShowWallPostBoxOptions 9 | implements 10 | Built { 12 | /// [VKWebAppShowWallPostBoxOptions] factory 13 | factory VKWebAppShowWallPostBoxOptions( 14 | [void Function(VKWebAppShowWallPostBoxOptionsBuilder) updates]) = 15 | _$VKWebAppShowWallPostBoxOptions; 16 | 17 | VKWebAppShowWallPostBoxOptions._(); 18 | 19 | /// [VKWebAppShowWallPostBoxOptions] serializer 20 | static Serializer get serializer => 21 | _$vKWebAppShowWallPostBoxOptionsSerializer; 22 | 23 | /// user wall post ID 24 | String get message; 25 | } 26 | -------------------------------------------------------------------------------- /lib/src/data/model/options/show_wall_post_options/show_wall_post_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'show_wall_post_options.g.dart'; 6 | 7 | /// Options of [VKBridge.openWallPost] 8 | abstract class OpenWallPostOptions 9 | implements Built { 10 | /// [OpenWallPostOptions] factory 11 | factory OpenWallPostOptions( 12 | [void Function(OpenWallPostOptionsBuilder) updates]) = 13 | _$OpenWallPostOptions; 14 | 15 | OpenWallPostOptions._(); 16 | 17 | /// [OpenWallPostOptions] serializer 18 | static Serializer get serializer => 19 | _$openWallPostOptionsSerializer; 20 | 21 | /// The ID of the community (negative number) or user (positive number) 22 | /// on whose wall the entry was published 23 | @BuiltValueField(wireName: 'owner_id') 24 | int get ownerId; 25 | 26 | /// The ID of the entry on the wall (a positive number) 27 | @BuiltValueField(wireName: 'post_id') 28 | int get postId; 29 | } 30 | -------------------------------------------------------------------------------- /lib/src/data/model/options/storage_get_keys_options/storage_get_keys_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'storage_get_keys_options.g.dart'; 6 | 7 | /// Options for [VKBridge.copyText] 8 | abstract class StorageGetKeysOptions 9 | implements Built { 10 | /// [StorageGetKeysOptions] factory 11 | factory StorageGetKeysOptions( 12 | [void Function(StorageGetKeysOptionsBuilder) updates]) = 13 | _$StorageGetKeysOptions; 14 | 15 | StorageGetKeysOptions._(); 16 | 17 | /// [StorageGetKeysOptions] serializer 18 | static Serializer get serializer => 19 | _$storageGetKeysOptionsSerializer; 20 | 21 | /// The number of variable names to get information about. 22 | int? get count; 23 | 24 | /// The offset required to sample a specific subset of variable names. 25 | int get offset; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/options/storage_get_options/storage_get_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 5 | 6 | part 'storage_get_options.g.dart'; 7 | 8 | /// Options for [VKBridge.copyText] 9 | abstract class StorageGetOptions 10 | implements Built { 11 | /// [StorageGetOptions] factory 12 | factory StorageGetOptions([void Function(StorageGetOptionsBuilder) updates]) = 13 | _$StorageGetOptions; 14 | 15 | StorageGetOptions._(); 16 | 17 | /// [StorageGetOptions] serializer 18 | static Serializer get serializer => 19 | _$storageGetOptionsSerializer; 20 | 21 | /// The names of the keys, [a-zA-Z _ \ - 0-9], 22 | /// passed in an array of strings. 23 | BuiltList get keys; 24 | } 25 | -------------------------------------------------------------------------------- /lib/src/data/model/options/storage_set_options/storage_set_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'storage_set_options.g.dart'; 6 | 7 | /// Options for [VKBridge.storageSet] 8 | abstract class StorageSetOptions 9 | implements Built { 10 | /// [StorageSetOptions] factory 11 | factory StorageSetOptions([void Function(StorageSetOptionsBuilder) updates]) = 12 | _$StorageSetOptions; 13 | 14 | StorageSetOptions._(); 15 | 16 | /// [StorageSetOptions] serializer 17 | static Serializer get serializer => 18 | _$storageSetOptionsSerializer; 19 | 20 | /// Key name, [a-zA-Z _ \ - 0-9]. The maximum length is 100 characters. 21 | String get key; 22 | 23 | /// Variable value, only the first 4096 bytes are saved. 24 | String? get value; 25 | } 26 | -------------------------------------------------------------------------------- /lib/src/data/model/options/subscribe_story_app_options/subscribe_story_app_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'subscribe_story_app_options.g.dart'; 6 | 7 | /// Options of [VKBridge.subscribeStoryApp] 8 | /// Returned in launch parameters, vk_ref field 9 | abstract class SubscribeStoryAppOptions 10 | implements 11 | Built { 12 | /// [SubscribeStoryAppOptions] factory 13 | factory SubscribeStoryAppOptions( 14 | [void Function(SubscribeStoryAppOptionsBuilder) updates]) = 15 | _$SubscribeStoryAppOptions; 16 | 17 | SubscribeStoryAppOptions._(); 18 | 19 | /// [SubscribeStoryAppOptions] serializer 20 | static Serializer get serializer => 21 | _$subscribeStoryAppOptionsSerializer; 22 | 23 | /// The story owner ID. 24 | @BuiltValueField(wireName: 'story_owner_id') 25 | int get storyOwnerId; 26 | 27 | /// The story ID.. 28 | @BuiltValueField(wireName: 'story_id') 29 | int get storyId; 30 | 31 | /// The ID of the clickable sticker. 32 | @BuiltValueField(wireName: 'sticker_id') 33 | int get stickerId; 34 | 35 | /// Access key for private stories. 36 | @BuiltValueField(wireName: 'access_key') 37 | String? get accessKey; 38 | } 39 | -------------------------------------------------------------------------------- /lib/src/data/model/options/taptic_impact_occured_options/taptic_impact_occured_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | import 'package:vk_bridge/src/data/model/options/taptic_impact_occured_options/taptic_style.dart'; 5 | 6 | part 'taptic_impact_occured_options.g.dart'; 7 | 8 | /// Options of [VKBridge.tapticImpactOccurred] 9 | abstract class TapticImpactOccurredOptions 10 | implements 11 | Built { 12 | /// [TapticImpactOccurredOptions] factory 13 | factory TapticImpactOccurredOptions( 14 | [void Function(TapticImpactOccurredOptionsBuilder) updates]) = 15 | _$TapticImpactOccurredOptions; 16 | 17 | TapticImpactOccurredOptions._(); 18 | 19 | /// [TapticImpactOccurredOptions] serializer 20 | static Serializer get serializer => 21 | _$tapticImpactOccurredOptionsSerializer; 22 | 23 | /// The strength of vibration 24 | TapticStyle get style; 25 | } 26 | -------------------------------------------------------------------------------- /lib/src/data/model/options/taptic_impact_occured_options/taptic_style.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | 5 | part 'taptic_style.g.dart'; 6 | 7 | /// Styles for [TapticImpactOccurredOptions] 8 | class TapticStyle extends EnumClass { 9 | const TapticStyle._(String name) : super(name); 10 | 11 | /// Scope serializer 12 | static Serializer get serializer => _$tapticStyleSerializer; 13 | 14 | /// light 15 | static const TapticStyle light = _$light; 16 | 17 | /// medium 18 | static const TapticStyle medium = _$medium; 19 | 20 | /// heavy 21 | static const TapticStyle heavy = _$heavy; 22 | 23 | /// List of all styles 24 | static BuiltSet get values => _$values; 25 | 26 | /// Parse style from string 27 | static TapticStyle valueOf(String name) => _$valueOf(name); 28 | } 29 | -------------------------------------------------------------------------------- /lib/src/data/model/options/taptic_impact_occured_options/taptic_style.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'taptic_style.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | const TapticStyle _$light = const TapticStyle._('light'); 10 | const TapticStyle _$medium = const TapticStyle._('medium'); 11 | const TapticStyle _$heavy = const TapticStyle._('heavy'); 12 | 13 | TapticStyle _$valueOf(String name) { 14 | switch (name) { 15 | case 'light': 16 | return _$light; 17 | case 'medium': 18 | return _$medium; 19 | case 'heavy': 20 | return _$heavy; 21 | default: 22 | throw new ArgumentError(name); 23 | } 24 | } 25 | 26 | final BuiltSet _$values = 27 | new BuiltSet(const [ 28 | _$light, 29 | _$medium, 30 | _$heavy, 31 | ]); 32 | 33 | Serializer _$tapticStyleSerializer = new _$TapticStyleSerializer(); 34 | 35 | class _$TapticStyleSerializer implements PrimitiveSerializer { 36 | @override 37 | final Iterable types = const [TapticStyle]; 38 | @override 39 | final String wireName = 'TapticStyle'; 40 | 41 | @override 42 | Object serialize(Serializers serializers, TapticStyle object, 43 | {FullType specifiedType = FullType.unspecified}) => 44 | object.name; 45 | 46 | @override 47 | TapticStyle deserialize(Serializers serializers, Object serialized, 48 | {FullType specifiedType = FullType.unspecified}) => 49 | TapticStyle.valueOf(serialized as String); 50 | } 51 | 52 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 53 | -------------------------------------------------------------------------------- /lib/src/data/model/options/taptic_notification_occured_options/taptic_notification_occured_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | import 'package:vk_bridge/src/data/model/options/taptic_notification_occured_options/taptic_type.dart'; 5 | 6 | part 'taptic_notification_occured_options.g.dart'; 7 | 8 | /// Options of [VKBridge.tapticNotificationOccurred] 9 | abstract class TapticNotificationOccurredOptions 10 | implements 11 | Built { 13 | /// [TapticNotificationOccurredOptions] factory 14 | factory TapticNotificationOccurredOptions( 15 | [void Function(TapticNotificationOccurredOptionsBuilder) updates]) = 16 | _$TapticNotificationOccurredOptions; 17 | 18 | TapticNotificationOccurredOptions._(); 19 | 20 | /// [TapticNotificationOccurredOptions] serializer 21 | static Serializer get serializer => 22 | _$tapticNotificationOccurredOptionsSerializer; 23 | 24 | /// The type of notification 25 | TapticType get type; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/options/taptic_notification_occured_options/taptic_type.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | 5 | part 'taptic_type.g.dart'; 6 | 7 | /// Types for [TapticNotificationOccurredOptions] 8 | class TapticType extends EnumClass { 9 | const TapticType._(String name) : super(name); 10 | 11 | /// Scope serializer 12 | static Serializer get serializer => _$tapticTypeSerializer; 13 | 14 | /// error 15 | static const TapticType error = _$error; 16 | 17 | /// success 18 | static const TapticType success = _$success; 19 | 20 | /// warning 21 | static const TapticType warning = _$warning; 22 | 23 | /// List of all types 24 | static BuiltSet get values => _$values; 25 | 26 | /// Parse type from string 27 | static TapticType valueOf(String name) => _$valueOf(name); 28 | } 29 | -------------------------------------------------------------------------------- /lib/src/data/model/options/taptic_notification_occured_options/taptic_type.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'taptic_type.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | const TapticType _$error = const TapticType._('error'); 10 | const TapticType _$success = const TapticType._('success'); 11 | const TapticType _$warning = const TapticType._('warning'); 12 | 13 | TapticType _$valueOf(String name) { 14 | switch (name) { 15 | case 'error': 16 | return _$error; 17 | case 'success': 18 | return _$success; 19 | case 'warning': 20 | return _$warning; 21 | default: 22 | throw new ArgumentError(name); 23 | } 24 | } 25 | 26 | final BuiltSet _$values = 27 | new BuiltSet(const [ 28 | _$error, 29 | _$success, 30 | _$warning, 31 | ]); 32 | 33 | Serializer _$tapticTypeSerializer = new _$TapticTypeSerializer(); 34 | 35 | class _$TapticTypeSerializer implements PrimitiveSerializer { 36 | @override 37 | final Iterable types = const [TapticType]; 38 | @override 39 | final String wireName = 'TapticType'; 40 | 41 | @override 42 | Object serialize(Serializers serializers, TapticType object, 43 | {FullType specifiedType = FullType.unspecified}) => 44 | object.name; 45 | 46 | @override 47 | TapticType deserialize(Serializers serializers, Object serialized, 48 | {FullType specifiedType = FullType.unspecified}) => 49 | TapticType.valueOf(serialized as String); 50 | } 51 | 52 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 53 | -------------------------------------------------------------------------------- /lib/src/data/model/results/common/city.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'city.g.dart'; 5 | 6 | /// The city 7 | abstract class City implements Built { 8 | /// [City] factory 9 | factory City([void Function(CityBuilder) updates]) = _$City; 10 | 11 | City._(); 12 | 13 | /// [City] serializer 14 | static Serializer get serializer => _$citySerializer; 15 | 16 | /// City identifier 17 | int? get id; 18 | 19 | /// City name 20 | String? get title; 21 | } 22 | -------------------------------------------------------------------------------- /lib/src/data/model/results/common/city.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'city.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$citySerializer = new _$CitySerializer(); 10 | 11 | class _$CitySerializer implements StructuredSerializer { 12 | @override 13 | final Iterable types = const [City, _$City]; 14 | @override 15 | final String wireName = 'City'; 16 | 17 | @override 18 | Iterable serialize(Serializers serializers, City object, 19 | {FullType specifiedType = FullType.unspecified}) { 20 | final result = []; 21 | Object? value; 22 | value = object.id; 23 | if (value != null) { 24 | result 25 | ..add('id') 26 | ..add(serializers.serialize(value, specifiedType: const FullType(int))); 27 | } 28 | value = object.title; 29 | if (value != null) { 30 | result 31 | ..add('title') 32 | ..add(serializers.serialize(value, 33 | specifiedType: const FullType(String))); 34 | } 35 | return result; 36 | } 37 | 38 | @override 39 | City deserialize(Serializers serializers, Iterable serialized, 40 | {FullType specifiedType = FullType.unspecified}) { 41 | final result = new CityBuilder(); 42 | 43 | final iterator = serialized.iterator; 44 | while (iterator.moveNext()) { 45 | final key = iterator.current! as String; 46 | iterator.moveNext(); 47 | final Object? value = iterator.current; 48 | switch (key) { 49 | case 'id': 50 | result.id = serializers.deserialize(value, 51 | specifiedType: const FullType(int)) as int?; 52 | break; 53 | case 'title': 54 | result.title = serializers.deserialize(value, 55 | specifiedType: const FullType(String)) as String?; 56 | break; 57 | } 58 | } 59 | 60 | return result.build(); 61 | } 62 | } 63 | 64 | class _$City extends City { 65 | @override 66 | final int? id; 67 | @override 68 | final String? title; 69 | 70 | factory _$City([void Function(CityBuilder)? updates]) => 71 | (new CityBuilder()..update(updates))._build(); 72 | 73 | _$City._({this.id, this.title}) : super._(); 74 | 75 | @override 76 | City rebuild(void Function(CityBuilder) updates) => 77 | (toBuilder()..update(updates)).build(); 78 | 79 | @override 80 | CityBuilder toBuilder() => new CityBuilder()..replace(this); 81 | 82 | @override 83 | bool operator ==(Object other) { 84 | if (identical(other, this)) return true; 85 | return other is City && id == other.id && title == other.title; 86 | } 87 | 88 | @override 89 | int get hashCode { 90 | var _$hash = 0; 91 | _$hash = $jc(_$hash, id.hashCode); 92 | _$hash = $jc(_$hash, title.hashCode); 93 | _$hash = $jf(_$hash); 94 | return _$hash; 95 | } 96 | 97 | @override 98 | String toString() { 99 | return (newBuiltValueToStringHelper(r'City') 100 | ..add('id', id) 101 | ..add('title', title)) 102 | .toString(); 103 | } 104 | } 105 | 106 | class CityBuilder implements Builder { 107 | _$City? _$v; 108 | 109 | int? _id; 110 | int? get id => _$this._id; 111 | set id(int? id) => _$this._id = id; 112 | 113 | String? _title; 114 | String? get title => _$this._title; 115 | set title(String? title) => _$this._title = title; 116 | 117 | CityBuilder(); 118 | 119 | CityBuilder get _$this { 120 | final $v = _$v; 121 | if ($v != null) { 122 | _id = $v.id; 123 | _title = $v.title; 124 | _$v = null; 125 | } 126 | return this; 127 | } 128 | 129 | @override 130 | void replace(City other) { 131 | ArgumentError.checkNotNull(other, 'other'); 132 | _$v = other as _$City; 133 | } 134 | 135 | @override 136 | void update(void Function(CityBuilder)? updates) { 137 | if (updates != null) updates(this); 138 | } 139 | 140 | @override 141 | City build() => _build(); 142 | 143 | _$City _build() { 144 | final _$result = _$v ?? new _$City._(id: id, title: title); 145 | replace(_$result); 146 | return _$result; 147 | } 148 | } 149 | 150 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 151 | -------------------------------------------------------------------------------- /lib/src/data/model/results/common/country.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'country.g.dart'; 5 | 6 | /// The country 7 | abstract class Country implements Built { 8 | /// [Country] factory 9 | factory Country([void Function(CountryBuilder) updates]) = _$Country; 10 | 11 | Country._(); 12 | 13 | /// [Country] serializer 14 | static Serializer get serializer => _$countrySerializer; 15 | 16 | /// Country id 17 | int get id; 18 | 19 | /// The name of the country 20 | String get title; 21 | } 22 | -------------------------------------------------------------------------------- /lib/src/data/model/results/donut_is_don_result/donut_is_don_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/unsupported.dart'; 4 | 5 | part 'donut_is_don_result.g.dart'; 6 | 7 | /// Result of [VKBridge.donutIsDon] 8 | abstract class DonutIsDonResult 9 | implements Built { 10 | /// [DonutIsDonResult] factory 11 | factory DonutIsDonResult([void Function(DonutIsDonResultBuilder) updates]) = 12 | _$DonutIsDonResult; 13 | 14 | DonutIsDonResult._(); 15 | 16 | /// [DonutIsDonResult] serializer 17 | static Serializer get serializer => 18 | _$donutIsDonResultSerializer; 19 | 20 | /// If the user is a don, it returns 1. If not, it returns 0 21 | int get response; 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/data/model/results/donut_is_don_result/donut_is_don_result.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'donut_is_don_result.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$donutIsDonResultSerializer = 10 | new _$DonutIsDonResultSerializer(); 11 | 12 | class _$DonutIsDonResultSerializer 13 | implements StructuredSerializer { 14 | @override 15 | final Iterable types = const [DonutIsDonResult, _$DonutIsDonResult]; 16 | @override 17 | final String wireName = 'DonutIsDonResult'; 18 | 19 | @override 20 | Iterable serialize(Serializers serializers, DonutIsDonResult object, 21 | {FullType specifiedType = FullType.unspecified}) { 22 | final result = [ 23 | 'response', 24 | serializers.serialize(object.response, 25 | specifiedType: const FullType(int)), 26 | ]; 27 | 28 | return result; 29 | } 30 | 31 | @override 32 | DonutIsDonResult deserialize( 33 | Serializers serializers, Iterable serialized, 34 | {FullType specifiedType = FullType.unspecified}) { 35 | final result = new DonutIsDonResultBuilder(); 36 | 37 | final iterator = serialized.iterator; 38 | while (iterator.moveNext()) { 39 | final key = iterator.current! as String; 40 | iterator.moveNext(); 41 | final Object? value = iterator.current; 42 | switch (key) { 43 | case 'response': 44 | result.response = serializers.deserialize(value, 45 | specifiedType: const FullType(int))! as int; 46 | break; 47 | } 48 | } 49 | 50 | return result.build(); 51 | } 52 | } 53 | 54 | class _$DonutIsDonResult extends DonutIsDonResult { 55 | @override 56 | final int response; 57 | 58 | factory _$DonutIsDonResult( 59 | [void Function(DonutIsDonResultBuilder)? updates]) => 60 | (new DonutIsDonResultBuilder()..update(updates))._build(); 61 | 62 | _$DonutIsDonResult._({required this.response}) : super._() { 63 | BuiltValueNullFieldError.checkNotNull( 64 | response, r'DonutIsDonResult', 'response'); 65 | } 66 | 67 | @override 68 | DonutIsDonResult rebuild(void Function(DonutIsDonResultBuilder) updates) => 69 | (toBuilder()..update(updates)).build(); 70 | 71 | @override 72 | DonutIsDonResultBuilder toBuilder() => 73 | new DonutIsDonResultBuilder()..replace(this); 74 | 75 | @override 76 | bool operator ==(Object other) { 77 | if (identical(other, this)) return true; 78 | return other is DonutIsDonResult && response == other.response; 79 | } 80 | 81 | @override 82 | int get hashCode { 83 | var _$hash = 0; 84 | _$hash = $jc(_$hash, response.hashCode); 85 | _$hash = $jf(_$hash); 86 | return _$hash; 87 | } 88 | 89 | @override 90 | String toString() { 91 | return (newBuiltValueToStringHelper(r'DonutIsDonResult') 92 | ..add('response', response)) 93 | .toString(); 94 | } 95 | } 96 | 97 | class DonutIsDonResultBuilder 98 | implements Builder { 99 | _$DonutIsDonResult? _$v; 100 | 101 | int? _response; 102 | int? get response => _$this._response; 103 | set response(int? response) => _$this._response = response; 104 | 105 | DonutIsDonResultBuilder(); 106 | 107 | DonutIsDonResultBuilder get _$this { 108 | final $v = _$v; 109 | if ($v != null) { 110 | _response = $v.response; 111 | _$v = null; 112 | } 113 | return this; 114 | } 115 | 116 | @override 117 | void replace(DonutIsDonResult other) { 118 | ArgumentError.checkNotNull(other, 'other'); 119 | _$v = other as _$DonutIsDonResult; 120 | } 121 | 122 | @override 123 | void update(void Function(DonutIsDonResultBuilder)? updates) { 124 | if (updates != null) updates(this); 125 | } 126 | 127 | @override 128 | DonutIsDonResult build() => _build(); 129 | 130 | _$DonutIsDonResult _build() { 131 | final _$result = _$v ?? 132 | new _$DonutIsDonResult._( 133 | response: BuiltValueNullFieldError.checkNotNull( 134 | response, r'DonutIsDonResult', 'response')); 135 | replace(_$result); 136 | return _$result; 137 | } 138 | } 139 | 140 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 141 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_add_to_community_result/vk_web_app_add_to_community_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_add_to_community_result.g.dart'; 6 | 7 | /// Result of [VKBridge.getAuthToken] 8 | abstract class VKWebAppAddToCommunityResult 9 | implements 10 | Built { 12 | /// [VKWebAppAddToCommunityResult] factory 13 | factory VKWebAppAddToCommunityResult( 14 | [void Function(VKWebAppAddToCommunityResultBuilder) updates]) = 15 | _$VKWebAppAddToCommunityResult; 16 | 17 | VKWebAppAddToCommunityResult._(); 18 | 19 | /// [VKWebAppAddToCommunityResult] serializer 20 | static Serializer get serializer => 21 | _$vKWebAppAddToCommunityResultSerializer; 22 | 23 | /// Group ID. 24 | @BuiltValueField(wireName: 'group_id') 25 | int get groupId; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_add_to_home_screen_info_result/vk_web_app_add_to_home_screen_info_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_add_to_home_screen_info_result.g.dart'; 6 | 7 | /// Result of [VKBridge.addToHomeScreenInfo] 8 | abstract class VKWebAppAddToHomeScreenInfoResult 9 | implements 10 | Built { 12 | /// [VKWebAppAddToHomeScreenInfoResult] factory 13 | factory VKWebAppAddToHomeScreenInfoResult( 14 | [void Function(VKWebAppAddToHomeScreenInfoResultBuilder) updates]) = 15 | _$VKWebAppAddToHomeScreenInfoResult; 16 | 17 | VKWebAppAddToHomeScreenInfoResult._(); 18 | 19 | /// [VKWebAppAddToHomeScreenInfoResult] serializer 20 | static Serializer get serializer => 21 | _$vKWebAppAddToHomeScreenInfoResultSerializer; 22 | 23 | /// Is it possible to add a shortcut to the main screen of the device. 24 | @BuiltValueField(wireName: 'is_feature_supported') 25 | bool get isFeatureSupported; 26 | 27 | /// Checks for a shortcut on the home screen of the device. 28 | @BuiltValueField(wireName: 'is_added_to_home_screen') 29 | bool get isAddedToHomeScreen; 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_bool_result/vk_web_app_bool_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'vk_web_app_bool_result.g.dart'; 5 | 6 | /// Boolean result of operation 7 | abstract class VKWebAppBoolResult 8 | implements Built { 9 | /// [VKWebAppBoolResult] factory 10 | factory VKWebAppBoolResult( 11 | [void Function(VKWebAppBoolResultBuilder) updates]) = 12 | _$VKWebAppBoolResult; 13 | 14 | VKWebAppBoolResult._(); 15 | 16 | /// [VKWebAppBoolResult] serializer 17 | static Serializer get serializer => 18 | _$vKWebAppBoolResultSerializer; 19 | 20 | /// Result 21 | bool get result; 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_bool_result/vk_web_app_bool_result.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'vk_web_app_bool_result.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$vKWebAppBoolResultSerializer = 10 | new _$VKWebAppBoolResultSerializer(); 11 | 12 | class _$VKWebAppBoolResultSerializer 13 | implements StructuredSerializer { 14 | @override 15 | final Iterable types = const [VKWebAppBoolResult, _$VKWebAppBoolResult]; 16 | @override 17 | final String wireName = 'VKWebAppBoolResult'; 18 | 19 | @override 20 | Iterable serialize( 21 | Serializers serializers, VKWebAppBoolResult object, 22 | {FullType specifiedType = FullType.unspecified}) { 23 | final result = [ 24 | 'result', 25 | serializers.serialize(object.result, specifiedType: const FullType(bool)), 26 | ]; 27 | 28 | return result; 29 | } 30 | 31 | @override 32 | VKWebAppBoolResult deserialize( 33 | Serializers serializers, Iterable serialized, 34 | {FullType specifiedType = FullType.unspecified}) { 35 | final result = new VKWebAppBoolResultBuilder(); 36 | 37 | final iterator = serialized.iterator; 38 | while (iterator.moveNext()) { 39 | final key = iterator.current! as String; 40 | iterator.moveNext(); 41 | final Object? value = iterator.current; 42 | switch (key) { 43 | case 'result': 44 | result.result = serializers.deserialize(value, 45 | specifiedType: const FullType(bool))! as bool; 46 | break; 47 | } 48 | } 49 | 50 | return result.build(); 51 | } 52 | } 53 | 54 | class _$VKWebAppBoolResult extends VKWebAppBoolResult { 55 | @override 56 | final bool result; 57 | 58 | factory _$VKWebAppBoolResult( 59 | [void Function(VKWebAppBoolResultBuilder)? updates]) => 60 | (new VKWebAppBoolResultBuilder()..update(updates))._build(); 61 | 62 | _$VKWebAppBoolResult._({required this.result}) : super._() { 63 | BuiltValueNullFieldError.checkNotNull( 64 | result, r'VKWebAppBoolResult', 'result'); 65 | } 66 | 67 | @override 68 | VKWebAppBoolResult rebuild( 69 | void Function(VKWebAppBoolResultBuilder) updates) => 70 | (toBuilder()..update(updates)).build(); 71 | 72 | @override 73 | VKWebAppBoolResultBuilder toBuilder() => 74 | new VKWebAppBoolResultBuilder()..replace(this); 75 | 76 | @override 77 | bool operator ==(Object other) { 78 | if (identical(other, this)) return true; 79 | return other is VKWebAppBoolResult && result == other.result; 80 | } 81 | 82 | @override 83 | int get hashCode { 84 | var _$hash = 0; 85 | _$hash = $jc(_$hash, result.hashCode); 86 | _$hash = $jf(_$hash); 87 | return _$hash; 88 | } 89 | 90 | @override 91 | String toString() { 92 | return (newBuiltValueToStringHelper(r'VKWebAppBoolResult') 93 | ..add('result', result)) 94 | .toString(); 95 | } 96 | } 97 | 98 | class VKWebAppBoolResultBuilder 99 | implements Builder { 100 | _$VKWebAppBoolResult? _$v; 101 | 102 | bool? _result; 103 | bool? get result => _$this._result; 104 | set result(bool? result) => _$this._result = result; 105 | 106 | VKWebAppBoolResultBuilder(); 107 | 108 | VKWebAppBoolResultBuilder get _$this { 109 | final $v = _$v; 110 | if ($v != null) { 111 | _result = $v.result; 112 | _$v = null; 113 | } 114 | return this; 115 | } 116 | 117 | @override 118 | void replace(VKWebAppBoolResult other) { 119 | ArgumentError.checkNotNull(other, 'other'); 120 | _$v = other as _$VKWebAppBoolResult; 121 | } 122 | 123 | @override 124 | void update(void Function(VKWebAppBoolResultBuilder)? updates) { 125 | if (updates != null) updates(this); 126 | } 127 | 128 | @override 129 | VKWebAppBoolResult build() => _build(); 130 | 131 | _$VKWebAppBoolResult _build() { 132 | final _$result = _$v ?? 133 | new _$VKWebAppBoolResult._( 134 | result: BuiltValueNullFieldError.checkNotNull( 135 | result, r'VKWebAppBoolResult', 'result')); 136 | replace(_$result); 137 | return _$result; 138 | } 139 | } 140 | 141 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 142 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_community_access_token_result/vk_web_app_community_access_token_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_community_access_token_result.g.dart'; 6 | 7 | /// Result of [VKBridge.getCommunityToken] 8 | abstract class VKWebAppCommunityAccessTokenResult 9 | implements 10 | Built { 12 | /// [VKWebAppCommunityAccessTokenResult] factory 13 | factory VKWebAppCommunityAccessTokenResult( 14 | [void Function(VKWebAppCommunityAccessTokenResultBuilder) updates]) = 15 | _$VKWebAppCommunityAccessTokenResult; 16 | 17 | VKWebAppCommunityAccessTokenResult._(); 18 | 19 | /// [VKWebAppCommunityAccessTokenResult] serializer 20 | static Serializer get serializer => 21 | _$vKWebAppCommunityAccessTokenResultSerializer; 22 | 23 | /// Community access token 24 | @BuiltValueField(wireName: 'access_token') 25 | String get accessToken; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_contacts_done/vk_web_app_contacts_done.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_contacts_done.g.dart'; 6 | 7 | /// Result of [VKBridge.getClientVersion] 8 | abstract class VKWebAppContactsDone 9 | implements Built { 10 | /// [VKWebAppContactsDone] factory 11 | factory VKWebAppContactsDone( 12 | [void Function(VKWebAppContactsDoneBuilder) updates]) = 13 | _$VKWebAppContactsDone; 14 | 15 | VKWebAppContactsDone._(); 16 | 17 | /// [VKWebAppContactsDone] serializer 18 | static Serializer get serializer => 19 | _$vKWebAppContactsDoneSerializer; 20 | 21 | /// Phone number, in the format in which it is stored in the user's contact list. 22 | String get phone; 23 | 24 | /// The username specified in the user's contact list. 25 | @BuiltValueField(wireName: 'first_name') 26 | String get firstName; 27 | 28 | /// The user's last name, as listed in the user's contact list. 29 | @BuiltValueField(wireName: 'last_name') 30 | String get lastName; 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_flash_get_info_result/vk_web_app_flash_get_info_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_flash_get_info_result.g.dart'; 6 | 7 | /// Result of [VKBridge.flashGetInfo] 8 | abstract class VKWebAppFlashGetInfoResult 9 | implements 10 | Built { 11 | /// [VKWebAppFlashGetInfoResult] factory 12 | factory VKWebAppFlashGetInfoResult( 13 | [void Function(VKWebAppFlashGetInfoResultBuilder) updates]) = 14 | _$VKWebAppFlashGetInfoResult; 15 | 16 | VKWebAppFlashGetInfoResult._(); 17 | 18 | /// [VKWebAppFlashGetInfoResult] serializer 19 | static Serializer get serializer => 20 | _$vKWebAppFlashGetInfoResultSerializer; 21 | 22 | /// Whether work with a flashlight is available. Possible values: 23 | /// false - the flashlight is not available. 24 | /// true - flashlight is available. 25 | @BuiltValueField(wireName: 'is_available') 26 | bool get isAvailable; 27 | 28 | /// Flashlight brightness level from 0 to 1. 29 | @BuiltValueField(wireName: 'level') 30 | double? get level; 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_ads_result/stats.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/data/model/results/vk_web_app_get_ads_result/stats_type.dart'; 4 | 5 | part 'stats.g.dart'; 6 | 7 | /// Stats for [Stats] 8 | abstract class Stats implements Built { 9 | /// [Stats] factory 10 | factory Stats([void Function(StatsBuilder) updates]) = _$Stats; 11 | 12 | Stats._(); 13 | 14 | /// [Stats] serializer 15 | static Serializer get serializer => _$statsSerializer; 16 | 17 | /// Type 18 | StatsType get type; 19 | 20 | /// Url 21 | String get url; 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_ads_result/stats.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'stats.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | Serializer _$statsSerializer = new _$StatsSerializer(); 10 | 11 | class _$StatsSerializer implements StructuredSerializer { 12 | @override 13 | final Iterable types = const [Stats, _$Stats]; 14 | @override 15 | final String wireName = 'Stats'; 16 | 17 | @override 18 | Iterable serialize(Serializers serializers, Stats object, 19 | {FullType specifiedType = FullType.unspecified}) { 20 | final result = [ 21 | 'type', 22 | serializers.serialize(object.type, 23 | specifiedType: const FullType(StatsType)), 24 | 'url', 25 | serializers.serialize(object.url, specifiedType: const FullType(String)), 26 | ]; 27 | 28 | return result; 29 | } 30 | 31 | @override 32 | Stats deserialize(Serializers serializers, Iterable serialized, 33 | {FullType specifiedType = FullType.unspecified}) { 34 | final result = new StatsBuilder(); 35 | 36 | final iterator = serialized.iterator; 37 | while (iterator.moveNext()) { 38 | final key = iterator.current! as String; 39 | iterator.moveNext(); 40 | final Object? value = iterator.current; 41 | switch (key) { 42 | case 'type': 43 | result.type = serializers.deserialize(value, 44 | specifiedType: const FullType(StatsType))! as StatsType; 45 | break; 46 | case 'url': 47 | result.url = serializers.deserialize(value, 48 | specifiedType: const FullType(String))! as String; 49 | break; 50 | } 51 | } 52 | 53 | return result.build(); 54 | } 55 | } 56 | 57 | class _$Stats extends Stats { 58 | @override 59 | final StatsType type; 60 | @override 61 | final String url; 62 | 63 | factory _$Stats([void Function(StatsBuilder)? updates]) => 64 | (new StatsBuilder()..update(updates))._build(); 65 | 66 | _$Stats._({required this.type, required this.url}) : super._() { 67 | BuiltValueNullFieldError.checkNotNull(type, r'Stats', 'type'); 68 | BuiltValueNullFieldError.checkNotNull(url, r'Stats', 'url'); 69 | } 70 | 71 | @override 72 | Stats rebuild(void Function(StatsBuilder) updates) => 73 | (toBuilder()..update(updates)).build(); 74 | 75 | @override 76 | StatsBuilder toBuilder() => new StatsBuilder()..replace(this); 77 | 78 | @override 79 | bool operator ==(Object other) { 80 | if (identical(other, this)) return true; 81 | return other is Stats && type == other.type && url == other.url; 82 | } 83 | 84 | @override 85 | int get hashCode { 86 | var _$hash = 0; 87 | _$hash = $jc(_$hash, type.hashCode); 88 | _$hash = $jc(_$hash, url.hashCode); 89 | _$hash = $jf(_$hash); 90 | return _$hash; 91 | } 92 | 93 | @override 94 | String toString() { 95 | return (newBuiltValueToStringHelper(r'Stats') 96 | ..add('type', type) 97 | ..add('url', url)) 98 | .toString(); 99 | } 100 | } 101 | 102 | class StatsBuilder implements Builder { 103 | _$Stats? _$v; 104 | 105 | StatsType? _type; 106 | StatsType? get type => _$this._type; 107 | set type(StatsType? type) => _$this._type = type; 108 | 109 | String? _url; 110 | String? get url => _$this._url; 111 | set url(String? url) => _$this._url = url; 112 | 113 | StatsBuilder(); 114 | 115 | StatsBuilder get _$this { 116 | final $v = _$v; 117 | if ($v != null) { 118 | _type = $v.type; 119 | _url = $v.url; 120 | _$v = null; 121 | } 122 | return this; 123 | } 124 | 125 | @override 126 | void replace(Stats other) { 127 | ArgumentError.checkNotNull(other, 'other'); 128 | _$v = other as _$Stats; 129 | } 130 | 131 | @override 132 | void update(void Function(StatsBuilder)? updates) { 133 | if (updates != null) updates(this); 134 | } 135 | 136 | @override 137 | Stats build() => _build(); 138 | 139 | _$Stats _build() { 140 | final _$result = _$v ?? 141 | new _$Stats._( 142 | type: BuiltValueNullFieldError.checkNotNull(type, r'Stats', 'type'), 143 | url: BuiltValueNullFieldError.checkNotNull(url, r'Stats', 'url')); 144 | replace(_$result); 145 | return _$result; 146 | } 147 | } 148 | 149 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 150 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_ads_result/stats_type.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | 5 | part 'stats_type.g.dart'; 6 | 7 | /// StatsType for [VKWebAppGetAdsResult] 8 | class StatsType extends EnumClass { 9 | const StatsType._(String name) : super(name); 10 | 11 | /// StatsType serializer 12 | static Serializer get serializer => _$statsTypeSerializer; 13 | 14 | /// Beginning of the show 15 | static const StatsType playbackStarted = _$playbackStarted; 16 | 17 | /// Clicking a banner 18 | static const StatsType click = _$click; 19 | 20 | /// List of all StatsTypes 21 | static BuiltSet get values => _$values; 22 | 23 | /// Parse StatsType from string 24 | static StatsType valueOf(String name) => _$valueOf(name); 25 | } 26 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_ads_result/stats_type.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'stats_type.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | const StatsType _$playbackStarted = const StatsType._('playbackStarted'); 10 | const StatsType _$click = const StatsType._('click'); 11 | 12 | StatsType _$valueOf(String name) { 13 | switch (name) { 14 | case 'playbackStarted': 15 | return _$playbackStarted; 16 | case 'click': 17 | return _$click; 18 | default: 19 | throw new ArgumentError(name); 20 | } 21 | } 22 | 23 | final BuiltSet _$values = new BuiltSet(const [ 24 | _$playbackStarted, 25 | _$click, 26 | ]); 27 | 28 | Serializer _$statsTypeSerializer = new _$StatsTypeSerializer(); 29 | 30 | class _$StatsTypeSerializer implements PrimitiveSerializer { 31 | @override 32 | final Iterable types = const [StatsType]; 33 | @override 34 | final String wireName = 'StatsType'; 35 | 36 | @override 37 | Object serialize(Serializers serializers, StatsType object, 38 | {FullType specifiedType = FullType.unspecified}) => 39 | object.name; 40 | 41 | @override 42 | StatsType deserialize(Serializers serializers, Object serialized, 43 | {FullType specifiedType = FullType.unspecified}) => 44 | StatsType.valueOf(serialized as String); 45 | } 46 | 47 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 48 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_ads_result/vk_web_app_get_ads_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 5 | import 'package:vk_bridge/src/data/model/results/vk_web_app_get_ads_result/stats.dart'; 6 | 7 | part 'vk_web_app_get_ads_result.g.dart'; 8 | 9 | /// Result of [VKBridge.getAds] 10 | abstract class VKWebAppGetAdsResult 11 | implements Built { 12 | /// [VKWebAppGetAdsResult] factory 13 | factory VKWebAppGetAdsResult( 14 | [void Function(VKWebAppGetAdsResultBuilder) updates]) = 15 | _$VKWebAppGetAdsResult; 16 | 17 | VKWebAppGetAdsResult._(); 18 | 19 | /// [VKWebAppGetAdsResult] serializer 20 | static Serializer get serializer => 21 | _$vKWebAppGetAdsResultSerializer; 22 | 23 | /// title 24 | String? get title; 25 | 26 | /// urlTypes 27 | @BuiltValueField(wireName: 'url_types') 28 | String? get urlTypes; 29 | 30 | /// bannerID 31 | String? get bannerID; 32 | 33 | /// imageWidth 34 | double? get imageWidth; 35 | 36 | /// imageHeight 37 | double? get imageHeight; 38 | 39 | /// imageLink 40 | String? get imageLink; 41 | 42 | /// trackingLink 43 | String? get trackingLink; 44 | 45 | /// type 46 | String? get type; 47 | 48 | /// iconWidth 49 | double? get iconWidth; 50 | 51 | /// domain 52 | String? get domain; 53 | 54 | /// ctaText 55 | String? get ctaText; 56 | 57 | /// advertisingLabel 58 | String? get advertisingLabel; 59 | 60 | /// iconLink 61 | String? get iconLink; 62 | 63 | /// statistics 64 | BuiltList? get statistics; 65 | 66 | /// openInBrowser 67 | bool? get openInBrowser; 68 | 69 | /// iconHeight 70 | double? get iconHeight; 71 | 72 | /// directLink 73 | bool? get directLink; 74 | 75 | /// navigationType 76 | String? get navigationType; 77 | 78 | /// description 79 | String? get description; 80 | 81 | /// ageRestrictions 82 | String? get ageRestrictions; 83 | } 84 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_auth_token_result/vk_web_app_get_auth_token_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_get_auth_token_result.g.dart'; 6 | 7 | /// Result of [VKBridge.getAuthToken] 8 | abstract class VKWebAppGetAuthTokenResult 9 | implements 10 | Built { 11 | /// [VKWebAppGetAuthTokenResult] factory 12 | factory VKWebAppGetAuthTokenResult( 13 | [void Function(VKWebAppGetAuthTokenResultBuilder) updates]) = 14 | _$VKWebAppGetAuthTokenResult; 15 | 16 | VKWebAppGetAuthTokenResult._(); 17 | 18 | /// [VKWebAppGetAuthTokenResult] serializer 19 | static Serializer get serializer => 20 | _$vKWebAppGetAuthTokenResultSerializer; 21 | 22 | /// User access key. 23 | @BuiltValueField(wireName: 'access_token') 24 | String get accessToken; 25 | 26 | /// The list of rights granted by the user 27 | /// (it may differ from the scope that the service itself transferred, 28 | /// this situation must be handled separately). 29 | String? get scope; 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_client_version_result/vk_web_app_get_client_version_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_get_client_version_result.g.dart'; 6 | 7 | /// Result of [VKBridge.getClientVersion] 8 | abstract class VKWebAppGetClientVersionResult 9 | implements 10 | Built { 12 | /// [VKWebAppGetClientVersionResult] factory 13 | factory VKWebAppGetClientVersionResult( 14 | [void Function(VKWebAppGetClientVersionResultBuilder) updates]) = 15 | _$VKWebAppGetClientVersionResult; 16 | 17 | VKWebAppGetClientVersionResult._(); 18 | 19 | /// [VKWebAppGetClientVersionResult] serializer 20 | static Serializer get serializer => 21 | _$vKWebAppGetClientVersionResultSerializer; 22 | 23 | // TODO(sanekyy): enum 24 | /// Platform (ios, android, web or mobile-web) 25 | String get platform; 26 | 27 | /// Version of the mobile application. 28 | String get version; 29 | } 30 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_email_result/vk_web_app_get_email_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_get_email_result.g.dart'; 6 | 7 | /// Result of [VKBridge.getEmail] 8 | abstract class VKWebAppGetEmailResult 9 | implements Built { 10 | /// [VKWebAppGetEmailResult] factory 11 | factory VKWebAppGetEmailResult( 12 | [void Function(VKWebAppGetEmailResultBuilder) updates]) = 13 | _$VKWebAppGetEmailResult; 14 | 15 | VKWebAppGetEmailResult._(); 16 | 17 | /// [VKWebAppGetEmailResult] serializer 18 | static Serializer get serializer => 19 | _$vKWebAppGetEmailResultSerializer; 20 | 21 | /// User's email address 22 | String get email; 23 | 24 | /// Signature of the received data. For the signature, the app_id values, 25 | /// the api_secret secret signature specified in the settings of your 26 | /// application, the user_id of the user, and the $ field_name. 27 | /// $ Field_value pair returned in the event are sequentially combined for 28 | /// the signature. The SHA256 cryptographic hash is calculated from the 29 | /// string obtained after concatenation in byte representation. You need to 30 | /// take base64UrlEncode from the hash. An example of generating an event 31 | /// signature in php for an application with app_id 7770000 and a secret 32 | /// key W7kVvxVxZ4: 33 | /// $sign = rtrim(strtr(base64_encode(hash('sha256', 34 | /// '7770000W7kVvxVxZ4162447emailtest@gmail.com', true)), '+/', '-_'), '='); 35 | String get sign; 36 | } 37 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_friends_result/user.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'user.g.dart'; 5 | 6 | /// Part of [VKWebAppGetFriendsResult ] 7 | abstract class User implements Built { 8 | /// [User] factory 9 | factory User([void Function(UserBuilder) updates]) = _$User; 10 | 11 | User._(); 12 | 13 | /// [User] serializer 14 | static Serializer get serializer => _$userSerializer; 15 | 16 | /// User ID 17 | int get id; 18 | 19 | /// First name 20 | @BuiltValueField(wireName: 'first_name') 21 | String get firstName; 22 | 23 | /// Last name 24 | @BuiltValueField(wireName: 'last_name') 25 | String get lastName; 26 | 27 | // TODO(sanekyy): enum 28 | /// Sex. Possible values: 29 | /// - 1 - female 30 | /// - 2 - male 31 | /// - 0 - gender is not specified 32 | int get sex; 33 | 34 | /// Url of a square user photo with a width of 200 pixels. If the user does 35 | /// not have a photo, https://vk.com/images/camera_200.png is returned 36 | @BuiltValueField(wireName: 'photo_200') 37 | String get photo200; 38 | } 39 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_friends_result/vk_web_app_get_friends_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 5 | import 'package:vk_bridge/src/data/model/results/vk_web_app_get_friends_result/user.dart'; 6 | 7 | part 'vk_web_app_get_friends_result.g.dart'; 8 | 9 | /// Result of [VKBridge.getFriends] 10 | abstract class VKWebAppGetFriendsResult 11 | implements 12 | Built { 13 | /// [VKWebAppGetFriendsResult] factory 14 | factory VKWebAppGetFriendsResult( 15 | [void Function(VKWebAppGetFriendsResultBuilder) updates]) = 16 | _$VKWebAppGetFriendsResult; 17 | 18 | VKWebAppGetFriendsResult._(); 19 | 20 | /// [VKWebAppGetFriendsResult] serializer 21 | static Serializer get serializer => 22 | _$vKWebAppGetFriendsResultSerializer; 23 | 24 | /// An array of user objects containing three fields: 25 | BuiltList get users; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_geodata_result/vk_web_app_get_geodata_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_get_geodata_result.g.dart'; 6 | 7 | /// Result of [VKBridge.getGeodata] 8 | abstract class VKWebAppGetGeodataResult 9 | implements 10 | Built { 11 | /// [VKWebAppGetGeodataResult] factory 12 | factory VKWebAppGetGeodataResult( 13 | [void Function(VKWebAppGetGeodataResultBuilder) updates]) = 14 | _$VKWebAppGetGeodataResult; 15 | 16 | VKWebAppGetGeodataResult._(); 17 | 18 | /// [VKWebAppGetGeodataResult] serializer 19 | @BuiltValueSerializer(custom: true) 20 | static Serializer get serializer => 21 | VKWebAppGetGeodataResultSerializer(); 22 | 23 | /// Information about whether location data is available. If succeVKWebAppGetGeodataResultBuilderssful, 24 | /// it takes the value true. If the user refused to enable access to the 25 | /// location in the device settings, the available field contains false, 26 | /// while the rest of the fields are not returned 27 | bool get available; 28 | 29 | /// Latitude value in degrees (from -90 to 90). 30 | double get lat; 31 | 32 | /// Longitude value in degrees (from -180 to 180). 33 | double get long; 34 | } 35 | 36 | /// [VKWebAppGetGeodataResult] serializer 37 | /// VK Platform can return available as int or bool 38 | class VKWebAppGetGeodataResultSerializer 39 | implements StructuredSerializer { 40 | @override 41 | VKWebAppGetGeodataResult deserialize( 42 | Serializers serializers, 43 | Iterable serialized, { 44 | FullType specifiedType = FullType.unspecified, 45 | }) { 46 | final result = VKWebAppGetGeodataResultBuilder(); 47 | 48 | final iterator = serialized.iterator; 49 | while (iterator.moveNext()) { 50 | final key = iterator.current as String; 51 | iterator.moveNext(); 52 | final Object value = iterator.current as Object; 53 | switch (key) { 54 | case 'available': 55 | if (value is bool) { 56 | result.available = serializers.deserialize(value, 57 | specifiedType: const FullType(bool)) as bool?; 58 | } else if (value is int) { 59 | result.available = (serializers.deserialize(value, 60 | specifiedType: const FullType(int)) as int?) == 61 | 1; 62 | } else { 63 | throw StateError('Field available should be boolean'); 64 | } 65 | break; 66 | case 'lat': 67 | result.lat = serializers.deserialize(value, 68 | specifiedType: const FullType(double)) as double?; 69 | break; 70 | case 'long': 71 | result.long = serializers.deserialize(value, 72 | specifiedType: const FullType(double)) as double?; 73 | break; 74 | } 75 | } 76 | 77 | return result.build(); 78 | } 79 | 80 | @override 81 | Iterable serialize( 82 | Serializers serializers, VKWebAppGetGeodataResult object, 83 | {FullType specifiedType = FullType.unspecified}) { 84 | final result = [ 85 | 'available', 86 | serializers.serialize(object.available, 87 | specifiedType: const FullType(bool)), 88 | 'lat', 89 | serializers.serialize(object.lat, specifiedType: const FullType(double)), 90 | 'long', 91 | serializers.serialize(object.long, specifiedType: const FullType(double)), 92 | ]; 93 | 94 | return result; 95 | } 96 | 97 | @override 98 | Iterable get types => [ 99 | VKWebAppGetGeodataResult, 100 | _$VKWebAppGetGeodataResult, 101 | ]; 102 | 103 | @override 104 | String get wireName => 'VKWebAppGetGeodataResult'; 105 | } 106 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_geodata_result/vk_web_app_get_geodata_result.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'vk_web_app_get_geodata_result.dart'; 4 | 5 | // ************************************************************************** 6 | // BuiltValueGenerator 7 | // ************************************************************************** 8 | 9 | class _$VKWebAppGetGeodataResult extends VKWebAppGetGeodataResult { 10 | @override 11 | final bool available; 12 | @override 13 | final double lat; 14 | @override 15 | final double long; 16 | 17 | factory _$VKWebAppGetGeodataResult( 18 | [void Function(VKWebAppGetGeodataResultBuilder)? updates]) => 19 | (new VKWebAppGetGeodataResultBuilder()..update(updates))._build(); 20 | 21 | _$VKWebAppGetGeodataResult._( 22 | {required this.available, required this.lat, required this.long}) 23 | : super._() { 24 | BuiltValueNullFieldError.checkNotNull( 25 | available, r'VKWebAppGetGeodataResult', 'available'); 26 | BuiltValueNullFieldError.checkNotNull( 27 | lat, r'VKWebAppGetGeodataResult', 'lat'); 28 | BuiltValueNullFieldError.checkNotNull( 29 | long, r'VKWebAppGetGeodataResult', 'long'); 30 | } 31 | 32 | @override 33 | VKWebAppGetGeodataResult rebuild( 34 | void Function(VKWebAppGetGeodataResultBuilder) updates) => 35 | (toBuilder()..update(updates)).build(); 36 | 37 | @override 38 | VKWebAppGetGeodataResultBuilder toBuilder() => 39 | new VKWebAppGetGeodataResultBuilder()..replace(this); 40 | 41 | @override 42 | bool operator ==(Object other) { 43 | if (identical(other, this)) return true; 44 | return other is VKWebAppGetGeodataResult && 45 | available == other.available && 46 | lat == other.lat && 47 | long == other.long; 48 | } 49 | 50 | @override 51 | int get hashCode { 52 | var _$hash = 0; 53 | _$hash = $jc(_$hash, available.hashCode); 54 | _$hash = $jc(_$hash, lat.hashCode); 55 | _$hash = $jc(_$hash, long.hashCode); 56 | _$hash = $jf(_$hash); 57 | return _$hash; 58 | } 59 | 60 | @override 61 | String toString() { 62 | return (newBuiltValueToStringHelper(r'VKWebAppGetGeodataResult') 63 | ..add('available', available) 64 | ..add('lat', lat) 65 | ..add('long', long)) 66 | .toString(); 67 | } 68 | } 69 | 70 | class VKWebAppGetGeodataResultBuilder 71 | implements 72 | Builder { 73 | _$VKWebAppGetGeodataResult? _$v; 74 | 75 | bool? _available; 76 | bool? get available => _$this._available; 77 | set available(bool? available) => _$this._available = available; 78 | 79 | double? _lat; 80 | double? get lat => _$this._lat; 81 | set lat(double? lat) => _$this._lat = lat; 82 | 83 | double? _long; 84 | double? get long => _$this._long; 85 | set long(double? long) => _$this._long = long; 86 | 87 | VKWebAppGetGeodataResultBuilder(); 88 | 89 | VKWebAppGetGeodataResultBuilder get _$this { 90 | final $v = _$v; 91 | if ($v != null) { 92 | _available = $v.available; 93 | _lat = $v.lat; 94 | _long = $v.long; 95 | _$v = null; 96 | } 97 | return this; 98 | } 99 | 100 | @override 101 | void replace(VKWebAppGetGeodataResult other) { 102 | ArgumentError.checkNotNull(other, 'other'); 103 | _$v = other as _$VKWebAppGetGeodataResult; 104 | } 105 | 106 | @override 107 | void update(void Function(VKWebAppGetGeodataResultBuilder)? updates) { 108 | if (updates != null) updates(this); 109 | } 110 | 111 | @override 112 | VKWebAppGetGeodataResult build() => _build(); 113 | 114 | _$VKWebAppGetGeodataResult _build() { 115 | final _$result = _$v ?? 116 | new _$VKWebAppGetGeodataResult._( 117 | available: BuiltValueNullFieldError.checkNotNull( 118 | available, r'VKWebAppGetGeodataResult', 'available'), 119 | lat: BuiltValueNullFieldError.checkNotNull( 120 | lat, r'VKWebAppGetGeodataResult', 'lat'), 121 | long: BuiltValueNullFieldError.checkNotNull( 122 | long, r'VKWebAppGetGeodataResult', 'long')); 123 | replace(_$result); 124 | return _$result; 125 | } 126 | } 127 | 128 | // ignore_for_file: deprecated_member_use_from_same_package,type=lint 129 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_group_info_result/vk_web_app_get_group_info_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_get_group_info_result.g.dart'; 6 | 7 | /// Result of [VKBridge.getGroupInfo] 8 | abstract class VKWebAppGetGroupInfoResult 9 | implements 10 | Built { 11 | /// [VKWebAppGetGroupInfoResult] factory 12 | factory VKWebAppGetGroupInfoResult( 13 | [void Function(VKWebAppGetGroupInfoResultBuilder) updates]) = 14 | _$VKWebAppGetGroupInfoResult; 15 | 16 | VKWebAppGetGroupInfoResult._(); 17 | 18 | /// [VKWebAppGetGroupInfoResult] serializer 19 | static Serializer get serializer => 20 | _$vKWebAppGetGroupInfoResultSerializer; 21 | 22 | /// Basic fields 23 | 24 | /// Group ID. 25 | int get id; 26 | 27 | /// Group name. 28 | String get name; 29 | 30 | /// Short address, for example apiclub. 31 | @BuiltValueField(wireName: 'screen_name') 32 | String get screenName; 33 | 34 | // TODO: enum 35 | /// Whether the group is closed. 36 | /// Possible values: 37 | /// 0 - open 38 | /// 1 - closed 39 | /// 2 - private 40 | @BuiltValueField(wireName: 'is_closed') 41 | int get isClosed; 42 | 43 | // TODO: enum 44 | /// Returned in case the group is deleted or blocked. 45 | /// Possible values: 46 | /// deleted - the group has been deleted 47 | /// banned - the group is blocked 48 | int? get deactivated; 49 | 50 | // TODO: bool 51 | /// Information about whether the current user is a manager. 52 | /// Possible values: 53 | /// 1 — is 54 | /// 0 — not 55 | /// 56 | /// Requires scope = groups 57 | @BuiltValueField(wireName: 'is_admin') 58 | int? get isAdmin; 59 | 60 | // TODO: enum 61 | /// Permission level of the current user (if is_admin = 1): 62 | /// 1 - moderator 63 | /// 2 - editor 64 | /// 3 - administrator 65 | /// 66 | /// Requires scope = groups 67 | @BuiltValueField(wireName: 'admin_level') 68 | int? get adminLevel; 69 | 70 | // TODO: enum 71 | /// Information about whether the current user is a member. 72 | /// Possible values: 73 | /// 1 - is 74 | /// 0 - not 75 | /// 76 | /// Requires scope = groups 77 | @BuiltValueField(wireName: 'is_member') 78 | int? get isMember; 79 | 80 | // TODO: enum 81 | /// Information about whether the current user is an advertiser. 82 | /// Possible values: 83 | /// 1 - is; 84 | /// 0 - not. 85 | /// 86 | /// Requires scope = groups 87 | @BuiltValueField(wireName: 'is_advertiser') 88 | int? get isAdvertiser; 89 | 90 | // TODO: enum 91 | /// The ID of the user who sent the invitation to the community. 92 | /// The field is returned only for the groups.getInvites method. 93 | /// 94 | /// Requires scope = groups 95 | @BuiltValueField(wireName: 'invited_by') 96 | int? get invitedBy; 97 | 98 | // TODO: enum 99 | /// Community type: 100 | /// group - group; 101 | /// page - public page; 102 | /// event - an event. 103 | /// 104 | /// Requires scope = groups 105 | String? get type; 106 | 107 | /// The URL of the main photo with a size of 50x50px. 108 | @BuiltValueField(wireName: 'photo_50') 109 | String get photo50; 110 | 111 | /// The URL of the main photo with a size of 100x100px. 112 | @BuiltValueField(wireName: 'photo_100') 113 | String get photo100; 114 | 115 | /// The URL of the main photo with a size of 200x200px. 116 | @BuiltValueField(wireName: 'photo_200') 117 | String get photo200; 118 | } 119 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_personal_card_result/address.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/data/model/results/common/city.dart'; 4 | import 'package:vk_bridge/src/data/model/results/common/country.dart'; 5 | 6 | part 'address.g.dart'; 7 | 8 | /// The address 9 | abstract class Address implements Built { 10 | /// [Address] factory 11 | factory Address([void Function(AddressBuilder) updates]) = _$Address; 12 | 13 | Address._(); 14 | 15 | /// [Address] serializer 16 | static Serializer
get serializer => _$addressSerializer; 17 | 18 | /// Information about the user's country. 19 | Country get country; 20 | 21 | /// Information about the user's city. 22 | City get city; 23 | 24 | /// Information about the exact address specified by the user. 25 | @BuiltValueField(wireName: 'specified_address') 26 | String get specifiedAddress; 27 | 28 | /// Postcode 29 | @BuiltValueField(wireName: 'postal_code') 30 | String get postalCode; 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_personal_card_result/vk_web_app_get_personal_card_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | import 'package:vk_bridge/src/data/model/results/vk_web_app_get_personal_card_result/address.dart'; 5 | 6 | part 'vk_web_app_get_personal_card_result.g.dart'; 7 | 8 | /// Result of [VKBridge.getClientVersion] 9 | abstract class VKWebAppGetPersonalCardResult 10 | implements 11 | Built { 13 | /// [VKWebAppGetPersonalCardResult] factory 14 | factory VKWebAppGetPersonalCardResult( 15 | [void Function(VKWebAppGetPersonalCardResultBuilder) updates]) = 16 | _$VKWebAppGetPersonalCardResult; 17 | 18 | VKWebAppGetPersonalCardResult._(); 19 | 20 | /// [VKWebAppGetPersonalCardResult] serializer 21 | static Serializer get serializer => 22 | _$vKWebAppGetPersonalCardResultSerializer; 23 | 24 | /// User's phone number. 25 | String get phone; 26 | 27 | /// User's email address. 28 | String get email; 29 | 30 | /// Information about the user's address. 31 | Address get address; 32 | } 33 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_phone_number_result/vk_web_app_get_phone_number_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_get_phone_number_result.g.dart'; 6 | 7 | /// Result of [VKBridge.getPhoneNumber] 8 | abstract class VKWebAppGetPhoneNumberResult 9 | implements 10 | Built { 12 | /// [VKWebAppGetPhoneNumberResult] factory 13 | factory VKWebAppGetPhoneNumberResult( 14 | [void Function(VKWebAppGetPhoneNumberResultBuilder) updates]) = 15 | _$VKWebAppGetPhoneNumberResult; 16 | 17 | VKWebAppGetPhoneNumberResult._(); 18 | 19 | /// [VKWebAppGetPhoneNumberResult] serializer 20 | static Serializer get serializer => 21 | _$vKWebAppGetPhoneNumberResultSerializer; 22 | 23 | /// Signature of the received data. 24 | /// For the signature, the app_id values, 25 | /// the api_secret secret signature specified 26 | /// in the settings of your application, the user_id of the user, 27 | /// and the $ field_name. $ Field_value pair returned in the event 28 | /// are sequentially combined for the signature. 29 | /// A cryptographic hash SHA256 is calculated from the string obtained 30 | /// after concatenation in byte representation. 31 | /// You need to take base64UrlEncode from the hash. 32 | /// An example of generating an event signature in php for an application 33 | /// with app_id 7770000 and a secret key W7kVvxVxZ4: 34 | /// $sign = rtrim(strtr(base64_encode(hash('sha256', 35 | /// '7770000W7kVvxVxZ4162447phone_number70000000000', true)), 36 | /// '+/', '-_'), '='); 37 | String get sign; 38 | 39 | /// User's phone number. 40 | @BuiltValueField(wireName: 'phone_number') 41 | String get phoneNumber; 42 | } 43 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_get_user_info_result/vk_web_app_get_user_info_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | import 'package:vk_bridge/src/data/model/results/common/city.dart'; 5 | import 'package:vk_bridge/src/data/model/results/common/country.dart'; 6 | 7 | part 'vk_web_app_get_user_info_result.g.dart'; 8 | 9 | /// Result of [VKBridge.getUserInfo] 10 | abstract class VKWebAppGetUserInfoResult 11 | implements 12 | Built { 13 | /// [VKWebAppGetUserInfoResult] factory 14 | factory VKWebAppGetUserInfoResult( 15 | [void Function(VKWebAppGetUserInfoResultBuilder) updates]) = 16 | _$VKWebAppGetUserInfoResult; 17 | 18 | VKWebAppGetUserInfoResult._(); 19 | 20 | /// [VKWebAppGetUserInfoResult] serializer 21 | static Serializer get serializer => 22 | _$vKWebAppGetUserInfoResultSerializer; 23 | 24 | /// User ID 25 | int get id; 26 | 27 | /// First name 28 | @BuiltValueField(wireName: 'first_name') 29 | String get firstName; 30 | 31 | /// Last name 32 | @BuiltValueField(wireName: 'last_name') 33 | String get lastName; 34 | 35 | // TODO(sanekyy): enum 36 | /// Sex. Possible values: 37 | /// - 1 - female 38 | /// - 2 - male 39 | /// - 0 - gender is not specified 40 | int get sex; 41 | 42 | // TODO(sanekyy): DateTime 43 | /// Date of Birth. Returned in the format D.M.YYYY or D.M (if the year of 44 | /// birth is hidden). If the date of birth is hidden entirely, the field is 45 | /// missing in the response 46 | String? get bdate; 47 | 48 | /// Information about the user's city 49 | City? get city; 50 | 51 | /// Information about the user's country 52 | Country? get country; 53 | 54 | /// Url of a square user photo with a width of 100 pixels. If the user does 55 | /// not have a photo, https://vk.com/images/camera_100.png is returned 56 | @BuiltValueField(wireName: 'photo_100') 57 | String get photo100; 58 | 59 | /// Url of a square user photo with a width of 200 pixels. If the user does 60 | /// not have a photo, https://vk.com/images/camera_200.png is returned 61 | @BuiltValueField(wireName: 'photo_200') 62 | String get photo200; 63 | 64 | /// url photo of maximum size. A photo that is both 400 and 200 pixels wide 65 | /// can be returned. If the user does not have a photo, 66 | /// https://vk.com/images/camera_400.png is returned 67 | @BuiltValueField(wireName: 'photo_max_orig') 68 | String get photoMaxOrig; 69 | 70 | /// Time zone 71 | int get timezone; 72 | } 73 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_open_app_result/vk_web_app_open_app_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_open_app_result.g.dart'; 6 | 7 | /// Result of [VKBridge.appClose] 8 | abstract class VKWebAppOpenAppResult 9 | implements Built { 10 | /// [VKWebAppOpenAppResult] factory 11 | factory VKWebAppOpenAppResult( 12 | [void Function(VKWebAppOpenAppResultBuilder) updates]) = 13 | _$VKWebAppOpenAppResult; 14 | 15 | VKWebAppOpenAppResult._(); 16 | 17 | /// [VKWebAppOpenAppResult] serializer 18 | static Serializer get serializer => 19 | _$vKWebAppOpenAppResultSerializer; 20 | 21 | /// TODO(sanekyy): enum 22 | /// The application close status passed to the parent application. 23 | /// Possible values: Possible values: failed, success 24 | String get status; 25 | 26 | /// Data passed to the parent application. 27 | Object? get payload; 28 | } 29 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_open_code_reader_result/vk_web_app_open_code_reader_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_open_code_reader_result.g.dart'; 6 | 7 | /// Result of [VKBridge.openCodeReader] 8 | abstract class VKWebAppOpenCodeReaderResult 9 | implements 10 | Built { 12 | /// [VKWebAppOpenCodeReaderResult] factory 13 | factory VKWebAppOpenCodeReaderResult( 14 | [void Function(VKWebAppOpenCodeReaderResultBuilder) updates]) = 15 | _$VKWebAppOpenCodeReaderResult; 16 | 17 | VKWebAppOpenCodeReaderResult._(); 18 | 19 | /// [VKWebAppOpenCodeReaderResult] serializer 20 | static Serializer get serializer => 21 | _$vKWebAppOpenCodeReaderResultSerializer; 22 | 23 | /// Decryption of the QR code. 24 | @BuiltValueField(wireName: 'code_data') 25 | String get codeData; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_resize_window_result/size.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'size.g.dart'; 5 | 6 | /// Part of [VKWebAppResizeWindowResult] 7 | abstract class Size implements Built { 8 | /// [Size] factory 9 | factory Size([void Function(SizeBuilder) updates]) = _$Size; 10 | 11 | Size._(); 12 | 13 | /// [Size] serializer 14 | static Serializer get serializer => _$sizeSerializer; 15 | 16 | /// Window width. It can take values from 630px to 1000px. 17 | int get width; 18 | 19 | /// Window height. It can take values from 500px to 4050px. 20 | int get height; 21 | } 22 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_resize_window_result/vk_web_app_resize_window_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | import 'package:vk_bridge/src/data/model/results/vk_web_app_resize_window_result/size.dart'; 5 | 6 | part 'vk_web_app_resize_window_result.g.dart'; 7 | 8 | /// Result of [VKBridge.resizeWindow] 9 | abstract class VKWebAppResizeWindowResult 10 | implements 11 | Built { 12 | /// [VKWebAppResizeWindowResult] factory 13 | factory VKWebAppResizeWindowResult( 14 | [void Function(VKWebAppResizeWindowResultBuilder) updates]) = 15 | _$VKWebAppResizeWindowResult; 16 | 17 | VKWebAppResizeWindowResult._(); 18 | 19 | /// [VKWebAppResizeWindowResult] serializer 20 | static Serializer get serializer => 21 | _$vKWebAppResizeWindowResultSerializer; 22 | 23 | /// new values for width and height. 24 | @BuiltValueField(wireName: 'result') 25 | Size get size; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_scroll_result/scroll_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'scroll_result.g.dart'; 6 | 7 | /// Result of [VKBridge.scroll] 8 | abstract class ScrollResult 9 | implements Built { 10 | /// [ScrollResult] factory 11 | factory ScrollResult([void Function(ScrollResultBuilder) updates]) = 12 | _$ScrollResult; 13 | 14 | ScrollResult._(); 15 | 16 | /// [ScrollResult] serializer 17 | static Serializer get serializer => _$scrollResultSerializer; 18 | 19 | /// The current scroll position. 20 | int get top; 21 | 22 | /// Window height after scrolling by user or method. 23 | int get height; 24 | } 25 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_scroll_result/vk_web_app_scroll_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | import 'package:vk_bridge/src/data/model/results/vk_web_app_scroll_result/scroll_result.dart'; 5 | 6 | part 'vk_web_app_scroll_result.g.dart'; 7 | 8 | /// Result of [VKBridge.scroll] 9 | abstract class VKWebAppScrollResult 10 | implements Built { 11 | /// [VKWebAppScrollResult] factory 12 | factory VKWebAppScrollResult( 13 | [void Function(VKWebAppScrollResultBuilder) updates]) = 14 | _$VKWebAppScrollResult; 15 | 16 | VKWebAppScrollResult._(); 17 | 18 | /// [VKWebAppScrollResult] serializer 19 | static Serializer get serializer => 20 | _$vKWebAppScrollResultSerializer; 21 | 22 | /// Result. 23 | ScrollResult get result; 24 | } 25 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_share_result/vk_web_app_share_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_share_result.g.dart'; 6 | 7 | /// Result of [VKBridge.share] 8 | abstract class VKWebAppShareResult 9 | implements Built { 10 | /// [VKWebAppShareResult] factory 11 | factory VKWebAppShareResult( 12 | [void Function(VKWebAppShareResultBuilder) updates]) = 13 | _$VKWebAppShareResult; 14 | 15 | VKWebAppShareResult._(); 16 | 17 | /// [VKWebAppShareResult] serializer 18 | static Serializer get serializer => 19 | _$vKWebAppShareResultSerializer; 20 | 21 | /// string containing owner_id - user ID and record id in the format 22 | /// _ 23 | @BuiltValueField(wireName: 'post_id') 24 | int? get postId; 25 | 26 | // TODO(sanekyy): enum 27 | /// this field missed in official documentation :( 28 | String get type; 29 | } 30 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_show_wall_post_box_result/vk_web_app_show_wall_post_box_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | 4 | part 'vk_web_app_show_wall_post_box_result.g.dart'; 5 | 6 | /// If the user agrees to publish, 7 | /// the [VKWebAppShowWallPostBoxResult] event is generated 8 | /// with a single post_id (integer) field 9 | /// that contains the post ID on the user's wall. 10 | abstract class VKWebAppShowWallPostBoxResult 11 | implements 12 | Built { 14 | /// [VKWebAppShowWallPostBoxResult] factory 15 | factory VKWebAppShowWallPostBoxResult( 16 | [void Function(VKWebAppShowWallPostBoxResultBuilder) updates]) = 17 | _$VKWebAppShowWallPostBoxResult; 18 | 19 | VKWebAppShowWallPostBoxResult._(); 20 | 21 | /// [VKWebAppShowWallPostBoxResult] serializer 22 | static Serializer get serializer => 23 | _$vKWebAppShowWallPostBoxResultSerializer; 24 | 25 | /// user wall post ID 26 | @BuiltValueField(wireName: 'post_id') 27 | int get postId; 28 | } 29 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_storage_get_keys_result/vk_web_app_storage_get_keys_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 5 | 6 | part 'vk_web_app_storage_get_keys_result.g.dart'; 7 | 8 | /// Result of [VKBridge.storageGetKeys] 9 | abstract class VKWebAppStorageGetKeysResult 10 | implements 11 | Built { 13 | /// [VKWebAppStorageGetKeysResult] factory 14 | factory VKWebAppStorageGetKeysResult( 15 | [void Function(VKWebAppStorageGetKeysResultBuilder) updates]) = 16 | _$VKWebAppStorageGetKeysResult; 17 | 18 | VKWebAppStorageGetKeysResult._(); 19 | 20 | /// [VKWebAppStorageGetKeysResult] serializer 21 | static Serializer get serializer => 22 | _$vKWebAppStorageGetKeysResultSerializer; 23 | 24 | /// Array of keys 25 | BuiltList get keys; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_storage_get_result/key_value_pair.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/data/model/results/vk_web_app_storage_get_result/vk_web_app_storage_get_result.dart'; 4 | 5 | part 'key_value_pair.g.dart'; 6 | 7 | /// Part of [VKWebAppStorageGetResult] 8 | abstract class KeyValuePair 9 | implements Built { 10 | /// [KeyValuePair] factory 11 | factory KeyValuePair([void Function(KeyValuePairBuilder) updates]) = 12 | _$KeyValuePair; 13 | 14 | KeyValuePair._(); 15 | 16 | /// [KeyValuePair] serializer 17 | static Serializer get serializer => _$keyValuePairSerializer; 18 | 19 | /// Key 20 | String get key; 21 | 22 | /// Value 23 | String get value; 24 | } 25 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_storage_get_result/vk_web_app_storage_get_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_collection/built_collection.dart'; 2 | import 'package:built_value/built_value.dart'; 3 | import 'package:built_value/serializer.dart'; 4 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 5 | import 'package:vk_bridge/src/data/model/results/vk_web_app_storage_get_result/key_value_pair.dart'; 6 | 7 | part 'vk_web_app_storage_get_result.g.dart'; 8 | 9 | /// Result of [VKBridge.storageGetKeys] 10 | abstract class VKWebAppStorageGetResult 11 | implements 12 | Built { 13 | /// [VKWebAppStorageGetResult] factory 14 | factory VKWebAppStorageGetResult( 15 | [void Function(VKWebAppStorageGetResultBuilder) updates]) = 16 | _$VKWebAppStorageGetResult; 17 | 18 | VKWebAppStorageGetResult._(); 19 | 20 | /// [VKWebAppStorageGetResult] serializer 21 | static Serializer get serializer => 22 | _$vKWebAppStorageGetResultSerializer; 23 | 24 | /// Array of keys 25 | BuiltList get keys; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/data/model/results/vk_web_app_subscribe_story_app_result/vk_web_app_subscribe_story_app_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:built_value/built_value.dart'; 2 | import 'package:built_value/serializer.dart'; 3 | import 'package:vk_bridge/src/bridge/vk_bridge.dart'; 4 | 5 | part 'vk_web_app_subscribe_story_app_result.g.dart'; 6 | 7 | /// Result of [VKBridge.subscribeStoryApp] 8 | abstract class VKWebAppSubscribeStoryAppResult 9 | implements 10 | Built { 12 | /// [VKWebAppSubscribeStoryAppResult] factory 13 | factory VKWebAppSubscribeStoryAppResult( 14 | [void Function(VKWebAppSubscribeStoryAppResultBuilder) updates]) = 15 | _$VKWebAppSubscribeStoryAppResult; 16 | 17 | VKWebAppSubscribeStoryAppResult._(); 18 | 19 | /// [VKWebAppSubscribeStoryAppResult] serializer 20 | static Serializer get serializer => 21 | _$vKWebAppSubscribeStoryAppResultSerializer; 22 | 23 | /// Access key for private stories 24 | @BuiltValueField(wireName: 'access_key') 25 | String get accessKey; 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/utils.dart: -------------------------------------------------------------------------------- 1 | @JS() 2 | library stringify; 3 | 4 | import 'package:js/js.dart'; 5 | 6 | /// Calls invoke JavaScript `JSON.stringify(obj)` 7 | @JS('JSON.stringify') 8 | external String stringify(Object obj); 9 | 10 | /// Calls invoke JavaScript `JSON.stringify(obj)` 11 | @JS('JSON.parse') 12 | external Object parse(String json); 13 | -------------------------------------------------------------------------------- /lib/vk_bridge.dart: -------------------------------------------------------------------------------- 1 | export 'src/bridge/logger.dart'; 2 | export 'src/bridge/vk_bridge.dart'; 3 | export 'src/data/model/errors/vk_web_app_error.dart'; 4 | export 'src/data/model/events/vk_web_app_update_config/appearance.dart'; 5 | export 'src/data/model/events/vk_web_app_update_config/insets.dart'; 6 | export 'src/data/model/events/vk_web_app_update_config/vk_web_app_update_config.dart'; 7 | export 'src/data/model/launch_params.dart'; 8 | export 'src/data/model/options/check_native_ads/ad_format.dart'; 9 | export 'src/data/model/options/get_auth_token_options/scope.dart'; 10 | export 'src/data/model/options/set_view_settings_options/status_bar_style.dart'; 11 | export 'src/data/model/options/share_options/share_options.dart'; 12 | export 'src/data/model/options/show_native_ads_options/show_native_ads_options.dart'; 13 | export 'src/data/model/options/show_story_box_options/action.dart'; 14 | export 'src/data/model/options/show_story_box_options/action_app.dart'; 15 | export 'src/data/model/options/show_story_box_options/action_link.dart'; 16 | export 'src/data/model/options/show_story_box_options/attachment.dart'; 17 | export 'src/data/model/options/show_story_box_options/background_type.dart'; 18 | export 'src/data/model/options/show_story_box_options/clickable_zone.dart'; 19 | export 'src/data/model/options/show_story_box_options/renderable_sticker.dart'; 20 | export 'src/data/model/options/show_story_box_options/show_story_box_options.dart'; 21 | export 'src/data/model/options/show_story_box_options/sticker_container.dart'; 22 | export 'src/data/model/options/show_story_box_options/transform.dart'; 23 | export 'src/data/model/options/taptic_impact_occured_options/taptic_style.dart'; 24 | export 'src/data/model/options/taptic_notification_occured_options/taptic_type.dart'; 25 | export 'src/data/model/results/vk_web_app_bool_result/vk_web_app_bool_result.dart'; 26 | export 'src/data/model/results/vk_web_app_get_ads_result/stats.dart'; 27 | export 'src/data/model/results/vk_web_app_get_ads_result/stats_type.dart'; 28 | export 'src/data/model/results/vk_web_app_get_ads_result/vk_web_app_get_ads_result.dart'; 29 | export 'src/data/model/results/vk_web_app_get_auth_token_result/vk_web_app_get_auth_token_result.dart'; 30 | export 'src/data/model/results/vk_web_app_get_client_version_result/vk_web_app_get_client_version_result.dart'; 31 | export 'src/data/model/results/vk_web_app_get_email_result/vk_web_app_get_email_result.dart'; 32 | export 'src/data/model/results/vk_web_app_get_geodata_result/vk_web_app_get_geodata_result.dart'; 33 | export 'src/data/model/results/vk_web_app_share_result/vk_web_app_share_result.dart'; 34 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: vk_bridge 2 | description: A dart package for working with VK Mini Apps via VK Bridge. Works web, mobile-web 3 | homepage: https://github.com/optimist-dev/vk_bridge 4 | version: 2.5.0 5 | 6 | environment: 7 | sdk: '>=3.4.1 <4.0.0' 8 | 9 | dependencies: 10 | js: ^0.7.1 11 | built_value: ^8.9.2 12 | built_collection: ^5.1.1 13 | rxdart: ^0.28.0 14 | # Note: meta is pinned to version 1.12.0 by flutter_test from the flutter SDK. 15 | meta: ^1.12.0 16 | 17 | dev_dependencies: 18 | test: ^1.25.8 19 | build_runner: ^2.4.11 20 | built_value_generator: ^8.9.2 21 | -------------------------------------------------------------------------------- /test/serializers_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:test/test.dart'; 4 | import 'package:vk_bridge/src/data/model/events/vk_web_app_update_config/vk_web_app_update_config.dart'; 5 | import 'package:vk_bridge/src/data/model/results/vk_web_app_get_geodata_result/vk_web_app_get_geodata_result.dart'; 6 | import 'package:vk_bridge/src/data/model/serializers.dart'; 7 | 8 | void main() { 9 | test('VKWebAppGetGeodataResult deserialize test. Available is bool', () { 10 | final Object json = jsonDecode(''' 11 | { 12 | "available":true, 13 | "lat":10.0, 14 | "long":20.0 15 | } 16 | ''') as Object; 17 | final result = deserialize(json); 18 | expect(result != null, true); 19 | expect(result!.available, true); 20 | expect(result.lat, 10); 21 | expect(result.long, 20); 22 | }); 23 | 24 | test('VKWebAppGetGeodataResult deserialize test. Available is int', () { 25 | final Object json = jsonDecode(''' 26 | { 27 | "available":1, 28 | "lat":10.0, 29 | "long":20.0 30 | } 31 | ''') as Object; 32 | final result = deserialize(json); 33 | expect(result != null, true); 34 | expect(result!.available, true); 35 | expect(result.lat, 10); 36 | expect(result.long, 20); 37 | }); 38 | 39 | test('VKWebAppGetGeodataResult serialize test', () { 40 | final result = VKWebAppGetGeodataResult( 41 | (VKWebAppGetGeodataResultBuilder b) => b 42 | ..available = true 43 | ..lat = 10 44 | ..long = 10, 45 | ); 46 | final json = jsonEncode(serialize(result)); 47 | expect(json, '{"available":true,"lat":10.0,"long":10.0}'); 48 | }); 49 | 50 | // 51 | test('VKWebAppUpdateConfig deserialize', () { 52 | final Object json = jsonDecode(''' 53 | { 54 | "api_host":"api.vk.com", 55 | "scheme":"bright_light", 56 | "is_layer":true, 57 | "viewport_width":1792, 58 | "viewport_height":1009 59 | } 60 | ''') as Object; 61 | deserialize(json); 62 | }); 63 | } 64 | --------------------------------------------------------------------------------