glow_effects 0.2.0
glow_effects: ^0.2.0 copied to clipboard
GPU-native visual effects for Flutter — Fragment Shaders, CustomPainter & Explicit Animations. 11 shader effects, 4 painters, text effects, page transitions & more.
import 'package:flutter/material.dart';
import 'package:glow_effects/glow_effects.dart';
import 'tabs/shaders_tab.dart';
import 'tabs/painters_tab.dart';
import 'tabs/text_tab.dart';
import 'tabs/transitions_tab.dart';
import 'tabs/composer_tab.dart';
import 'tabs/radar_tab.dart';
void main() {
runApp(const ShaderEffectsExampleApp());
}
class ShaderEffectsExampleApp extends StatelessWidget {
const ShaderEffectsExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Shader Effects Showcase',
debugShowCheckedModeBanner: false,
theme: ThemeData.dark(useMaterial3: true).copyWith(
scaffoldBackgroundColor: const Color(0xFF0A0A0A),
),
home: const ShowcaseShell(),
);
}
}
class ShowcaseShell extends StatefulWidget {
const ShowcaseShell({super.key});
@override
State<ShowcaseShell> createState() => _ShowcaseShellState();
}
class _ShowcaseShellState extends State<ShowcaseShell> {
int _tabIndex = 0;
bool _showDebug = false;
static const _tabs = <Widget>[
ShadersTab(),
PaintersTab(),
TextTab(),
TransitionsTab(),
ComposerTab(),
RadarTab(),
];
@override
Widget build(BuildContext context) {
Widget body = Scaffold(
body: IndexedStack(index: _tabIndex, children: _tabs),
bottomNavigationBar: BottomNavigationBar(
currentIndex: _tabIndex,
onTap: (i) => setState(() => _tabIndex = i),
type: BottomNavigationBarType.fixed,
selectedItemColor: Colors.cyanAccent,
unselectedItemColor: Colors.white38,
backgroundColor: const Color(0xFF111111),
items: const [
BottomNavigationBarItem(icon: Icon(Icons.auto_awesome), label: 'Shaders'),
BottomNavigationBarItem(icon: Icon(Icons.brush), label: 'Painters'),
BottomNavigationBarItem(icon: Icon(Icons.text_fields), label: 'Text'),
BottomNavigationBarItem(icon: Icon(Icons.swap_horiz), label: 'Transitions'),
BottomNavigationBarItem(icon: Icon(Icons.layers), label: 'Composer'),
BottomNavigationBarItem(icon: Icon(Icons.radar), label: 'Radar'),
],
),
floatingActionButton: FloatingActionButton.small(
onPressed: () => setState(() => _showDebug = !_showDebug),
backgroundColor: _showDebug ? Colors.cyanAccent : Colors.white24,
child: Icon(Icons.bug_report, color: _showDebug ? Colors.black : Colors.white),
),
);
if (_showDebug) {
body = GKDebugOverlay(showFps: true, showUniforms: true, child: body);
}
return body;
}
}