than_pkg 4.1.0 copy "than_pkg: ^4.1.0" to clipboard
than_pkg: ^4.1.0 copied to clipboard

My personal Flutter plugin with support for both Android and Linux platforms.

example/lib/main.dart

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:than_pkg/linux_pkg/linux_noti_util.dart';
import 'package:than_pkg/than_pkg.dart';
import 'package:than_pkg/types/installed_app.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await ThanPkg.instance.init(
    isShowDebugLog: true,
  );

  runApp(MaterialApp(
    debugShowCheckedModeBanner: false,
    home: const MyApp(),
  ));
}

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

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    init();
  }

  bool isFullScreen = false;
  String imageUri = '';
  final TextEditingController textEditingController = TextEditingController();
  List<InstalledApp> appList = [];

  void init() async {
    if (Platform.isAndroid) {
      await ThanPkg.android.app.toggleKeepScreenOn(isKeep: true);
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('test lib'),
      ),
      body: Placeholder(),
      floatingActionButton: FloatingActionButton(
        // onPressed: _test,
        onPressed: () async {
          try {
            if (!await ThanPkg.platform.isStoragePermissionGranted()) {
              await ThanPkg.platform.requestStoragePermission();
            }

            ThanPkg.linux.app.openWebCam();
          } catch (e) {
            debugPrint(e.toString());
          }
        },
        child: Icon(Icons.get_app),
      ),
    );
  }
}
1
likes
0
points
1.18k
downloads

Publisher

unverified uploader

Weekly Downloads

My personal Flutter plugin with support for both Android and Linux platforms.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, intl, mime, package_info_plus, plugin_platform_interface, timeago, window_manager

More

Packages that depend on than_pkg

Packages that implement than_pkg