1- import 'package:example/helper.dart' ;
21import 'package:flutter/material.dart' ;
32import 'package:showcaseview/showcaseview.dart' ;
43
54class Detail extends StatefulWidget {
65 const Detail ({Key ? key}) : super (key: key);
76
87 @override
9- _DetailState createState () => _DetailState ();
8+ State < Detail > createState () => _DetailState ();
109}
1110
1211class _DetailState extends State <Detail > {
@@ -16,9 +15,7 @@ class _DetailState extends State<Detail> {
1615 @override
1716 void initState () {
1817 super .initState ();
19- //NOTE: remove ambiguate function if you are using
20- //flutter version greater than 3.x and direct use WidgetsBinding.instance
21- ambiguate (WidgetsBinding .instance)? .addPostFrameCallback (
18+ WidgetsBinding .instance.addPostFrameCallback (
2219 (_) => Future .delayed (const Duration (milliseconds: 200 ), () {
2320 ShowCaseWidget .of (myContext! ).startShowCase ([_one]);
2421 }),
@@ -28,97 +25,93 @@ class _DetailState extends State<Detail> {
2825 @override
2926 Widget build (BuildContext context) {
3027 return ShowCaseWidget (
31- builder: Builder (
32- builder: (context) {
33- myContext = context;
34- return Scaffold (
35- appBar: AppBar (
36- backgroundColor: Colors .transparent,
37- elevation: 0 ,
38- leading: IconButton (
39- icon: const Icon (
40- Icons .arrow_back,
41- color: Colors .black,
42- ),
43- onPressed: () {
44- Navigator .pop (context);
45- },
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,
4638 ),
39+ onPressed: () {
40+ Navigator .pop (context);
41+ },
4742 ),
48- body : Padding (
49- padding : const EdgeInsets . all ( 16 ),
50- child : ListView (
51- children : < Widget > [
52- Showcase (
53- key : _one,
54- title : 'Title' ,
55- description : 'Desc ' ,
56- child : InkWell (
57- onTap : () {},
58- child : const Text (
59- 'Flutter Notification' ,
60- style : TextStyle (
61- fontSize : 25 ,
62- fontWeight : FontWeight .w600 ,
63- ) ,
43+ ),
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 ,
6459 ),
6560 ),
6661 ),
67- const SizedBox (
68- height: 16 ,
69- ),
70- const Text (
71- 'Hi, you have new Notification from flutter group, open '
72- 'slack and check it out' ,
73- style: TextStyle (fontSize: 18 , fontWeight: FontWeight .w500),
74- ),
75- const SizedBox (
76- height: 16 ,
77- ),
78- RichText (
79- text: const TextSpan (
80- style: TextStyle (
81- fontWeight: FontWeight .w400,
82- color: Colors .black,
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 ,
73+ ),
74+ RichText (
75+ text: const TextSpan (
76+ style: TextStyle (
77+ fontWeight: FontWeight .w400,
78+ color: Colors .black,
79+ ),
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 ' ,
8389 ),
84- children: [
85- TextSpan (text: 'Hi team,\n\n ' ),
86- TextSpan (
87- text:
88- 'As some of you know, we’re moving to Slack for '
89- 'our internal team communications. Slack is a '
90- 'messaging app where we can talk, share files, '
91- 'and work together. It also connects with tools '
92- 'we already use, like [add your examples here], '
93- 'plus 900+ other apps.\n\n ' ,
94- ),
95- TextSpan (
96- text: 'Why are we moving to Slack?\n\n ' ,
97- style: TextStyle (
98- fontWeight: FontWeight .w600,
99- color: Colors .black,
100- ),
101- ),
102- TextSpan (
103- text:
104- 'We want to use the best communication tools to '
105- 'make our lives easier and be more productive. '
106- 'Having everything in one place will help us '
107- 'work together better and faster, rather than '
108- 'jumping around between emails, IMs, texts and '
109- 'a bunch of other programs. Everything you share '
110- 'in Slack is automatically indexed and archived, '
111- 'creating a searchable archive of all our work.' ,
90+ TextSpan (
91+ text: 'Why are we moving to Slack?\n\n ' ,
92+ style: TextStyle (
93+ fontWeight: FontWeight .w600,
94+ color: Colors .black,
11295 ),
113- ],
114- ),
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+ ],
115108 ),
116- ] ,
117- ) ,
109+ ) ,
110+ ] ,
118111 ),
119- );
120- },
121- ) ,
112+ ),
113+ );
114+ } ,
122115 );
123116 }
124117}
0 commit comments