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

A new Flutter plugin for gamebox extend developed.

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:gamebox_plugin/gamebox_plugin.dart';
import 'package:gamebox_plugin/screen/main_page.dart';

final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';
  final _gameboxPlugin = GameboxPlugin();

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String platformVersion;
    // Platform messages may fail, so we use a try/catch PlatformException.
    // We also handle the message potentially returning null.
    try {
      platformVersion = await _gameboxPlugin.getPlatformVersion() ??
          'Unknown platform version';
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorKey: navigatorKey,
      home: Scaffold(
        body: MainPage(),
      ),
    );
  }
}
0
likes
35
points
72
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter plugin for gamebox extend developed.

License

MIT (license)

Dependencies

adobe_xd, advanced_search, app_tracking_transparency, args, asn1lib, back_button_interceptor, build_runner, cached_network_image, card_swiper, charts_flutter, clock, collection, connectivity_plus, crypto, cupertino_icons, dartdoc, decimal, dio, easy_permission, ele_progress, encrypt, event_bus, expansion_tile_card, extended_nested_scroll_view, f_verification_box, ff_annotation_route_library, flexible_calendar, flustars, flutter, flutter_advanced_switch, flutter_easyloading, flutter_easyrefresh, flutter_hooks, flutter_keyboard_visibility, flutter_localizations, flutter_native_splash, flutter_pie_chart, flutter_riverpod, flutter_screenshot_callback, flutter_screenutil, flutter_spinkit, flutter_staggered_grid_view, flutter_svg, flutter_switch, fluttertoast, geolocator, geolocator_android, geolocator_apple, get, group_button, hooks_riverpod, html, http, image_cacheing, image_picker, image_picker_ios, in_app_purchase, in_app_purchase_android, intl, isolate_downloader, json_annotation, json_serializable, loading_indicator, loading_more_list, mobcommonlib, mobsms, molten_navigationbar_flutter, ndialog, need_resume, o_popup, octo_image, package_info_plus, path, path_provider, percent_indicator, plugin_platform_interface, pointycastle, preload_page_view, progress_tab_bar, provider, r_dotted_line_border, responsive_framework, rongcloud_im_wrapper_plugin, rubber, sensors_plus, shared_preferences, sleek_circular_slider, sp_util, sqflite, tobias, umeng_common_sdk, url_launcher, url_launcher_ios, velocity_x, webview_flutter, webview_flutter_wkwebview

More

Packages that depend on gamebox_plugin

Packages that implement gamebox_plugin