flutter_bugly_latest 1.0.1 copy "flutter_bugly_latest: ^1.0.1" to clipboard
flutter_bugly_latest: ^1.0.1 copied to clipboard

Flutter plugin for Tencent Bugly, exclude application update

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_bugly_latest/flutter_bugly_latest.dart';

void main() => FlutterBugly.postCatchedException(
      () => runApp(MyApp()),
      debugUpload: true,
    );

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    FlutterBugly.init(
      androidAppId: "5346b6e5bb",
      iOSAppId: "your app id",
      // 调用Android原生升级方式
      // autoCheckUpgrade: true,
      // checkUpgradeCount: 0,
      // upgradeCheckPeriod: 60,
    ).then((_result) {
      setState(() {
        _platformVersion = _result.message;
        print(_result.appId);
      });
    });
    FlutterBugly.setUserId("user id");
    FlutterBugly.putUserData(key: "key", value: "value");
    int tag = 9527;
    FlutterBugly.setUserTag(tag);
    //autoCheckUpgrade为true时,可以不用调用
    // if (mounted) _checkUpgrade();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Plugin example app'),
      ),
      body: GestureDetector(
        onTap: () {
          throw 'test';
        },
        child: Center(
          child: Text('init result: $_platformVersion\n'),
        ),
      ),
    );
  }
}
0
likes
140
points
24
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin for Tencent Bugly, exclude application update

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on flutter_bugly_latest