diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml index 57bd391..0b08322 100644 --- a/android/app/src/main/res/drawable-v21/launch_background.xml +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -1,7 +1,7 @@ - + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml index 0b08322..1119b3a 100644 --- a/android/app/src/main/res/drawable/launch_background.xml +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -4,7 +4,7 @@ - + diff --git a/android/app/src/main/res/mipmap-hdpi/splash.gif b/android/app/src/main/res/mipmap-hdpi/splash.gif new file mode 100644 index 0000000..f8d83a0 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/splash.gif differ diff --git a/android/app/src/main/res/mipmap-mdpi/splash.gif b/android/app/src/main/res/mipmap-mdpi/splash.gif new file mode 100644 index 0000000..f8d83a0 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/splash.gif differ diff --git a/android/app/src/main/res/mipmap-mdpi/splash.png b/android/app/src/main/res/mipmap-mdpi/splash.png deleted file mode 100644 index e0de25e..0000000 Binary files a/android/app/src/main/res/mipmap-mdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xhdpi/splashgif.gif b/android/app/src/main/res/mipmap-xhdpi/splashgif.gif new file mode 100644 index 0000000..f8d83a0 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/splashgif.gif differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/splash.gif b/android/app/src/main/res/mipmap-xxhdpi/splash.gif new file mode 100644 index 0000000..f8d83a0 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/splash.gif differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/splash.gif b/android/app/src/main/res/mipmap-xxxhdpi/splash.gif new file mode 100644 index 0000000..f8d83a0 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/splash.gif differ diff --git a/images/sonido.mp3 b/images/sonido.mp3 new file mode 100644 index 0000000..99d36e9 Binary files /dev/null and b/images/sonido.mp3 differ diff --git a/images/splashgif.gif b/images/splashgif.gif new file mode 100644 index 0000000..f8d83a0 Binary files /dev/null and b/images/splashgif.gif differ diff --git a/lib/main.dart b/lib/main.dart index e925d03..5cadf73 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,5 @@ +import 'package:animated_splash_screen/animated_splash_screen.dart'; +import 'package:audioplayers/audioplayers.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:get/get.dart'; @@ -73,7 +75,6 @@ void main() async { ]); usePathUrlStrategy(); runApp(const MyApp()); - } class MyApp extends StatelessWidget { @@ -85,8 +86,9 @@ class MyApp extends StatelessWidget { theme: ThemeData(fontFamily: 'Poppins'), debugShowCheckedModeBanner: false, title: 'ProsApp', - initialRoute: '/', + initialRoute: '/splash', routes: { + '/splash': (context) => const SplashScreen(), '/': (context) => const LoginScreen(), '/login': (context) => const LoginEmailScreen(), '/profile': (context) => const ProfileScreen(), @@ -111,3 +113,43 @@ class MyApp extends StatelessWidget { ); } } + +class SplashScreen extends StatefulWidget { + const SplashScreen({super.key}); + + @override + State createState() => _SplashScreenState(); +} + +class _SplashScreenState extends State { + // AudioPlayer audioPlayer = AudioPlayer(); + + // @override + // void initState() { + // super.initState(); + // playSound(); + // } + + // void playSound() async { + // await audioPlayer.play(UrlSource('images/sonido.mp3')); + // } + + @override + Widget build(BuildContext context) { + return AnimatedSplashScreen.withScreenFunction( + splash: 'images/splashgif.gif', + screenFunction: () async { + return const LoginScreen(); + }, + splashTransition: SplashTransition.rotationTransition, + duration: 80000, + ); + } +} + + + // splash: 'images/splashgif.gif', + // backgroundColor: Colors.black, + // nextScreen: const LoginScreen(), + // splashIconSize: 50, + // duration: 80000, \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 6cf8d79..8a48901 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -9,6 +9,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.3" + animated_splash_screen: + dependency: "direct main" + description: + name: animated_splash_screen + sha256: f45634db6ec4e8cf034c53e03f3bd83898a16fe3c9286bf5510b6831dfcf2124 + url: "https://pub.dev" + source: hosted + version: "1.3.0" args: dependency: transitive description: @@ -824,6 +832,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" + page_transition: + dependency: transitive + description: + name: page_transition + sha256: a7694bc120b7064a7f57c336914bb8885acf4f70bb3772c30c2fcfe6a85e43ff + url: "https://pub.dev" + source: hosted + version: "2.0.9" path: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index e689512..9fe253b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -69,6 +69,7 @@ dependencies: firebase_messaging: ^14.6.3 awesome_notifications: ^0.7.4+1 audioplayers: ^4.1.0 + animated_splash_screen: ^1.3.0 dev_dependencies: flutter_test: