Skip to content

Commit 579ca50

Browse files
committed
resolve conflicts
2 parents 3a16baf + 0e7871c commit 579ca50

File tree

15 files changed

+677
-429
lines changed

15 files changed

+677
-429
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DS_Store
22
.dart_tool/
3+
.idea
34

45
.packages
56
.pub/

.idea/workspace.xml

Lines changed: 258 additions & 119 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 2.0.1
2+
**Major Updates**
3+
* Made intro views responsive.
4+
* Refracting page view model.
5+
- Body title, expects Text Widget.
6+
- Main image, expects Image Widget.
7+
- Added TextStyle property to page view model that can be used to set styles for both title and body.
8+
* Added TextStyle property for page indicator buttons which overrides previous button properties.
9+
* Updated Readme and example.
10+
11+
## 1.0.3
12+
13+
* Made intro views responsive.
14+
* Added onTapSkipButton voidCallback.
15+
* Updated Readme.
16+
117
## 1.0.2
218

319
* Updated Readme.

README.md

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ You should ensure that you add the `intro_views_flutter` as a dependency in your
2828

2929
```yaml
3030
dependencies:
31-
intro_views_flutter: "^1.0.2"
31+
intro_views_flutter: "^2.0.1"
3232
```
3333
3434
You can also reference the git repository directly if you want:
@@ -49,19 +49,21 @@ 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',
52+
pageColor: const Color(0xFF607D8B),
5653
iconImageAssetPath: 'assets/taxi-driver.png',
57-
titleTextColor: Colors.white,
58-
bodyTextColor: Colors.white,
5954
iconColor: null,
60-
titleTextSize: 54.0,
61-
bodyTextSize: 24.0,
62-
fontFamily: "MyFont",
63-
pageTitleBold: false,
64-
bubbleBackgroundColor: Colors.white,
55+
bubbleBackgroundColor: null,
56+
body: Text(
57+
'Easy cab booking at your doorstep with cashless payment system',
58+
),
59+
title: Text('Cabs'),
60+
mainImage: Image.asset(
61+
'assets/taxi.png',
62+
height: 285.0,
63+
width: 285.0,
64+
alignment: Alignment.center,
65+
),
66+
textStyle: TextStyle(fontFamily: 'MyFont', color: Colors.white),
6567
);
6668
```
6769

@@ -74,14 +76,18 @@ You should then run `flutter packages get` in your terminal so as to get the pac
7476
//Void Callback
7577
},
7678
showSkipButton: true,
77-
pageButtonFontFamily: "Regular",
78-
pageButtonsColor: Colors.white,
79-
pageButtonTextSize: 18.0,
79+
pageButtonTextStyles: new TextStyle(
80+
color: Colors.white,
81+
fontSize: 18.0,
82+
fontFamily: "Regular",
83+
),
8084
);
8185
```
8286
For further usage refer the [`example`](https://github.com/aagarwal1012/IntroViews-Flutter/tree/master/example/lib) available.
8387

84-
***Note :*** If you added more than four pages in the list then there can be overlapping between `page icons` and `skip button`, so my suggestion is just make the `showSkipButton: false`.
88+
For `Landscape` preview click the [link](https://github.com/aagarwal1012/IntroViews-Flutter/blob/master/display/landscape2.png?raw=true).
89+
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`.
8591

8692
# Documentation
8793

@@ -90,31 +96,27 @@ You should then run `flutter packages get` in your terminal so as to get the pac
9096
| Dart attribute | Datatype | Description | Default Value |
9197
| :---------------- | :------------------------------ | :----------------------------------------------------------- | :-----------: |
9298
| pageColor | Color | Set color of the page. | Null |
93-
| mainImageAssetPath | String | Set the main image asset path of the page. | Null |
94-
| title | String | Set the title text of the page. | Null |
95-
| body | String | Set the body text 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 |
96102
| iconImageAssetPath | String | Set the icon image asset path that would be displayed in page bubble. | Null |
97-
| titleTextColor | Color | Set the title text color. | Colors.white |
98-
| bodyTextColor | Color | Set the body text color. | Colors.white |
99103
| iconColor | Color | Set the page bubble icon color. | Null |
100104
| bubbleBackgroundColor | Color | Set the page bubble background color. | Colors.white |
101-
| fontFamily | String | Use your own custom font to style the title and body. | Default |
102-
| pageTitleBold | Bool | Set the title font weight to bold. | False |
103-
| titleTextSize | Double | Set the size of title text. | 34.0 |
104-
| bodyTextSize | Double | Set the size of body text. | 18.0 |
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` |
105106

106107
### IntroViewFlutter Class
107108

108109
| Dart attribute | Datatype | Description | Default Value |
109110
| :---------------- | :------------------------------ | :----------------------------------------------------------- | :-----------: |
110111
| pages | List<PageViewMode> | Set the pages of the intro screen. | Null |
111112
| onTapDoneButton | VoidCallback | Method executes on tapping done button. | Null |
112-
| pageButtonColor | Color | Set the color of skip and done buttons. | Colors.white |
113113
| showSkipButton | Bool | Show the skip button at the bottom of page. | true |
114114
| pageButtonTextSize | Double | Set the button text size. | 18.0 |
115115
| pageButtonFontFamily | String | Set the font of button text. | Default |
116-
| skip | TextWidget | Override SkipButton Text and styles. | null |
117-
| done | TextWidget | Override DoneButton Text and styles. | null |
116+
| skip | Text | Override SkipButton Text and styles. | null |
117+
| done | Text | Override DoneButton Text and styles. | null |
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` |
118120

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

display/landscape2.png

145 KB
Loading

display/page3.png

41.4 KB
Loading

example/lib/main.dart

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,56 @@ 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: null,
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+
),
24+
textStyle: TextStyle(fontFamily: 'MyFont', color: Colors.white),
25+
mainImage: Image.asset(
26+
'assets/airplane.png',
27+
height: 285.0,
28+
width: 285.0,
29+
alignment: Alignment.center,
30+
)),
2931
new PageViewModel(
3032
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',
3533
iconImageAssetPath: 'assets/waiter.png',
36-
titleTextColor: Colors.white,
37-
bodyTextColor: Colors.white,
3834
iconColor: null,
39-
titleTextSize: 54.0,
40-
bodyTextSize: 24.0,
41-
fontFamily: "MyFont",
42-
pageTitleBold: false,
43-
bubbleBackgroundColor: Colors.white,
35+
bubbleBackgroundColor: null,
36+
body: Text(
37+
'We work for the comfort , enjoy your stay at our beautiful hotels',
38+
),
39+
title: Text('Hotels'),
40+
mainImage: Image.asset(
41+
'assets/hotel.png',
42+
height: 285.0,
43+
width: 285.0,
44+
alignment: Alignment.center,
45+
),
46+
textStyle: TextStyle(fontFamily: 'MyFont', color: Colors.white),
4447
),
4548
new PageViewModel(
4649
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',
5150
iconImageAssetPath: 'assets/taxi-driver.png',
52-
titleTextColor: Colors.white,
53-
bodyTextColor: Colors.white,
5451
iconColor: null,
55-
titleTextSize: 54.0,
56-
bodyTextSize: 24.0,
57-
fontFamily: "MyFont",
58-
pageTitleBold: false,
59-
bubbleBackgroundColor: Colors.white,
52+
bubbleBackgroundColor: null,
53+
body: Text(
54+
'Easy cab booking at your doorstep with cashless payment system',
55+
),
56+
title: Text('Cabs'),
57+
mainImage: Image.asset(
58+
'assets/taxi.png',
59+
height: 285.0,
60+
width: 285.0,
61+
alignment: Alignment.center,
62+
),
63+
textStyle: TextStyle(fontFamily: 'MyFont', color: Colors.white),
6064
),
6165
];
6266

@@ -80,8 +84,10 @@ class App extends StatelessWidget {
8084
},
8185
showSkipButton:
8286
true, //Whether you want to show the skip button or not.
83-
pageButtonsColor: Colors.white,
84-
pageButtonTextSize: 18.0,
87+
pageButtonTextStyles: TextStyle(
88+
color: Colors.white,
89+
fontSize: 18.0,
90+
),
8591
), //IntroViewsFlutter
8692
), //Builder
8793
); //Material App

example/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ packages:
129129
path: ".."
130130
relative: true
131131
source: path
132-
version: "1.0.1"
132+
version: "1.0.2"
133133
io:
134134
dependency: transitive
135135
description:
@@ -374,5 +374,5 @@ packages:
374374
source: hosted
375375
version: "2.1.13"
376376
sdks:
377-
dart: ">=2.0.0-dev.52.0 <=2.0.0-dev.54.0.flutter-46ab040e58"
377+
dart: ">=2.0.0-dev.52.0 <=2.0.0-dev.58.0.flutter-f981f09760"
378378
flutter: ">=0.1.4 <2.0.0"
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'package:flutter/material.dart';
21
import 'package:intro_views_flutter/Constants/constants.dart';
32

43
/// This is view model for the skip and done buttons.
@@ -8,17 +7,11 @@ class PageButtonViewModel {
87
final int totalPages;
98
final int activePageIndex;
109
final SlideDirection slideDirection;
11-
final String fontFamily;
12-
final double pageButtonTextSize;
13-
final Color pageButtonColor;
1410

1511
PageButtonViewModel({
1612
this.slidePercent,
1713
this.totalPages,
1814
this.activePageIndex,
1915
this.slideDirection,
20-
this.fontFamily,
21-
this.pageButtonTextSize = 18.0,
22-
this.pageButtonColor = Colors.white,
2316
});
2417
}

lib/Models/page_view_model.dart

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,53 @@ import 'package:flutter/material.dart';
33
//view model for pages
44

55
class PageViewModel {
6+
/// Page BackGround Color
67
final Color pageColor;
7-
//main image path
8-
final String mainImageAssetPath;
9-
final String title;
10-
final String body;
8+
9+
///icon image path
1110
final String iconImageAssetPath;
12-
final Color titleTextColor;
13-
final Color bodyTextColor;
11+
12+
/// iconColor
1413
final Color iconColor;
14+
15+
/// color for background of progress bubbles
16+
///
17+
/// @Default `const Color(0x88FFFFFF)`
1518
final Color bubbleBackgroundColor;
16-
final String fontFamily;
17-
final bool pageTitleBold;
18-
final double titleTextSize;
19-
final double bodyTextSize;
20-
21-
PageViewModel({
22-
this.pageColor,
23-
this.mainImageAssetPath,
24-
this.title,
25-
this.body,
26-
this.iconImageAssetPath,
27-
this.bodyTextColor = const Color(0x88FFFFFF),
28-
this.titleTextColor = const Color(0x88FFFFFF),
29-
this.bubbleBackgroundColor = const Color(0x88FFFFFF),
30-
this.iconColor,
31-
this.fontFamily,
32-
this.pageTitleBold = false,
33-
this.titleTextSize = 34.0,
34-
this.bodyTextSize = 18.0,
35-
});
19+
20+
/// Text widget for the title
21+
///
22+
/// @Default style `color: Colors.white , fontSize: 50.0`
23+
final Text title;
24+
25+
/// Text widget for the title
26+
///
27+
/// @Default style `color: Colors.white, fontSize: 24.0`
28+
final Text body;
29+
30+
/// set default TextStyle for both title and body
31+
final TextStyle textStyle;
32+
33+
/// Image Widget
34+
final Image mainImage;
35+
36+
PageViewModel(
37+
{this.pageColor,
38+
this.iconImageAssetPath,
39+
this.bubbleBackgroundColor = const Color(0x88FFFFFF),
40+
this.iconColor,
41+
@required this.title,
42+
@required this.body,
43+
@required this.mainImage,
44+
this.textStyle});
45+
46+
TextStyle get titleTextStyle {
47+
return new TextStyle(color: Colors.white, fontSize: 50.0)
48+
.merge(this.textStyle);
49+
}
50+
51+
TextStyle get bodyTextStyle {
52+
return new TextStyle(color: Colors.white, fontSize: 24.0)
53+
.merge(this.textStyle);
54+
}
3655
}

0 commit comments

Comments
 (0)