Skip to content

Commit 42eead4

Browse files
update to null safety
1 parent 95abd1f commit 42eead4

20 files changed

+232
-180
lines changed

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
## SlidingTutorial [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/Solido/awesome-flutter) <a href="https://www.cleveroad.com/?utm_source=github&utm_medium=label&utm_campaign=contacts"><img src="https://www.cleveroad.com/public/comercial/label-cleveroad.svg" height="20"></a>
2-
![Header image](https://github.com/Cleveroad/flutter_sliding_tutorial/blob/develop/images/header.png)
3-
1+
## SlidingTutorial [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/Solido/awesome-flutter)
2+
![Header image](https://github.com/Cleveroad/flutter_sliding_tutorial/raw/master/images/header.jpg)
43
## Cleveroad introduces Sliding Tutorial Library for Flutter
54

65
Hey guys, hope you haven’t started developing a tutorial for your Flutter app yet, as we have already completed a part of your job. Don’t worry, we act from good motives only. Our aim is to help you create a sliding tutorial in a fast and simple manner. So we’ve done some work and voila!. A simple Flutter Sliding Tutorial library is at your service.
76

8-
![Demo image](https://github.com/Cleveroad/flutter_sliding_tutorial/blob/develop/images/gif1.gif)
7+
![Demo image](https://github.com/Cleveroad/flutter_sliding_tutorial/raw/master/images/demo.gif)
98
###### Also you can watch the animation of the <strong><a target="_blank" href="https://www.youtube.com/watch?v=lJSGIk4Zh9s&feature=youtu.be">Sliding Tutorial for Android on YouTube</a></strong> in HD quality.
109

1110
The invention is going to ease the problem of structural design but not to limit a stretch of your imagination at the same time. We took care of the suitability aspect. So, your app is not going to look alien among other Flutter elements.

example/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@
7070
!**/ios/**/default.pbxuser
7171
!**/ios/**/default.perspectivev3
7272
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
73+
/ios/Flutter/flutter_export_environment.sh
74+
/ios/Flutter/Flutter.podspec
75+
/ios/Flutter/.last_build_id

example/android/gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ org.gradle.jvmargs=-Xmx1536M
22

33
android.useAndroidX=true
44
android.enableJetifier=true
5+
android.enableR8=true

example/ios/Podfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: ".symlinks/flutter/ios"
1010

1111
SPEC CHECKSUMS:
12-
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
12+
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
1313

1414
PODFILE CHECKSUM: b6a0a141693093b304368d08511b46cf3d1d0ac5
1515

16-
COCOAPODS: 1.6.0
16+
COCOAPODS: 1.9.3

example/ios/Runner.xcodeproj/project.pbxproj

+1-20
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@
99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
13-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1412
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
1513
8FE52F76A66A19D89FD28E10 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5864272949429EE7A119D211 /* Pods_Runner.framework */; };
16-
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
17-
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1814
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
1915
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
2016
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@@ -28,8 +24,6 @@
2824
dstPath = "";
2925
dstSubfolderSpec = 10;
3026
files = (
31-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
32-
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
3327
);
3428
name = "Embed Frameworks";
3529
runOnlyForDeploymentPostprocessing = 0;
@@ -41,14 +35,12 @@
4135
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
4236
347BA31C2D35AE4D1B3327CB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
4337
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
44-
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
4538
5864272949429EE7A119D211 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4639
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
4740
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4841
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
4942
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
5043
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
51-
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
5244
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
5345
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
5446
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -63,8 +55,6 @@
6355
isa = PBXFrameworksBuildPhase;
6456
buildActionMask = 2147483647;
6557
files = (
66-
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
67-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
6858
8FE52F76A66A19D89FD28E10 /* Pods_Runner.framework in Frameworks */,
6959
);
7060
runOnlyForDeploymentPostprocessing = 0;
@@ -94,9 +84,7 @@
9484
9740EEB11CF90186004384FC /* Flutter */ = {
9585
isa = PBXGroup;
9686
children = (
97-
3B80C3931E831B6300D905FE /* App.framework */,
9887
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
99-
9740EEBA1CF902C7004384FC /* Flutter.framework */,
10088
9740EEB21CF90195004384FC /* Debug.xcconfig */,
10189
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
10290
9740EEB31CF90195004384FC /* Generated.xcconfig */,
@@ -225,13 +213,9 @@
225213
buildActionMask = 2147483647;
226214
files = (
227215
);
228-
inputFileListPaths = (
229-
);
230216
inputPaths = (
231217
);
232218
name = "[CP] Embed Pods Frameworks";
233-
outputFileListPaths = (
234-
);
235219
outputPaths = (
236220
);
237221
runOnlyForDeploymentPostprocessing = 0;
@@ -273,7 +257,7 @@
273257
);
274258
runOnlyForDeploymentPostprocessing = 0;
275259
shellPath = /bin/sh;
276-
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
260+
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
277261
};
278262
9740EEB61CF901F6004384FC /* Run Script */ = {
279263
isa = PBXShellScriptBuildPhase;
@@ -325,7 +309,6 @@
325309
/* Begin XCBuildConfiguration section */
326310
249021D3217E4FDB00AE95B9 /* Profile */ = {
327311
isa = XCBuildConfiguration;
328-
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
329312
buildSettings = {
330313
ALWAYS_SEARCH_USER_PATHS = NO;
331314
CLANG_ANALYZER_NONNULL = YES;
@@ -401,7 +384,6 @@
401384
};
402385
97C147031CF9000F007C117D /* Debug */ = {
403386
isa = XCBuildConfiguration;
404-
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
405387
buildSettings = {
406388
ALWAYS_SEARCH_USER_PATHS = NO;
407389
CLANG_ANALYZER_NONNULL = YES;
@@ -457,7 +439,6 @@
457439
};
458440
97C147041CF9000F007C117D /* Release */ = {
459441
isa = XCBuildConfiguration;
460-
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
461442
buildSettings = {
462443
ALWAYS_SEARCH_USER_PATHS = NO;
463444
CLANG_ANALYZER_NONNULL = YES;

example/lib/main.dart

+8-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ class MyApp extends StatelessWidget {
1515
}
1616

1717
class ExamplePage extends StatefulWidget {
18-
ExamplePage({Key key}) : super(key: key);
18+
ExamplePage({
19+
Key? key,
20+
}) : super(key: key);
1921

2022
@override
2123
_ExamplePageState createState() => _ExamplePageState();
@@ -31,10 +33,13 @@ class _ExamplePageState extends State<ExamplePage> {
3133
body: Center(
3234
child: Stack(
3335
children: <Widget>[
36+
/// [StatefulWidget] with [PageView] and [AnimatedBackgroundColor].
3437
SlidingTutorial(
3538
pageCount: pageCount,
3639
notifier: notifier,
3740
),
41+
42+
/// Separator.
3843
Align(
3944
alignment: Alignment(0, 0.85),
4045
child: Container(
@@ -43,6 +48,8 @@ class _ExamplePageState extends State<ExamplePage> {
4348
color: Colors.white,
4449
),
4550
),
51+
52+
/// [SlidingIndicator] for [PageView] in [SlidingTutorial].
4653
Align(
4754
alignment: Alignment(0, 0.94),
4855
child: SlidingIndicator(

example/lib/page/e_commerce_page.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ECommercePage extends StatelessWidget {
1414
page: page,
1515
child: Container(
1616
child: Stack(
17-
overflow: Overflow.visible,
17+
clipBehavior: Clip.none,
1818
children: [
1919
Center(
2020
child: FractionallySizedBox(

example/lib/page/web_analytics_page.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class WebAnalyticsPage extends StatelessWidget {
1414
notifier: notifier,
1515
child: Container(
1616
child: Stack(
17-
overflow: Overflow.visible,
17+
clipBehavior: Clip.none,
1818
children: [
1919
Center(
2020
child: FractionallySizedBox(

example/lib/page/web_developer_page.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class WebDevelopersPage extends StatelessWidget {
1414
notifier: notifier,
1515
child: Container(
1616
child: Stack(
17-
overflow: Overflow.visible,
17+
clipBehavior: Clip.none,
1818
children: [
1919
Center(
2020
child: FractionallySizedBox(

example/lib/sliding_tutorial.dart

+9-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ class SlidingTutorial extends StatefulWidget {
88
final ValueNotifier<double> notifier;
99
final int pageCount;
1010

11-
const SlidingTutorial(
12-
{Key key, @required this.notifier, @required this.pageCount})
13-
: super(key: key);
11+
const SlidingTutorial({
12+
required this.notifier,
13+
required this.pageCount,
14+
Key? key,
15+
}) : super(key: key);
1416

1517
@override
1618
State<StatefulWidget> createState() => _SlidingTutorial();
@@ -21,6 +23,7 @@ class _SlidingTutorial extends State<SlidingTutorial> {
2123

2224
@override
2325
void initState() {
26+
/// Listen to [PageView] position updates.
2427
_pageController..addListener(_onScroll);
2528
super.initState();
2629
}
@@ -37,6 +40,7 @@ class _SlidingTutorial extends State<SlidingTutorial> {
3740
widget.pageCount, (index) => _getPageByIndex(index)))));
3841
}
3942

43+
/// Create different [SlidingPage] for indexes.
4044
Widget _getPageByIndex(int index) {
4145
switch (index % 3) {
4246
case 0:
@@ -50,7 +54,8 @@ class _SlidingTutorial extends State<SlidingTutorial> {
5054
}
5155
}
5256

57+
/// Notify [SlidingPage] about current page changes.
5358
_onScroll() {
54-
widget.notifier?.value = _pageController.page;
59+
widget.notifier.value = _pageController.page ?? 0;
5560
}
5661
}

0 commit comments

Comments
 (0)