Hole Spread Splash is a Flutter package that provides a splash screen with an expanding hole animation effect. It creates a visually appealing transition between the splash screen and the main screen of your Flutter application.
- Customizable hole size, position, and color
- Adjustable animation duration
- Easy to integrate into your Flutter application
To use Hole Spread Splash in your Flutter project, follow these steps:
-
Add the following dependency to your
pubspec.yaml
file:dependencies: hole_spread_splash: ^0.0.2 Run flutter pub get to install the package. Usage Import the package in your Dart file:
-
Run flutter pub get to install the package.
- Import the package in your Dart file:
import 'package:hole_spread_splash/hole_spread_splash.dart';
- Create an instance of 'Splash' and customize it according to your needs. You can specify the logo, hole color, additional logo, and other parameters.
Splash splash = Splash(
logo: MyLogoWidget(),
holeColor: Colors.amber,
outerColor: Colors.black,
additionalLogo: AdditionalLogoWidget(),
animationDuration: Duration(seconds: 2),
);
- example usage
import 'package:flutter/material.dart';
import 'package:hole_spread_splash/hole_spread_splash.dart';
import 'home_page.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
initialRoute: '/splash',
routes: {
'/': (context) => const HomePage(),
'/splash': (context) => Splash(
logo: Center(
child: Image.asset(
'assets/images/hong.gif',
width: 150,
height: 150,
),
),
destinationPage: const HomePage(),
holeColor: Colors.amber,
outerColor: Colors.black,
)
},
);
}
}
- Run your Flutter app and enjoy the splash screen with the expanding hole animation effect!
For a complete example of using Hole Spread Splash, please refer to the example directory of this package.
This project is licensed under the MIT License - see the LICENSE file for details.