Anyone knows how to add tutorial when the app is launched for the first time in flutter? Example is attached as an image.
Flutter & Dart is a good course wherein you can learn both Dart and Flutter at once. Similarly, getting started with Flutter is a good beginner's course that you can take up for free.
You can use tutorial_coach_mark library,like:
import 'package:flutter/material.dart';
import 'package:tutorial_coach_mark/tutorial_coach_mark.dart';
void showTutorial() {
TutorialCoachMark(
context,
targets: targets, // List<TargetFocus>
colorShadow: Colors.red, // DEFAULT Colors.black
// alignSkip: Alignment.bottomRight,
// textSkip: "SKIP",
// paddingFocus: 10,
finish: (){
print("finish");
},
clickTarget: (target){
print(target);
},
clickSkip: (){
print("skip");
}
)..show();
}
To be able to use it for the first time you need the shared_preferences package:
SharedPreferences prefs = await SharedPreferences.getInstance();
var watchedIntro=prefs.getBool('watchedIntro')??false;
if(!watchedIntro)
and when the tutorial ended set watchedIntro
to true:
await prefs.setBool('watchedIntro', true);
You can try out this package, tutorial_coach_mark.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With