iws_help 0.5.0 copy "iws_help: ^0.5.0" to clipboard
iws_help: ^0.5.0 copied to clipboard

Add documentation pages and contextual help to widgets using the IWS service.

example/main.dart

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

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  final iwsHelp = IwsHelp();

  // If you want to use a custom content builder, set it here
  iwsHelp.contentBuilder = (documentaion) {
    return Text(documentaion.rawContent ?? 'Help not available');
  };

  // Load help from server
  iwsHelp.loadHelp();

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
        actions: const [GeneralHelpButton(), SizedBox(width: 10)],
      ),
      body: const Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            HelpIcon(
              helpKey: 'money',
              fullScreen: false,
              child: SizedBox(
                width: 200,
                child: TextField(
                  decoration: InputDecoration(labelText: 'Money'),
                ),
              ),
            ),
            SizedBox(height: 20),
            HelpIcon(
              helpKey: 'recovery_pass',
              fullScreen: true,
              child: SizedBox(
                  width: 300,
                  child: FilledButton(
                      onPressed: null, child: Text('Password recovery'))),
            ),
          ],
        ),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
0
likes
140
points
24
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Add documentation pages and contextual help to widgets using the IWS service.

Homepage

License

MIT (license)

Dependencies

bloc, flutter, flutter_bloc, flutter_markdown, iws_http, iws_http_model, url_launcher

More

Packages that depend on iws_help