-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from its-me-abhishek/tutorial
Added a home tour for the app
- Loading branch information
Showing
5 changed files
with
272 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:shared_preferences/shared_preferences.dart'; | ||
|
||
class SaveInAppTour { | ||
Future<SharedPreferences> data = SharedPreferences.getInstance(); | ||
|
||
void saveTourStatus() async { | ||
final value = await data; | ||
value.setBool('tour', true); | ||
} | ||
|
||
Future<bool> getTourStatus() async { | ||
final value = await data; | ||
if (value.containsKey('tour')) { | ||
bool? getData = value.getBool('tour'); | ||
return getData!; | ||
} else { | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:google_fonts/google_fonts.dart'; | ||
import 'package:tutorial_coach_mark/tutorial_coach_mark.dart'; | ||
|
||
List<TargetFocus> addTargetsPage({ | ||
required GlobalKey addKey, | ||
required GlobalKey searchKey, | ||
required GlobalKey filterKey, | ||
required GlobalKey menuKey, | ||
required GlobalKey refreshKey, | ||
}) { | ||
List<TargetFocus> targets = []; | ||
|
||
// add | ||
targets.add( | ||
TargetFocus( | ||
keyTarget: addKey, | ||
alignSkip: Alignment.topRight, | ||
radius: 10, | ||
shape: ShapeLightFocus.Circle, | ||
contents: [ | ||
TargetContent( | ||
align: ContentAlign.top, | ||
builder: (context, controller) { | ||
return Container( | ||
alignment: Alignment.center, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Text( | ||
"Add a new task", | ||
textAlign: TextAlign.center, | ||
style: GoogleFonts.poppins( | ||
color: Colors.white, | ||
), | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
|
||
//search | ||
targets.add( | ||
TargetFocus( | ||
keyTarget: searchKey, | ||
alignSkip: Alignment.topRight, | ||
radius: 10, | ||
shape: ShapeLightFocus.Circle, | ||
contents: [ | ||
TargetContent( | ||
align: ContentAlign.bottom, | ||
builder: (context, controller) { | ||
return Container( | ||
alignment: Alignment.center, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Text( | ||
"Search for tasks", | ||
textAlign: TextAlign.center, | ||
style: GoogleFonts.poppins( | ||
color: Colors.white, | ||
), | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
|
||
//refresh | ||
targets.add( | ||
TargetFocus( | ||
keyTarget: refreshKey, | ||
alignSkip: Alignment.topCenter, | ||
radius: 10, | ||
shape: ShapeLightFocus.Circle, | ||
contents: [ | ||
TargetContent( | ||
align: ContentAlign.bottom, | ||
builder: (context, controller) { | ||
return Container( | ||
alignment: Alignment.center, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Text( | ||
"Refresh or sync your tasks", | ||
textAlign: TextAlign.center, | ||
style: GoogleFonts.poppins( | ||
color: Colors.white, | ||
), | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
|
||
//filter | ||
targets.add( | ||
TargetFocus( | ||
keyTarget: filterKey, | ||
alignSkip: Alignment.topCenter, | ||
radius: 10, | ||
shape: ShapeLightFocus.Circle, | ||
contents: [ | ||
TargetContent( | ||
align: ContentAlign.bottom, | ||
builder: (context, controller) { | ||
return Container( | ||
alignment: Alignment.center, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Text( | ||
"Add filters to sort your tasks and projects", | ||
textAlign: TextAlign.center, | ||
style: GoogleFonts.poppins( | ||
color: Colors.white, | ||
), | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
|
||
//menu | ||
targets.add( | ||
TargetFocus( | ||
keyTarget: menuKey, | ||
alignSkip: Alignment.bottomRight, | ||
radius: 10, | ||
shape: ShapeLightFocus.Circle, | ||
contents: [ | ||
TargetContent( | ||
align: ContentAlign.bottom, | ||
builder: (context, controller) { | ||
return Container( | ||
alignment: Alignment.center, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Text( | ||
"Access additional settings here", | ||
textAlign: TextAlign.center, | ||
style: GoogleFonts.poppins( | ||
color: Colors.white, | ||
), | ||
), | ||
], | ||
), | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
); | ||
|
||
return targets; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters