hover 0.1.8 copy "hover: ^0.1.8" to clipboard
hover: ^0.1.8 copied to clipboard

outdated

An app framework and widget library that aims to simplify navigation, theme switching, responsive design, and more to speed up prototype development.

example/lib/main.dart

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

import 'app/profile_example.dart';
import 'app/login_form_example.dart';

void main() => runApp(HoverExample());

class HoverExample extends StatelessWidget {
  final ProfileExample profilePage = ProfileExample();
  final LoginFormExample loginFormExample = LoginFormExample();

  @override
  Widget build(BuildContext context) {
    return Hover.create(
      routes: [
        loginFormExample,
        profilePage,
      ],
      themes: {
        "light": ThemeData.light(),
        "dark": ThemeData.dark(),
      },
      providers: [],
      globalAppBarBuilder: buildAppBar,
      globalDrawerBuilder: buildDrawer,
    );
  }

  ///
  /// A Drawer builder function that will be used to
  /// create a globally accessible navigation drawer
  ///
  Drawer buildDrawer(BuildContext context) {
    final items = {
      "Login": loginFormExample,
      "Profile": profilePage,
    };
    return Drawer(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          UserAccountsDrawerHeader(
            accountName: Text("Jane Doe"),
            accountEmail: Text("[email protected]"),
            currentAccountPicture: CircleAvatar(
              radius: 80,
              backgroundImage: NetworkImage(
                  "https://images.pexels.com/photos/1102341/pexels-photo-1102341.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260"),
            ),
          ),
          Expanded(
            child: ListView.builder(
                itemCount: items.length,
                itemBuilder: (context, i) {
                  return ListTile(
                    onTap: () {
                      Hover.router.navigateTo(
                          items.values.elementAt(i).routeName, context);
                    },
                    title: Text(items.keys.elementAt(i)),
                  );
                }),
          ),
        ],
      ),
    );
  }

  ///
  /// An AppBar builder function that will be used
  /// to create an app bar widget that will be
  /// displayed globally
  ///
  AppBar buildAppBar(BuildContext context) {
    return AppBar(
      title: Text("Hover Sample App"),
      leading: FlatButton(
        onPressed: () {
          Hover.toggleDrawer(context);
        },
        child: Icon(Icons.menu, color: Colors.white),
      ),
    );
  }
}
3
likes
0
points
34
downloads

Publisher

verified publisherernpao.online

Weekly Downloads

An app framework and widget library that aims to simplify navigation, theme switching, responsive design, and more to speed up prototype development.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, provider, shared_preferences

More

Packages that depend on hover