animated_cross_fade_plus 0.0.4
animated_cross_fade_plus: ^0.0.4 copied to clipboard
A Flutter package that provides an enhanced version of AnimatedCrossFade with support for multiple children and customizable animations.
import 'package:flutter/material.dart';
import 'manual_example.dart';
import 'autoplay_example.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'AnimatedCrossFadePlus Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
),
home: const HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('AnimatedCrossFadePlus Examples'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ManualCarouselExample(),
),
);
},
child: const Text('Manual Carousel Example'),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const AutoPlayCarouselExample(),
),
);
},
child: const Text('Auto-Play Carousel Example'),
),
],
),
),
);
}
}