Skip to content

Commit 3ecca05

Browse files
committed
Merge branch 'testing' of https://github.com/taljacobson/IntroViews-Flutter into taljacobson-testing
2 parents c59aaac + 51148a0 commit 3ecca05

File tree

3 files changed

+112
-25
lines changed

3 files changed

+112
-25
lines changed

.travis.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
os:
2+
- linux
3+
sudo: false
4+
addons:
5+
apt:
6+
sources:
7+
- ubuntu-toolchain-r-test
8+
packages:
9+
- libstdc++6
10+
- fonts-droid
11+
git:
12+
depth: 3
13+
cache:
14+
directories:
15+
- $HOME/.pub-cache
16+
env:
17+
- FLUTTER_VERSION=beta
18+
- FLUTTER_VERSION=dev
19+
matrix:
20+
allow_failures:
21+
- env: FLUTTER_VERSION=dev
22+
before_script:
23+
- git clone https://github.com/flutter/flutter.git -b $FLUTTER_VERSION
24+
- ./flutter/bin/flutter doctor
25+
script:
26+
- ./flutter/bin/flutter test

README.md

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33

44
IntroViews is inspired by [Paper Onboarding](https://github.com/Ramotion/paper-onboarding-android) and developed with `love` from scratch. I decided to rewrite almost all the features in order to make it available to the `flutter` developers and extensible as possible.
55

6+
[![pub package](https://img.shields.io/pub/v/intro_views_flutter.svg)](https://pub.dartlang.org/packages/intro_views_flutter)
67

78
<img src="https://github.com/aagarwal1012/IntroViews-Flutter/blob/master/display/output.gif?raw=true" align = "right" height = "550px">
89

9-
# Features
10+
# Features
1011

1112
- Easy addition of pages.
1213

@@ -77,47 +78,48 @@ You should then run `flutter packages get` in your terminal so as to get the pac
7778
},
7879
showSkipButton: true,
7980
pageButtonTextStyles: new TextStyle(
80-
color: Colors.white,
81+
color: Colors.white,
8182
fontSize: 18.0,
8283
fontFamily: "Regular",
8384
),
8485
);
8586
```
87+
8688
For further usage refer the [`example`](https://github.com/aagarwal1012/IntroViews-Flutter/tree/master/example/lib) available.
8789

8890
For `Landscape` preview click the [link](https://github.com/aagarwal1012/IntroViews-Flutter/blob/master/display/landscape2.png?raw=true).
8991

90-
***Note :*** If you added more than four pages in the list then there might be overlapping between `page icons` and `skip button`, so my suggestion is just make the `showSkipButton: false`.
92+
**_Note :_** If you added more than four pages in the list then there might be overlapping between `page icons` and `skip button`, so my suggestion is just make the `showSkipButton: false`.
9193

9294
# Documentation
9395

9496
### PageViewModel Class
9597

96-
| Dart attribute | Datatype | Description | Default Value |
97-
| :---------------- | :------------------------------ | :----------------------------------------------------------- | :-----------: |
98-
| pageColor | Color | Set color of the page. | Null |
99-
| mainImage | Image | Set the main image of the page. | Null |
100-
| title | Text | Set the title text of the page. | Null |
101-
| body | Text | Set the body text of the page. | Null |
102-
| iconImageAssetPath | String | Set the icon image asset path that would be displayed in page bubble. | Null |
103-
| iconColor | Color | Set the page bubble icon color. | Null |
104-
| bubbleBackgroundColor | Color | Set the page bubble background color. | Colors.white |
105-
| textStyle | TextStyle | Set TextStyle for both title and body | title: `color: Colors.white , fontSize: 50.0` <br> body: `color: Colors.white , fontSize: 24.0` |
98+
| Dart attribute | Datatype | Description | Default Value |
99+
| :-------------------- | :-------- | :-------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------: |
100+
| pageColor | Color | Set color of the page. | Null |
101+
| mainImage | Image | Set the main image of the page. | Null |
102+
| title | Text | Set the title text of the page. | Null |
103+
| body | Text | Set the body text of the page. | Null |
104+
| iconImageAssetPath | String | Set the icon image asset path that would be displayed in page bubble. | Null |
105+
| iconColor | Color | Set the page bubble icon color. | Null |
106+
| bubbleBackgroundColor | Color | Set the page bubble background color. | Colors.white |
107+
| textStyle | TextStyle | Set TextStyle for both title and body | title: `color: Colors.white , fontSize: 50.0` <br> body: `color: Colors.white , fontSize: 24.0` |
106108

107109
### IntroViewFlutter Class
108110

109-
| Dart attribute | Datatype | Description | Default Value |
110-
| :---------------- | :------------------------------ | :----------------------------------------------------------- | :-----------: |
111-
| pages | List<PageViewModel> | Set the pages of the intro screen. | Null |
112-
| onTapDoneButton | VoidCallback | Method executes on tapping done button. | Null |
113-
| showSkipButton | Bool | Show the skip button at the bottom of page. | true |
114-
| pageButtonTextSize | Double | Set the button text size. | 18.0 |
115-
| pageButtonFontFamily | String | Set the font of button text. | Default |
116-
| onTapSkipButton | VoidCallback | Method executes on tapping skip button. | null |
117-
| pageButtonTextStyles | TextStyle | Configure TextStyle for skip, done buttons, overrides pageButtonFontFamily, pageButtonsColor, pageButtonTextSize. | fontSize: `18.0`, color: `Colors.white` |
118-
| skipText | Text | Override Skip Button Text and styles. | Text('SKIP') |
119-
| doneText | Text | Override Done Button Text and styles. | Text('DONE') |
120-
| doneButtonPersist | Bool | Show done Button throughout pages | false |
111+
| Dart attribute | Datatype | Description | Default Value |
112+
| :------------------- | :------------------ | :---------------------------------------------------------------------------------------------------------------- | :-------------------------------------: |
113+
| pages | List<PageViewModel> | Set the pages of the intro screen. | Null |
114+
| onTapDoneButton | VoidCallback | Method executes on tapping done button. | Null |
115+
| showSkipButton | Bool | Show the skip button at the bottom of page. | true |
116+
| pageButtonTextSize | Double | Set the button text size. | 18.0 |
117+
| pageButtonFontFamily | String | Set the font of button text. | Default |
118+
| onTapSkipButton | VoidCallback | Method executes on tapping skip button. | null |
119+
| pageButtonTextStyles | TextStyle | Configure TextStyle for skip, done buttons, overrides pageButtonFontFamily, pageButtonsColor, pageButtonTextSize. | fontSize: `18.0`, color: `Colors.white` |
120+
| skipText | Text | Override Skip Button Text and styles. | Text('SKIP') |
121+
| doneText | Text | Override Done Button Text and styles. | Text('DONE') |
122+
| doneButtonPersist | Bool | Show done Button throughout pages | false |
121123

122124
For help on editing package code, view the [flutter documentation](https://flutter.io/developing-packages/).
123125

@@ -127,4 +129,5 @@ This is the well `documented` package. I have documented each and every method t
127129
Feel free to [open an issue](https://github.com/aagarwal1012/IntroViews-Flutter/issues).
128130

129131
# License
132+
130133
**IntroViews-Flutter** is licensed under `MIT license`.

test/widget_test.dart

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// This is a basic Flutter widget test.
2+
// To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
3+
// provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
4+
// find child widgets in the widget tree, read text, and verify that the values of widget properties
5+
// are correct.
6+
7+
import 'package:flutter/material.dart';
8+
import 'package:flutter_test/flutter_test.dart';
9+
10+
import '../example/lib/main.dart';
11+
12+
void main() {
13+
testWidgets('Skip Pressed smoke test', (WidgetTester tester) async {
14+
// Build our app and trigger a frame.
15+
await tester.pumpWidget(new App());
16+
17+
// Verify that our counter starts at 0.
18+
expect(find.text('SKIP'), findsOneWidget);
19+
expect(find.text('DONE'), findsNothing);
20+
21+
// Tap the '+' icon and trigger a frame.
22+
await tester.tap(find.text('SKIP'));
23+
await tester.pump();
24+
25+
// Verify that our counter has incremented.
26+
expect(find.text('SKIP'), findsNothing);
27+
expect(find.text('DONE'), findsOneWidget);
28+
});
29+
30+
// Drag from first page to second and back to first
31+
testWidgets('drag Reveal smoke test', (WidgetTester tester) async {
32+
// Build our app and trigger a frame.
33+
await tester.pumpWidget(new App());
34+
35+
// should find First page by its title Text
36+
expect(find.text('Flights'), findsWidgets);
37+
// second page title Text should not be found
38+
expect(find.text('Hotels'), findsNothing);
39+
40+
// Drag Screen To Reveal next Page
41+
await tester.drag(find.byType(App) , Offset(-400.0, 0.0));
42+
43+
await tester.pumpAndSettle();
44+
45+
// first page should have been removed by second page
46+
expect(find.text('Flights'), findsNothing);
47+
expect(find.text('Hotels'), findsWidgets);
48+
49+
// Drag Screen To Reveal next Prev page
50+
await tester.drag(find.byType(App) , Offset(400.0, 0.0));
51+
52+
await tester.pumpAndSettle();
53+
// first page should have been removed by second page
54+
expect(find.text('Flights'), findsWidgets);
55+
// second page title Text should not be found
56+
expect(find.text('Hotels'), findsNothing);
57+
});
58+
}

0 commit comments

Comments
 (0)