hover 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • new55

Hover #

An app framework and widget library for Flutter

[0.0.1] - 3/25/2020. #

  • Created the hover package and published to pub.dev.

[0.0.2] - 3/27/2020. #

  • Implemented global widgets for an application by using provider with HoverGlobalWidgets.

[0.0.3] - 3/29/2020. #

  • Fixed issues with navigation not working properly. Created the HoverSwapper page class.

[0.0.3+1] - 3/29/2020. #

  • Updated HoverSwapper to use AnimatedSwitcher.

[0.1.0] - 4/3/2020. #

  • Implemented theme switching and updated the example.

example/lib/main.dart

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

import 'app/profile_page.dart';
import 'app/landing_page.dart';

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

class HoverExample extends StatelessWidget {
  final LandingPage landingPage = LandingPage();
  final ProfilePage profilePage = ProfilePage();

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

  ///
  /// A Drawer builder function that will be used to
  /// create a globally accessible navigation drawer
  ///
  Drawer buildDrawer(BuildContext context) {
    final items = [
      "Favorites",
      "Recommended",
      "Messages",
      "Settings",
    ];
    return Drawer(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          UserAccountsDrawerHeader(
            accountName: Text("Jane Doe"),
            accountEmail: Text("sample@email.com"),
            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.closeDrawer();
                      // Hover.currentPage.showSnackBar(context, "message");
                      Hover.router.goToPage<ProfilePage>(context);
                    },
                    title: Text(items[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();
        },
        child: Icon(Icons.menu, color: Colors.white),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  hover: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:hover/hover.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
11
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
55
Learn more about scoring.

We analyzed this package on Apr 7, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
provider ^4.0.4 4.0.4 4.1.0-dev+2
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
nested 0.0.4
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test