Skip to content

Commit 021f11e

Browse files
authored
Merge pull request #174 from Macacoazul01/master
3.1.8
2 parents 12d59c5 + c6bcd40 commit 021f11e

6 files changed

+115
-126
lines changed

.flutter-plugins-dependencies

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_keyboard_visibility","path":"C:\\\\Users\\\\gian_\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_keyboard_visibility-5.4.0\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"C:\\\\Users\\\\gian_\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_keyboard_visibility-5.4.0\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"flutter_keyboard_visibility_macos","path":"C:\\\\Users\\\\gian_\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_keyboard_visibility_macos-1.0.0\\\\","native_build":false,"dependencies":[]}],"linux":[{"name":"flutter_keyboard_visibility_linux","path":"C:\\\\Users\\\\gian_\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_keyboard_visibility_linux-1.0.0\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"flutter_keyboard_visibility_windows","path":"C:\\\\Users\\\\gian_\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_keyboard_visibility_windows-1.0.0\\\\","native_build":false,"dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"C:\\\\Users\\\\gian_\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_keyboard_visibility_web-2.0.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_keyboard_visibility","dependencies":["flutter_keyboard_visibility_linux","flutter_keyboard_visibility_macos","flutter_keyboard_visibility_web","flutter_keyboard_visibility_windows"]},{"name":"flutter_keyboard_visibility_linux","dependencies":[]},{"name":"flutter_keyboard_visibility_macos","dependencies":[]},{"name":"flutter_keyboard_visibility_web","dependencies":[]},{"name":"flutter_keyboard_visibility_windows","dependencies":[]}],"date_created":"2023-04-19 21:51:08.892689","version":"3.7.11"}

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [3.1.8] - 2023-04-19
8+
- Added safeAreaList parameter [PR#174](https://github.com/Pyozer/introduction_screen/pull/174)
9+
710
## [3.1.7] - 2023-03-16
811
- Added hideBottomOnKeyboard parameter [PR#171](https://github.com/Pyozer/introduction_screen/pull/171)
912

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You just need to add `introduction_screen` as a [dependency in your pubspec.yaml
1717

1818
```yaml
1919
dependencies:
20-
introduction_screen: ^3.1.7
20+
introduction_screen: ^3.1.8
2121
```
2222
2323
## Examples
@@ -459,6 +459,7 @@ This is the full list:
459459
- Change default implicit scrolling behavior by adding `allowImplicitScrolling: true`
460460
- Default `false`
461461
- Reference: [PageView's `allowImplicitScrolling` parameter](https://api.flutter.dev/flutter/widgets/PageView/PageView.html)
462+
- Activate the SafeArea by setting `safeAreaList: [true,true,true,true]` parameter.
462463

463464
### PageViewModel parameters
464465

example/test/widget_test.dart

-29
This file was deleted.

lib/src/introduction_screen.dart

+108-95
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,12 @@ class IntroductionScreen extends StatefulWidget {
254254
/// @Default `false`
255255
final bool allowImplicitScrolling;
256256

257+
/// PageView's bool safe area list.
258+
/// the list defines if the safe area will be active on left,right,top and bottom, respectively.
259+
///
260+
/// @Default `[false,false,false,false]`
261+
final List<bool> safeAreaList;
262+
257263
/// A handler to check if the user is allowed to progress to the next page.
258264
/// If returned value is true, the page will progress to the next page, otherwise the page will not progress.
259265
/// In order to make it work properly with TextFormField, you should place setState in the onChanged callback of the TextFormField.
@@ -332,6 +338,7 @@ class IntroductionScreen extends StatefulWidget {
332338
this.rtl = false,
333339
this.allowImplicitScrolling = false,
334340
this.canProgress = defaultCanProgressFunction,
341+
this.safeAreaList = const [false,false,false,false]
335342
}) : assert(
336343
pages != null || rawPages != null,
337344
"You must set either 'pages' or 'rawPages' parameter",
@@ -551,106 +558,112 @@ class IntroductionScreenState extends State<IntroductionScreen> {
551558
);
552559
}
553560

554-
return Scaffold(
555-
backgroundColor: widget.globalBackgroundColor,
556-
resizeToAvoidBottomInset: widget.resizeToAvoidBottomInset,
557-
body: Stack(
558-
children: [
559-
Positioned.fill(
560-
top: widget.bodyPadding.top,
561-
left: widget.bodyPadding.left,
562-
right: widget.bodyPadding.right,
563-
bottom: widget.bodyPadding.bottom,
564-
child: NotificationListener<ScrollNotification>(
565-
onNotification: _onScroll,
566-
child: PageView(
567-
reverse: widget.rtl,
568-
scrollDirection: widget.pagesAxis,
569-
controller: _pageController,
570-
onPageChanged: widget.onChange,
571-
allowImplicitScrolling: widget.allowImplicitScrolling,
572-
physics: widget.freeze
573-
? const NeverScrollableScrollPhysics()
574-
: !widget.canProgress(_currentPage)
575-
? const NeverScrollableScrollPhysics()
576-
: widget.scrollPhysics,
577-
children: widget.pages
578-
?.mapIndexed(
579-
(index, page) => IntroPage(
580-
page: page,
581-
scrollController:
582-
(CustomList(widget.scrollControllers)
583-
?.elementAtOrNull(index)),
584-
isTopSafeArea: widget.isTopSafeArea,
585-
isBottomSafeArea: widget.isBottomSafeArea,
586-
),
587-
)
588-
.toList() ??
589-
widget.rawPages!,
561+
return SafeArea(
562+
left: widget.safeAreaList[0],
563+
right: widget.safeAreaList[1],
564+
top: widget.safeAreaList[2],
565+
bottom: widget.safeAreaList[3],
566+
child: Scaffold(
567+
backgroundColor: widget.globalBackgroundColor,
568+
resizeToAvoidBottomInset: widget.resizeToAvoidBottomInset,
569+
body: Stack(
570+
children: [
571+
Positioned.fill(
572+
top: widget.bodyPadding.top,
573+
left: widget.bodyPadding.left,
574+
right: widget.bodyPadding.right,
575+
bottom: widget.bodyPadding.bottom,
576+
child: NotificationListener<ScrollNotification>(
577+
onNotification: _onScroll,
578+
child: PageView(
579+
reverse: widget.rtl,
580+
scrollDirection: widget.pagesAxis,
581+
controller: _pageController,
582+
onPageChanged: widget.onChange,
583+
allowImplicitScrolling: widget.allowImplicitScrolling,
584+
physics: widget.freeze
585+
? const NeverScrollableScrollPhysics()
586+
: !widget.canProgress(_currentPage)
587+
? const NeverScrollableScrollPhysics()
588+
: widget.scrollPhysics,
589+
children: widget.pages
590+
?.mapIndexed(
591+
(index, page) => IntroPage(
592+
page: page,
593+
scrollController:
594+
(CustomList(widget.scrollControllers)
595+
?.elementAtOrNull(index)),
596+
isTopSafeArea: widget.isTopSafeArea,
597+
isBottomSafeArea: widget.isBottomSafeArea,
598+
),
599+
)
600+
.toList() ??
601+
widget.rawPages!,
602+
),
590603
),
591604
),
592-
),
593-
if (widget.globalHeader != null)
594-
Positioned(
595-
top: 0,
596-
left: 0,
597-
right: 0,
598-
child: widget.globalHeader!,
599-
),
600-
if (_showBottom)
601-
Positioned(
602-
left: widget.controlsPosition.left,
603-
top: widget.controlsPosition.top,
604-
right: widget.controlsPosition.right,
605-
bottom: widget.controlsPosition.bottom,
606-
child: Column(
607-
children: [
608-
Container(
609-
padding: widget.controlsPadding,
610-
margin: widget.controlsMargin,
611-
decoration: widget.dotsContainerDecorator,
612-
child: Row(
613-
children: [
614-
Expanded(
615-
flex: widget.skipOrBackFlex,
616-
child: leftBtn ?? const SizedBox(),
617-
),
618-
Expanded(
619-
flex: widget.dotsFlex,
620-
child: Center(
621-
child: widget.isProgress
622-
? widget.customProgress ??
623-
Semantics(
624-
label:
625-
"Page ${_currentPage.round() + 1} of ${getPagesLength()}",
626-
excludeSemantics: true,
627-
child: DotsIndicator(
628-
reversed: widget.rtl,
629-
dotsCount: getPagesLength(),
630-
position: _currentPage,
631-
decorator: widget.dotsDecorator,
632-
onTap: widget.isProgressTap &&
633-
!widget.freeze
634-
? (pos) =>
635-
animateScroll(pos.toInt())
636-
: null,
637-
),
638-
)
639-
: const SizedBox(),
605+
if (widget.globalHeader != null)
606+
Positioned(
607+
top: 0,
608+
left: 0,
609+
right: 0,
610+
child: widget.globalHeader!,
611+
),
612+
if (_showBottom)
613+
Positioned(
614+
left: widget.controlsPosition.left,
615+
top: widget.controlsPosition.top,
616+
right: widget.controlsPosition.right,
617+
bottom: widget.controlsPosition.bottom,
618+
child: Column(
619+
children: [
620+
Container(
621+
padding: widget.controlsPadding,
622+
margin: widget.controlsMargin,
623+
decoration: widget.dotsContainerDecorator,
624+
child: Row(
625+
children: [
626+
Expanded(
627+
flex: widget.skipOrBackFlex,
628+
child: leftBtn ?? const SizedBox(),
640629
),
641-
),
642-
Expanded(
643-
flex: widget.nextFlex,
644-
child: rightBtn ?? const SizedBox(),
645-
),
646-
].asReversed(widget.rtl),
630+
Expanded(
631+
flex: widget.dotsFlex,
632+
child: Center(
633+
child: widget.isProgress
634+
? widget.customProgress ??
635+
Semantics(
636+
label:
637+
"Page ${_currentPage.round() + 1} of ${getPagesLength()}",
638+
excludeSemantics: true,
639+
child: DotsIndicator(
640+
reversed: widget.rtl,
641+
dotsCount: getPagesLength(),
642+
position: _currentPage,
643+
decorator: widget.dotsDecorator,
644+
onTap: widget.isProgressTap &&
645+
!widget.freeze
646+
? (pos) =>
647+
animateScroll(pos.toInt())
648+
: null,
649+
),
650+
)
651+
: const SizedBox(),
652+
),
653+
),
654+
Expanded(
655+
flex: widget.nextFlex,
656+
child: rightBtn ?? const SizedBox(),
657+
),
658+
].asReversed(widget.rtl),
659+
),
647660
),
648-
),
649-
if (widget.globalFooter != null) widget.globalFooter!
650-
],
661+
if (widget.globalFooter != null) widget.globalFooter!
662+
],
663+
),
651664
),
652-
),
653-
],
665+
],
666+
),
654667
),
655668
);
656669
}

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: introduction_screen
22
description: Introduction/Onboarding package for flutter app with some customizations possibilities
33

4-
version: 3.1.7
4+
version: 3.1.8
55

66
homepage: https://github.com/pyozer/introduction_screen
77

0 commit comments

Comments
 (0)