#android #flutter #dart #splash-screen
Вопрос:
Всем привет, я пытаюсь создать заставку с флаттером, используя пакет animated_splash_screen 1.1.0.к сожалению, я получаю эту ошибку: Оператор проверки Null используется для нулевого значения. Соответствующий виджет, вызывающий ошибку, был GetMaterialApp libmain. dart:29
это мой основной класс по стрельбе дротиками :
import 'package:animated_splash_screen/animated_splash_screen.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:fish_app/views/homepage.dart';
import 'package:flutter/material.dart';
import 'package:get/get_navigation/src/root/get_material_app.dart';
import 'package:page_transition/page_transition.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
await MobileAds.initialize();
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return GetMaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
// primaryColor: Colors.orangeAccent,
),
home: AnimatedSplashScreen(
duration: 3000,
splash: Icons.home,
nextScreen: Homepage(),
splashTransition: SplashTransition.fadeTransition,
pageTransitionType: PageTransitionType.scale,
backgroundColor: Colors.blue
)
);
}
}
Комментарии:
1. Здравствуйте, @ravindra-s-patil у вас есть какие-либо предложения?