flts 0.0.7 copy "flts: ^0.0.7" to clipboard
flts: ^0.0.7 copied to clipboard

retracted

A flutter plugin wrapper for huawei lts.

example/lib/main.dart

import 'dart:io';

import 'package:flts/models/log_level.dart';
import 'package:flts/models/lts_config.dart';
import 'package:flts/models/lts_log.dart';
import 'package:flutter/material.dart';
import 'package:flts/flts.dart';

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

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

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

class _MyAppState extends State<MyApp> {
  final _fltsPlugin = Flts();

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              ElevatedButton(
                onPressed: () {
                  LTSConfig config = LTSConfig(
                    region: "cn-north-4",

                  );
                  _fltsPlugin.initLts(config);
                  _fltsPlugin.setLocalLogLevel(LTSLogLevel.DEBUG);
                },
                child: Text("init"),
              ),
              SizedBox(height: 20),
              ElevatedButton(
                onPressed: () {
                  _fltsPlugin.reportImmediately(LTSReport(logs: [
                    {"测试日志key": "测试日志的value${Platform.operatingSystem}"},
                    {"测试日志key2": "测试日志的value2${Platform.operatingSystem}"},
                  ], labels: {
                    "label_key": "label_value"
                  }));
                },
                child: Text("report"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
0
points
23
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter plugin wrapper for huawei lts.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flts