overlay_tutorial 3.0.0 overlay_tutorial: ^3.0.0 copied to clipboard
A Flutter package for displaying overlay tutorial by cutting a hole on widget. It allows also to add hint aside the hole.
import 'package:example/views/delayed_item.dart';
import 'package:example/views/simple_counter_tutorial.dart';
import 'package:flutter/material.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
debugShowCheckedModeBanner: false,
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({
Key? key,
required this.title,
}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
OutlinedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SimpleCounterTutorial(
title: widget.title,
),
),
);
},
child: const Text('Simple counter'),
),
OutlinedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const DelayedItem(),
),
);
},
child: const Text('Delayed item'),
),
],
),
);
}
}