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

outdated

Image filters based on OpenGL(SPIR-V) fragment shaders with useful preview widgets

example/main.dart

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

class PreviewPage extends StatefulWidget {
  const PreviewPage({Key? key}) : super(key: key);

  @override
  State<PreviewPage> createState() => _PreviewPageState();
}

class _PreviewPageState extends State<PreviewPage> {
  late TextureSource texture;
  late BrightnessShaderConfiguration configuration;
  bool textureLoaded = false;

  @override
  void initState() {
    super.initState();
    configuration = BrightnessShaderConfiguration();
    configuration.brightness = 0.5;
    TextureSource.fromAsset('demo.jpeg')
        .then((value) => texture = value)
        .whenComplete(
          () => setState(() {
            textureLoaded = true;
          }),
        );
  }

  @override
  Widget build(BuildContext context) {
    return textureLoaded
        ? ImageShaderPreview(
            texture: texture,
            configuration: configuration,
          )
        : const Offstage();
  }
}
62
likes
0
points
356
downloads

Publisher

unverified uploader

Weekly Downloads

Image filters based on OpenGL(SPIR-V) fragment shaders with useful preview widgets

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, flutter, flutter_gpu_filters_interface

More

Packages that depend on flutter_image_filters