feature_intro

Last updated:

0 purchases

feature_intro Image
feature_intro Images
Add to Cart

Description:

feature intro

Features #
A simple library for creating feature introduction to make dev life easier.
Getting started #
Create a list of customized intro keys
enum AppFeatureIntro {
firstStep(FeatureIntroStepKey(key: Key("firstStep"))),
secondStep(FeatureIntroStepKey(key: Key("secondStep"))),
thirdStep(FeatureIntroStepKey(key: Key("thirdStep")));

final FeatureIntroStepKey key;

const AppFeatureIntro(this.key);
}
copied to clipboard
Create a FeatureIntro widget
Widget build(BuildContext context) {
return MaterialApp.router(
title: 'Flutter Demo',
theme: ThemeData(
useMaterial3: true,
),
builder: (context, child) => FeatureIntro(controller: FeatureIntroController(), child: Container(child: child)));
}
copied to clipboard
Usage #
For example to start using the intro:
FeatureIntro.of(context).start(keys: [
AppFeatureIntro.firstStep.key,
AppFeatureIntro.secondStep.key,
AppFeatureIntro.thirdStep.key
]);
copied to clipboard
For example to init step content:
FeatureIntroStep(
controller: FeatureIntro.of(context).controller,
stepKey: AppFeatureIntro.thirdStep.key,
highlightInnerPadding: 5,
contentOffset: const Offset(0, 10),
content: Container(
width: 100,
height: 100,
color: Colors.blue,
child: Center(
child: TextButton(
onPressed: () {
FeatureIntro.of(context).controller.close();
},
child: const Text("Press me close!")),
),
),
child: OutlinedButton(
style: OutlinedButton.styleFrom(backgroundColor: Colors.white),
onPressed: () {
FeatureIntro.of(context).start(keys: [
AppFeatureIntro.firstStep.key,
AppFeatureIntro.secondStep.key,
AppFeatureIntro.thirdStep.key
]);
},
child: const Text("Start intro")),
)
copied to clipboard
For example to next step:
FeatureIntro.of(context).controller.next();
copied to clipboard
For example to previous step:
FeatureIntro.of(context).controller.previous();
copied to clipboard
For example to close the intro:
FeatureIntro.of(context).controller.close();
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.