crcanimation 0.0.2 crcanimation: ^0.0.2 copied to clipboard
A Flutter package for implementing CRC animation. This package provides utilities for creating animated CRC (Cyclic Redundancy Check) representations in Flutter applications. Don't forget to subscribe [...]
import 'package:flutter/material.dart';
import 'package:crcanimation/crcanimation.dart';
void main() {
runApp(const MyApp());
}
// Calling My App
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'CRC Animation',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
useMaterial3: true,
),
home: const MyHomePage(title: 'CRC Animation Example'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@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>[
CRCAnimation.applyAnimation(
child: const Text(
'Youtube: Code Red Clan',
),
type: AnimationType.bounce,
context: context,
//Duration is optional
duration: const Duration(seconds: 1)),
CRCAnimation.applyAnimation(
child: Container(
decoration: BoxDecoration(
color: Colors.amber,
borderRadius: BorderRadius.circular(12)),
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Youtube: Code Red Clan',
),
),
),
type: AnimationType.fadeIn,
context: context,
//Duration is optional
duration: const Duration(seconds: 1)),
CRCAnimation.applyAnimation(
child: Container(
decoration: BoxDecoration(
color: Colors.greenAccent,
borderRadius: BorderRadius.circular(12)),
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Youtube: Code Red Clan',
),
),
),
type: AnimationType.flip,
context: context,
//Duration is optional
duration: const Duration(seconds: 1)),
CRCAnimation.applyAnimation(
child: Container(
decoration: BoxDecoration(
color: Colors.pinkAccent,
borderRadius: BorderRadius.circular(12)),
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Youtube: Code Red Clan',
),
),
),
type: AnimationType.grow,
context: context,
//Duration is optional
duration: const Duration(seconds: 1)),
CRCAnimation.applyAnimation(
child: Container(
decoration: BoxDecoration(
color: Colors.orange,
borderRadius: BorderRadius.circular(12)),
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Youtube: Code Red Clan',
),
),
),
type: AnimationType.rotate,
context: context,
//Duration is optional
duration: const Duration(seconds: 1)),
CRCAnimation.applyAnimation(
child: Container(
decoration: BoxDecoration(
color: Colors.blueAccent,
borderRadius: BorderRadius.circular(12)),
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Youtube: Code Red Clan',
),
),
),
type: AnimationType.scale,
context: context,
//Duration is optional
duration: const Duration(seconds: 1)),
CRCAnimation.applyAnimation(
child: Container(
decoration: BoxDecoration(
color: Colors.tealAccent,
borderRadius: BorderRadius.circular(12)),
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Youtube: Code Red Clan',
),
),
),
type: AnimationType.slideIn,
context: context,
//Duration is optional
duration: const Duration(seconds: 1)),
CRCAnimation.applyAnimation(
child: Container(
decoration: BoxDecoration(
color: Colors.cyanAccent,
borderRadius: BorderRadius.circular(12)),
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Youtube: Code Red Clan',
),
),
),
type: AnimationType.slideAndFade,
context: context,
//Duration is optional
duration: const Duration(seconds: 1)),
CRCAnimation.applyAnimation(
child: Container(
decoration: BoxDecoration(
color: Colors.lightBlueAccent,
borderRadius: BorderRadius.circular(12)),
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Youtube: Code Red Clan',
),
),
),
type: AnimationType.easeQuint,
context: context,
//Duration is optional
duration: const Duration(seconds: 1)),
],
),
),
);
}
}