@@ -11,107 +11,107 @@ class Detail extends StatefulWidget {
11
11
class _DetailState extends State <Detail > {
12
12
final GlobalKey _one = GlobalKey ();
13
13
BuildContext ? myContext;
14
+ final scopeName = "_detailsScreen" ;
14
15
15
16
@override
16
17
void initState () {
17
18
super .initState ();
19
+ // This is optional but if you need different configuration in
20
+ // ShowcaseView then you can register new ShowcaseView
21
+ ShowcaseView .register (scope: scopeName);
18
22
WidgetsBinding .instance.addPostFrameCallback (
19
- (_) => Future .delayed (const Duration (milliseconds: 200 ), () {
20
- ShowCaseWidget .of (myContext! ).startShowCase ([_one]);
21
- }),
23
+ (_) => ShowcaseView .getNamed (scopeName).startShowCase (
24
+ [_one],
25
+ delay: const Duration (milliseconds: 200 ),
26
+ ),
22
27
);
23
28
}
24
29
25
30
@override
26
31
Widget build (BuildContext context) {
27
- return ShowCaseWidget (
28
- builder: (context) {
29
- myContext = context;
30
- return Scaffold (
31
- appBar: AppBar (
32
- backgroundColor: Colors .transparent,
33
- elevation: 0 ,
34
- leading: IconButton (
35
- icon: const Icon (
36
- Icons .arrow_back,
37
- color: Colors .black,
38
- ),
39
- onPressed: () {
40
- Navigator .pop (context);
41
- },
42
- ),
32
+ return Scaffold (
33
+ appBar: AppBar (
34
+ backgroundColor: Colors .transparent,
35
+ elevation: 0 ,
36
+ leading: IconButton (
37
+ icon: const Icon (
38
+ Icons .arrow_back,
39
+ color: Colors .black,
43
40
),
44
- body: Padding (
45
- padding: const EdgeInsets .all (16 ),
46
- child: ListView (
47
- children: < Widget > [
48
- Showcase (
49
- key: _one,
50
- title: 'Title' ,
51
- description: 'Desc' ,
52
- child: InkWell (
53
- onTap: () {},
54
- child: const Text (
55
- 'Flutter Notification' ,
56
- style: TextStyle (
57
- fontSize: 25 ,
58
- fontWeight: FontWeight .w600,
59
- ),
60
- ),
41
+ onPressed: () {
42
+ Navigator .pop (context);
43
+ },
44
+ ),
45
+ ),
46
+ body: Padding (
47
+ padding: const EdgeInsets .all (16 ),
48
+ child: ListView (
49
+ children: < Widget > [
50
+ Showcase (
51
+ key: _one,
52
+ title: 'Title' ,
53
+ description: 'Desc' ,
54
+ child: InkWell (
55
+ onTap: () {},
56
+ child: const Text (
57
+ 'Flutter Notification' ,
58
+ style: TextStyle (
59
+ fontSize: 25 ,
60
+ fontWeight: FontWeight .w600,
61
61
),
62
62
),
63
- const SizedBox (
64
- height: 16 ,
65
- ),
66
- const Text (
67
- 'Hi, you have new Notification from flutter group, open '
68
- 'slack and check it out' ,
69
- style: TextStyle (fontSize: 18 , fontWeight: FontWeight .w500),
70
- ),
71
- const SizedBox (
72
- height: 16 ,
63
+ ),
64
+ ),
65
+ const SizedBox (
66
+ height: 16 ,
67
+ ),
68
+ const Text (
69
+ 'Hi, you have new Notification from flutter group, open '
70
+ 'slack and check it out' ,
71
+ style: TextStyle (fontSize: 18 , fontWeight: FontWeight .w500),
72
+ ),
73
+ const SizedBox (
74
+ height: 16 ,
75
+ ),
76
+ RichText (
77
+ text: const TextSpan (
78
+ style: TextStyle (
79
+ fontWeight: FontWeight .w400,
80
+ color: Colors .black,
73
81
),
74
- RichText (
75
- text: const TextSpan (
82
+ children: [
83
+ TextSpan (text: 'Hi team,\n\n ' ),
84
+ TextSpan (
85
+ text: 'As some of you know, we’re moving to Slack for '
86
+ 'our internal team communications. Slack is a '
87
+ 'messaging app where we can talk, share files, '
88
+ 'and work together. It also connects with tools '
89
+ 'we already use, like [add your examples here], '
90
+ 'plus 900+ other apps.\n\n ' ,
91
+ ),
92
+ TextSpan (
93
+ text: 'Why are we moving to Slack?\n\n ' ,
76
94
style: TextStyle (
77
- fontWeight: FontWeight .w400 ,
95
+ fontWeight: FontWeight .w600 ,
78
96
color: Colors .black,
79
97
),
80
- children: [
81
- TextSpan (text: 'Hi team,\n\n ' ),
82
- TextSpan (
83
- text: 'As some of you know, we’re moving to Slack for '
84
- 'our internal team communications. Slack is a '
85
- 'messaging app where we can talk, share files, '
86
- 'and work together. It also connects with tools '
87
- 'we already use, like [add your examples here], '
88
- 'plus 900+ other apps.\n\n ' ,
89
- ),
90
- TextSpan (
91
- text: 'Why are we moving to Slack?\n\n ' ,
92
- style: TextStyle (
93
- fontWeight: FontWeight .w600,
94
- color: Colors .black,
95
- ),
96
- ),
97
- TextSpan (
98
- text: 'We want to use the best communication tools to '
99
- 'make our lives easier and be more productive. '
100
- 'Having everything in one place will help us '
101
- 'work together better and faster, rather than '
102
- 'jumping around between emails, IMs, texts and '
103
- 'a bunch of other programs. Everything you share '
104
- 'in Slack is automatically indexed and archived, '
105
- 'creating a searchable archive of all our work.' ,
106
- ),
107
- ],
108
98
),
109
- ),
110
- ],
99
+ TextSpan (
100
+ text: 'We want to use the best communication tools to '
101
+ 'make our lives easier and be more productive. '
102
+ 'Having everything in one place will help us '
103
+ 'work together better and faster, rather than '
104
+ 'jumping around between emails, IMs, texts and '
105
+ 'a bunch of other programs. Everything you share '
106
+ 'in Slack is automatically indexed and archived, '
107
+ 'creating a searchable archive of all our work.' ,
108
+ ),
109
+ ],
110
+ ),
111
111
),
112
- ) ,
113
- );
114
- } ,
112
+ ] ,
113
+ ),
114
+ ) ,
115
115
);
116
116
}
117
117
}
0 commit comments