I want to put an introduction screen, I’m using the introduction_screen package, but it gives me an error, this is my code:
This application was working fine until I started adding the induction screen, from then on I can no longer compile the application because the error is occurring.
I created an introductionscreen from the introduction_screen package, the pack version is 3.1.12
class IntrodutionScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: IntroductionScreen(
globalBackgroundColor: Colors.white,
scrollPhysics: const BouncingScrollPhysics(),
pages: [
PageViewModel(
titleWidget: Text(
"Bem vindo",
style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold),
),
body: "Bem-vindo, esta aplicação vai mostrar todos os eventos realizados na Escola Secundaria Henrique Medina",
image: Image.asset("assets/Logos/eshm.png",
height: 400,
width: 400,
),
),
PageViewModel(
titleWidget: Text(
"Informaçoes",
style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold),
),
body: "Para ver mais informações sobre o evento, clique em cima dele",
image: Image.asset(
"assets/Logos/eshm.png",
height: 400,
width: 400,
),
),
PageViewModel(
titleWidget: Text(
"Edição",
style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold),
),
body: "Erraste ao escrever o nome? Não te preocupes podes sempre editar dentro da aplicaçao",
image: Image.asset(
"assets/Gifs/pen.gif",
height: 400,
width: 400,
),
),
],
onDone: () {
Constants.saveIntrodutionInSharedPreference(true);
Navigator.of(context)
.pushReplacement(MaterialPageRoute(builder: (_) => Login()));
},
onSkip: () {
Constants.saveIntrodutionInSharedPreference(true);
Navigator.of(context)
.pushReplacement(MaterialPageRoute(builder: (_) => Login()));
},
showSkipButton: true,
skip: Text(
"Skip",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
color: Color(0xFF17203A),
),
),
showNextButton: true,
next: const Icon(
Icons.arrow_forward,
color: Color(0xFF17203A),
),
showDoneButton: true,
done: Text(
"Done",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
color: Color(0xFF17203A),
),
),
dotsDecorator: const DotsDecorator(
size: Size.square(10.0),
activeSize: Size(20.0, 10.0),
color: Colors.black26,
activeColor: Color(0xFFBDBDBD),
spacing: EdgeInsets.symmetric(horizontal: 3.0),
activeShape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(25.0)),
),
),
),
);
}
} ```
This error has been happening to me all the time, can anyone help me?
You must set either 'pages' or 'rawPages' parameter
'package:introduction_screen/src/introduction_screen.dart':
Failed assertion: line 340 pos 11: 'pages != null || rawPages != null'




