Skip to content

Commit b8ef6be

Browse files
committed
update README example
1 parent b6b5898 commit b8ef6be

File tree

2 files changed

+41
-57
lines changed

2 files changed

+41
-57
lines changed

README.md

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,16 @@ You should then run `flutter packages get` in your terminal so as to get the pac
4949

5050
```dart
5151
Final page = new PageViewModel(
52-
pageColor: const Color(0xFF607D8B),
53-
mainImageAssetPath: 'assets/taxi.png',
54-
title: 'Cabs',
55-
body: 'Easy cab booking at your doorstep with cashless payment system',
56-
iconImageAssetPath: 'assets/taxi-driver.png',
57-
titleTextColor: Colors.white,
58-
bodyTextColor: Colors.white,
59-
iconColor: null,
60-
titleTextSize: 54.0,
61-
bodyTextSize: 24.0,
62-
fontFamily: "MyFont",
63-
pageTitleBold: false,
64-
bubbleBackgroundColor: Colors.white,
52+
pageColor: const Color(0xFF607D8B),
53+
title: Text('Cabs'),
54+
mainImage: Image.asset('assets/taxi.png'),
55+
body: Text(
56+
'Easy cab booking at your doorstep with cashless payment system',
57+
),
58+
textStyle: TextStyle(fontFamily: 'MyFont'),
59+
iconImageAssetPath: 'assets/taxi-driver.png',
60+
bubbleBackgroundColor: Colors.white,
61+
iconColor: null,
6562
);
6663
```
6764

@@ -92,18 +89,13 @@ You should then run `flutter packages get` in your terminal so as to get the pac
9289
| Dart attribute | Datatype | Description | Default Value |
9390
| :---------------- | :------------------------------ | :----------------------------------------------------------- | :-----------: |
9491
| pageColor | Color | Set color of the page. | Null |
95-
| mainImageAssetPath | String | Set the main image asset path of the page. | Null |
96-
| title | String | Set the title text of the page. | Null |
97-
| body | String | Set the body text of the page. | Null |
92+
| mainImage | Image | Set the main image of the page. | Null |
93+
| title | Text | Set the title text of the page. | Null |
94+
| body | Text | Set the body text of the page. | Null |
9895
| iconImageAssetPath | String | Set the icon image asset path that would be displayed in page bubble. | Null |
99-
| titleTextColor | Color | Set the title text color. | Colors.white |
100-
| bodyTextColor | Color | Set the body text color. | Colors.white |
10196
| iconColor | Color | Set the page bubble icon color. | Null |
10297
| bubbleBackgroundColor | Color | Set the page bubble background color. | Colors.white |
103-
| fontFamily | String | Use your own custom font to style the title and body. | Default |
104-
| pageTitleBold | Bool | Set the title font weight to bold. | False |
105-
| titleTextSize | Double | Set the size of title text. | 34.0 |
106-
| bodyTextSize | Double | Set the size of body text. | 18.0 |
98+
| textStyle | TextStyle | set TextStyle for both title and body | title: `color: Colors.white , fontSize: 50.0` <br> body: `color: Colors.white , fontSize: 24.0` |
10799

108100
### IntroViewFlutter Class
109101

example/lib/main.dart

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,44 @@ class App extends StatelessWidget {
1111
//making list of pages needed to pass in IntroViewsFlutter constructor.
1212
final pages = [
1313
new PageViewModel(
14-
pageColor: const Color(0xFF03A9F4),
15-
mainImageAssetPath: 'assets/airplane.png',
16-
title: 'Flights',
17-
body:
14+
pageColor: const Color(0xFF03A9F4),
15+
iconImageAssetPath: 'assets/air-hostess.png',
16+
iconColor: null,
17+
bubbleBackgroundColor: Colors.blue[900],
18+
body: Text(
1819
'Haselfree booking of flight tickets with full refund on cancelation',
19-
iconImageAssetPath: 'assets/air-hostess.png',
20-
titleTextColor: Colors.white,
21-
bodyTextColor: Colors.white,
22-
fontFamily: "MyFont",
23-
titleTextSize: 50.0,
24-
bodyTextSize: 24.0,
25-
iconColor: null,
26-
pageTitleBold: false,
27-
bubbleBackgroundColor: Colors.white,
28-
),
20+
),
21+
title: Text(
22+
'Flights',
23+
style: TextStyle(color: Colors.white70),
24+
),
25+
textStyle: TextStyle(fontFamily: 'MyFont'),
26+
mainImage: Image.asset(
27+
'assets/airplane.png',
28+
)),
2929
new PageViewModel(
3030
pageColor: const Color(0xFF8BC34A),
31-
mainImageAssetPath: 'assets/hotel.png',
32-
title: 'Hotels',
33-
body:
34-
'We work for the comfort , enjoy your stay at our beautiful hotels',
3531
iconImageAssetPath: 'assets/waiter.png',
36-
titleTextColor: Colors.white,
37-
bodyTextColor: Colors.white,
3832
iconColor: null,
39-
titleTextSize: 54.0,
40-
bodyTextSize: 24.0,
41-
fontFamily: "MyFont",
42-
pageTitleBold: false,
43-
bubbleBackgroundColor: Colors.white,
33+
bubbleBackgroundColor: Colors.green[900],
34+
body: Text(
35+
'We work for the comfort , enjoy your stay at our beautiful hotels',
36+
),
37+
title: Text('Hotels'),
38+
mainImage: Image.asset('assets/hotel.png'),
39+
textStyle: TextStyle(fontFamily: 'MyFont'),
4440
),
4541
new PageViewModel(
4642
pageColor: const Color(0xFF607D8B),
47-
mainImageAssetPath: 'assets/taxi.png',
48-
title: 'Cabs',
49-
body:
50-
'Easy cab booking at your doorstep with cashless payment system',
5143
iconImageAssetPath: 'assets/taxi-driver.png',
52-
titleTextColor: Colors.white,
53-
bodyTextColor: Colors.white,
5444
iconColor: null,
55-
titleTextSize: 54.0,
56-
bodyTextSize: 24.0,
57-
fontFamily: "MyFont",
58-
pageTitleBold: false,
5945
bubbleBackgroundColor: Colors.white,
46+
body: Text(
47+
'Easy cab booking at your doorstep with cashless payment system',
48+
),
49+
title: Text('Cabs'),
50+
mainImage: Image.asset('assets/taxi.png'),
51+
textStyle: TextStyle(fontFamily: 'MyFont'),
6052
),
6153
];
6254

0 commit comments

Comments
 (0)