Skip to content

Commit b3fd9df

Browse files
authored
Merge pull request #20 from Iconica-Development/bugfix/default_style
fix: default styling
2 parents 89bc007 + 4868f3c commit b3fd9df

15 files changed

Lines changed: 136 additions & 116 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 4.0.0
2+
3+
* Added Buildcontext to the pages parameter.
4+
* Added `dotColor` so the default can be changed.
5+
* Changed the default `pages` to include theme.
6+
17
## 3.1.0
28

39
* Introduction now uses `IntroductionScreenMode` to determine how often the introductions should be shown

packages/flutter_introduction/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class _MyHomePageState extends State<MyHomePage> {
3838
Widget build(BuildContext context) => Scaffold(
3939
body: Introduction(
4040
options: IntroductionOptions(
41-
pages: [
41+
pages: (context) => [
4242
const IntroductionPage(
4343
title: Text('First page'),
4444
text: Text('Wow a page'),

packages/flutter_introduction/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_introduction
22
description: Combined Package of Flutter Introduction Widget and Flutter Introduction Service
3-
version: 3.1.0
3+
version: 4.0.0
44
publish_to: none
55

66
environment:
@@ -13,12 +13,12 @@ dependencies:
1313
flutter_introduction_widget:
1414
git:
1515
url: https://github.com/Iconica-Development/flutter_introduction
16-
ref: 3.1.0
16+
ref: 4.0.0
1717
path: packages/flutter_introduction_widget
1818
flutter_introduction_service:
1919
git:
2020
url: https://github.com/Iconica-Development/flutter_introduction
21-
ref: 3.1.0
21+
ref: 4.0.0
2222
path: packages/flutter_introduction_service
2323

2424
dev_dependencies:

packages/flutter_introduction_firebase/lib/src/introduction_widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class _IntroductionState extends State<IntroductionFirebase> {
115115
snapshot.data is List<IntroductionPageData>) {
116116
return IntroductionScreen(
117117
options: widget.options.copyWith(
118-
pages: snapshot.data?.map(
118+
pages: (context) => snapshot.data!.map(
119119
(e) {
120120
var title = e.title.isEmpty
121121
? ''

packages/flutter_introduction_firebase/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_introduction_firebase
22
description: Flutter Introduction Page that uses firebase for the pages and some settings
3-
version: 3.1.0
3+
version: 4.0.0
44
publish_to: none
55

66
environment:
@@ -15,12 +15,12 @@ dependencies:
1515
flutter_introduction_widget:
1616
git:
1717
url: https://github.com/Iconica-Development/flutter_introduction
18-
ref: 3.1.0
18+
ref: 4.0.0
1919
path: packages/flutter_introduction_widget
2020
flutter_introduction_service:
2121
git:
2222
url: https://github.com/Iconica-Development/flutter_introduction
23-
ref: 3.1.0
23+
ref: 4.0.0
2424
path: packages/flutter_introduction_service
2525

2626
dev_dependencies:

packages/flutter_introduction_interface/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_introduction_interface
22
description: A new Flutter package project.
3-
version: 3.1.0
3+
version: 4.0.0
44
publish_to: none
55

66
environment:

packages/flutter_introduction_service/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_introduction_service
22
description: A new Flutter package project.
3-
version: 3.1.0
3+
version: 4.0.0
44
publish_to: none
55

66
environment:
@@ -13,7 +13,7 @@ dependencies:
1313
flutter_introduction_interface:
1414
git:
1515
url: https://github.com/Iconica-Development/flutter_introduction
16-
ref: 3.1.0
16+
ref: 4.0.0
1717
path: packages/flutter_introduction_interface
1818

1919
dev_dependencies:

packages/flutter_introduction_shared_preferences/pubspec.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
name: flutter_introduction_shared_preferences
22
description: A new Flutter package project.
3-
version: 3.1.0
3+
version: 4.0.0
44
publish_to: none
55

66
environment:
7-
sdk: '>=2.18.0 <3.0.0'
7+
sdk: ">=2.18.0 <3.0.0"
88
flutter: ">=1.17.0"
99

1010
dependencies:
1111
flutter:
1212
sdk: flutter
13-
flutter_introduction_interface:
14-
git:
13+
flutter_introduction_interface:
14+
git:
1515
url: https://github.com/Iconica-Development/flutter_introduction
16-
ref: 3.1.0
16+
ref: 4.0.0
1717
path: packages/flutter_introduction_interface
1818
shared_preferences: any
1919

packages/flutter_introduction_widget/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MyApp extends StatelessWidget {
3131
),
3232
home: IntroductionScreen(
3333
options: IntroductionOptions(
34-
pages: [
34+
pages: (context) => [
3535
const IntroductionPage(
3636
title: Text('Basic Page'),
3737
text: Text(
Lines changed: 73 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,85 @@
1-
21
import 'package:flutter/material.dart';
32
import 'package:flutter_introduction_widget/flutter_introduction_widget.dart';
43

5-
const List<IntroductionPage> defaultIntroductionPages = [
6-
IntroductionPage(
7-
title: Column(
8-
children: [
9-
SizedBox(height: 50),
10-
Text(
11-
'welcome to iconinstagram',
4+
List<IntroductionPage> defaultIntroductionPages(BuildContext context) {
5+
var theme = Theme.of(context);
6+
return [
7+
IntroductionPage(
8+
title: Column(
9+
children: [
10+
const SizedBox(height: 50),
11+
Text(
12+
'welcome to iconinstagram',
13+
style: theme.textTheme.headlineLarge,
14+
),
15+
const SizedBox(height: 6),
16+
],
17+
),
18+
graphic: const Image(
19+
image: AssetImage(
20+
'assets/first.png',
21+
package: 'flutter_introduction_widget',
1222
),
13-
SizedBox(height: 6),
14-
],
15-
),
16-
graphic: Image(
17-
image: AssetImage(
18-
'assets/first.png',
19-
package: 'flutter_introduction_widget',
23+
),
24+
text: Text(
25+
'Welcome to the world of Instagram, where creativity'
26+
' knows no bounds and connections are made'
27+
' through captivating visuals.',
28+
textAlign: TextAlign.center,
29+
style: theme.textTheme.bodyMedium,
2030
),
2131
),
22-
text: Text(
23-
'Welcome to the world of Instagram, where creativity'
24-
' knows no bounds and connections are made'
25-
' through captivating visuals.',
26-
textAlign: TextAlign.center,
27-
),
28-
),
29-
IntroductionPage(
30-
title: Column(
31-
mainAxisAlignment: MainAxisAlignment.center,
32-
children: [
33-
SizedBox(height: 50),
34-
Text(
35-
'discover iconinstagram',
32+
IntroductionPage(
33+
title: Column(
34+
mainAxisAlignment: MainAxisAlignment.center,
35+
children: [
36+
const SizedBox(height: 50),
37+
Text(
38+
'discover iconinstagram',
39+
style: theme.textTheme.headlineLarge,
40+
),
41+
const SizedBox(height: 6),
42+
],
43+
),
44+
text: Text(
45+
'Dive into the vibrant world of'
46+
' Instagram and discover endless possibilities.'
47+
' From stunning photography to engaging videos,'
48+
' Instagram offers a diverse range of content to explore and enjoy.',
49+
textAlign: TextAlign.center,
50+
style: theme.textTheme.bodyMedium,
51+
),
52+
graphic: const Image(
53+
image: AssetImage(
54+
'assets/second.png',
55+
package: 'flutter_introduction_widget',
3656
),
37-
SizedBox(height: 6),
38-
],
39-
),
40-
text: Text(
41-
'Dive into the vibrant world of'
42-
' Instagram and discover endless possibilities.'
43-
' From stunning photography to engaging videos,'
44-
' Instagram offers a diverse range of content to explore and enjoy.',
45-
textAlign: TextAlign.center,
46-
),
47-
graphic: Image(
48-
image: AssetImage(
49-
'assets/second.png',
50-
package: 'flutter_introduction_widget',
5157
),
5258
),
53-
),
54-
IntroductionPage(
55-
title: Column(
56-
children: [
57-
SizedBox(height: 50),
58-
Text(
59-
'elevate your experience',
59+
IntroductionPage(
60+
title: Column(
61+
children: [
62+
const SizedBox(height: 50),
63+
Text(
64+
'elevate your experience',
65+
style: theme.textTheme.headlineLarge,
66+
),
67+
const SizedBox(height: 6),
68+
],
69+
),
70+
graphic: const Image(
71+
image: AssetImage(
72+
'assets/third.png',
73+
package: 'flutter_introduction_widget',
6074
),
61-
SizedBox(height: 6),
62-
],
63-
),
64-
graphic: Image(
65-
image: AssetImage(
66-
'assets/third.png',
67-
package: 'flutter_introduction_widget',
75+
),
76+
text: Text(
77+
'Whether promoting your business, or connecting'
78+
' with friends and family, Instagram provides the'
79+
' tools and platform to make your voice heard.',
80+
textAlign: TextAlign.center,
81+
style: theme.textTheme.bodyMedium,
6882
),
6983
),
70-
text: Text(
71-
'Whether promoting your business, or connecting'
72-
' with friends and family, Instagram provides the'
73-
' tools and platform to make your voice heard.',
74-
textAlign: TextAlign.center,
75-
),
76-
),
77-
];
84+
];
85+
}

0 commit comments

Comments
 (0)