animated_glitch 2.0.0-dev.2 animated_glitch: ^2.0.0-dev.2 copied to clipboard
Animated Glitch is a Flutter package that allows you to easily create glitch effects and control them
import 'package:animated_glitch/animated_glitch.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Animated Glitch Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: AnimatedGlitchWithShader(
chance: 50,
colorChannelSpreadReduce: 30,
distortionSpreadReduce: 20,
frequency: 1,
level: 0.7,
glitchAmount: 3,
showColorChannel: true,
showDistortion: true,
child: Image.asset(
'assets/cyberpunk.jpg',
fit: BoxFit.cover,
height: double.infinity,
width: double.infinity,
),
),
);
}
}