bgremove_flutter 0.0.5 copy "bgremove_flutter: ^0.0.5" to clipboard
bgremove_flutter: ^0.0.5 copied to clipboard

AI-powered background removal for Flutter apps. Fast, client-side image processing with WebGPU acceleration.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:bgremove_flutter/bgremove_flutter.dart';

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

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

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

class _MyAppState extends State<MyApp> {
  String _status = 'Not initialized';
  bool _webGpuSupported = false;

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

  Future<void> initPlugin() async {
    try {
      await BgRemoveFlutter.initialize();
      final caps = await BgRemoveFlutter.getCapabilities();
      final webGpuSupported = await BgRemoveFlutter.isWebGpuSupported();
      
      if (!mounted) return;

      setState(() {
        _status = 'Initialized successfully\nDevice: ${caps.device}\nDtype: ${caps.dtype}';
        _webGpuSupported = webGpuSupported;
      });
    } on PlatformException catch (e) {
      if (!mounted) return;
      
      setState(() {
        _status = 'Failed to initialize: ${e.message}';
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('BgRemove Flutter Example')),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(_status, textAlign: TextAlign.center),
              const SizedBox(height: 16),
              Text('WebGPU Supported: $_webGpuSupported'),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
150
points
226
downloads

Publisher

unverified uploader

Weekly Downloads

AI-powered background removal for Flutter apps. Fast, client-side image processing with WebGPU acceleration.

Repository (GitHub)
View/report issues

Topics

#background-removal #image-processing #ai #webgpu #bgremove

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on bgremove_flutter

Packages that implement bgremove_flutter