explain_features_tutorial 0.1.2 copy "explain_features_tutorial: ^0.1.2" to clipboard
explain_features_tutorial: ^0.1.2 copied to clipboard

A flutter project to help on tutorials, simple and easy to use

example/main.dart

import 'package:explain_features_tutorial/explain_features_tutorial.dart';
import 'package:flutter/material.dart';

/// A simple example showing how to use ExplainFeaturesTutorial.
/// this is the application root,
void main() {
  runApp(
    MaterialApp(
      home: const Home(),
      theme: ThemeData.light(),
      title: 'Explain Features Tutorial',
      debugShowCheckedModeBanner: false,
    ),
  );
}

/// this is the home, where all the code is defined.
class Home extends StatelessWidget {
  const Home({super.key});

  @override
  Widget build(BuildContext context) {
    final GlobalKey appBarKey = GlobalKey();
    final GlobalKey body1Key = GlobalKey();
    final GlobalKey body2Key = GlobalKey();
    final GlobalKey bottomNav = GlobalKey();

    final List<GlobalKey> allKeys = <GlobalKey>[
      appBarKey,
      body2Key,
      body1Key,
      bottomNav,
    ];

    return ExplainFeaturesTutorial(
      widgetKeys: allKeys,
      widgetExplainerText: const <String>[
        'This is the app bar action button',
        'Visit Site text on the body',
        'First Widget on the body',
        'Widget on bottom navigation bar for help',
      ],
      child: Scaffold(
        appBar: AppBar(
          actions: <Widget>[
            IconButton(
              key: appBarKey,
              onPressed: () {},
              icon: const Icon(Icons.local_activity),
            ),
          ],
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Text(
                key: body1Key,
                'Developing is fun and cool',
                style: const TextStyle(fontSize: 20),
              ),
              Text(
                key: body2Key,
                'Visit my site for work or help: https://king-kibugenza.web.app/',
                style: const TextStyle(fontSize: 20),
              ),
            ],
          ),
        ),
        bottomNavigationBar: Row(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            Text(
              key: bottomNav,
              'Reach out for more help',
              style: const TextStyle(fontSize: 20),
            ),
          ],
        ),
      ),
    );
  }
}
2
likes
0
points
149
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter project to help on tutorials, simple and easy to use

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on explain_features_tutorial