home_page_provider 1.1.0 copy "home_page_provider: ^1.1.0" to clipboard
home_page_provider: ^1.1.0 copied to clipboard

A Flutter package project that gives the option to have a separate home page for web and mobile

home_page_provider #

The HomePageProvider class gives the option to have a separate home page for web and mobile

Getting started #

Installation #

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
  home_page_provider: ^1.0.0

Than import the package via:

import 'package:home_page_provider/home_page_provider.dart';

Usage #

Instead of passing your home page widget to, for example, MaterialApp, you would pass 2 versions of it instead, one for web and one for mobile.

@override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Home Page Provider package demo',
      home: HomePageProvider().getWebOrMobileHomePage(
        const HomePageWeb(),
        const HomePageMobile(),
      ),
    );
  }

Additional information #

This package relies on the idea that the following imports are mutually exclusive:

  if (dart.library.io) 'home_page_provider_mobile.dart'
  if (dart.library.html) 'home_page_provider_web.dart' ;

Take a look at the package source.

0
likes
0
points
26
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package project that gives the option to have a separate home page for web and mobile

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on home_page_provider