animated_fading_widget 0.0.2 animated_fading_widget: ^0.0.2 copied to clipboard
Looking to FadeInOut your widget with a specified duration? Just provide the duration and the widget will continuously fade in and out.
import 'package:animated_fading_widget/animated_fading_widget.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Animated Fading Widget Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const Home(),
);
}
}
class Home extends StatelessWidget {
const Home({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const Scaffold(
body: SizedBox(
child: Center(
child: AnimatedFadingWidget(
child: Text(
'Welcome !',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 50,
),
),
duration: Duration(seconds: 2),
),
),
),
);
}
}