metal_capture_util 0.0.2 copy "metal_capture_util: ^0.0.2" to clipboard
metal_capture_util: ^0.0.2 copied to clipboard

PlatformiOSmacOS

A Metal Capture utility for Flutter applications on iOS/macOS.

example/lib/main.dart

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

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  MetalCapture.registerServiceExtension();
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text('You have pushed the button this many times:'),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          FloatingActionButton(
            onPressed: _incrementCounter,
            tooltip: 'Increment',
            child: const Icon(Icons.add),
          ),
          FloatingActionButton(
            onPressed: () {
              MetalCapture.captureNextFrame(openFile: true);
            },
            tooltip: 'Capture next frame',
            child: const Icon(Icons.camera),
          ),
        ],
      ),
    );
  }
}
0
likes
140
points
4
downloads

Publisher

verified publisherkekland.com

Weekly Downloads

A Metal Capture utility for Flutter applications on iOS/macOS.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

ffi, flutter, objective_c, vm_service

More

Packages that depend on metal_capture_util

Packages that implement metal_capture_util