flutter_sys_call 1.0.0 copy "flutter_sys_call: ^1.0.0" to clipboard
flutter_sys_call: ^1.0.0 copied to clipboard

一个用来调用系统小功能的插件,目前包括震动,视频录制,二维码识别

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:flutter_sys_call/flutter_sys_call.dart';
import 'main_page.dart';
import 'preview_video_page.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @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.
    try {
      platformVersion = await FlutterSysCall.platformVersion;
    } 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(home: MainPage());
  }
}
0
likes
20
pub points
0%
popularity

Publisher

unverified uploader

一个用来调用系统小功能的插件,目前包括震动,视频录制,二维码识别

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, path_provider, permission_handler

More

Packages that depend on flutter_sys_call