Skip to content

Commit

Permalink
Update IntorSlider.dart
Browse files Browse the repository at this point in the history
fix twice show bug
  • Loading branch information
SamadiPour authored Aug 5, 2019
1 parent 15363cc commit 4aa9b1b
Showing 1 changed file with 34 additions and 27 deletions.
61 changes: 34 additions & 27 deletions lib/pages/intro/IntorSlider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,47 @@ import 'package:intro_slider/intro_slider.dart' as Intro;


class IntroSlider extends StatelessWidget {

Widget build(BuildContext context) {
var data = SliderData();
var pages = data.getPages();
return Scaffold(
body: SafeArea(
child: Intro.IntroSlider(
slides: pages,
renderNextBtn: Icon(
Icons.navigate_next,
color: Colors.black,
size: 25.0,
),
renderDoneBtn: Icon(
Icons.done,
color: Colors.black,
size: 25.0,
),
renderSkipBtn: Text(
'SKIP',
style: TextStyle(
return WillPopScope(
onWillPop: (){
return Future.value(false);
},
child: Scaffold(
body: SafeArea(
child: Intro.IntroSlider(
slides: pages,
renderNextBtn: Icon(
Icons.navigate_next,
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.bold,
size: 25.0,
),
renderDoneBtn: Icon(
Icons.done,
color: Colors.black,
size: 25.0,
),
renderSkipBtn: Text(
'SKIP',
style: TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
onDonePress: () async {
await (await SharedPreferences.getInstance())
.setBool('INTRO_SEEN', true);
// Navigator.pushReplacementNamed(context, '/');
Navigator.pop(context);
},
backgroundColorAllSlides: Colors.grey[50],
listCustomTabs: data.renderListCustomTabs(pages),
),
onDonePress: () async {
await (await SharedPreferences.getInstance())
.setBool('INTRO_SEEN', true);
Navigator.pushReplacementNamed(context, '/');
},
backgroundColorAllSlides: Colors.grey[50],
listCustomTabs: data.renderListCustomTabs(pages),
),
),
);
}
}
}

0 comments on commit 4aa9b1b

Please sign in to comment.