flutter_whatsnew 1.0.2+2

  • Readme
  • Changelog
  • Example
  • Installing
  • 91

Flutter Community: flutter_whatsnew

Buy Me A Coffee Donate

flutter_whatsnew #

pub package

A Flutter Plugin to Show a Whats New page.

Usage #

To use this plugin, add flutter_whatsnew as a dependency in your pubspec.yaml file.

// Import package
import 'package:flutter_whatsnew/flutter_whatsnew.dart';

changelog

If using WhatsNewPage.changelog and you want it to pickup the `CHANGELOG.md' add it to the Flutter asset directory, otherwise manually pass in the .md file with the changes. This uses the full markdown previewer.

  assets:
    - CHANGELOG.md

changelog

Example #

import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_whatsnew/flutter_whatsnew.dart';

void main() {
  runApp(MaterialApp(home: ShowWhatsNew()));
}

class ShowWhatsNew extends StatelessWidget {
  final double textScaleFactor = 1.0;

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: SafeArea(
          child: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            RaisedButton(
              child: Text("Show Changelog"),
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => WhatsNewPage.changelog(
                          title: Text(
                            "What's New",
                            textScaleFactor: textScaleFactor,
                            textAlign: TextAlign.center,
                            style: const TextStyle(
                              // Text Style Needed to Look like iOS 11
                              fontSize: 22.0,
                              fontWeight: FontWeight.bold,
                            ),
                          ),
                          buttonText: Text(
                            'Continue',
                            textScaleFactor: textScaleFactor,
                            style: const TextStyle(color: Colors.white),
                          ),
                        ),
                    fullscreenDialog: true,
                  ),
                );
              },
            ),
            Container(height: 50.0),
            RaisedButton(
              child: Text("Show Changes"),
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => WhatsNewPage(
                          title: Text(
                            "What's New",
                            textScaleFactor: textScaleFactor,
                            textAlign: TextAlign.center,
                            style: const TextStyle(
                              // Text Style Needed to Look like iOS 11
                              fontSize: 22.0,
                              fontWeight: FontWeight.bold,
                            ),
                          ),
                          buttonText: Text(
                            'Continue',
                            textScaleFactor: textScaleFactor,
                            style: const TextStyle(color: Colors.white),
                          ),
                          // Create a List of WhatsNewItem for use in the Whats New Page
                          // Create as many as you need, it will be scrollable
                          items: <ListTile>[
                            ListTile(
                              leading: const Icon(Icons.color_lens),
                              title: Text(
                                'Dark Theme',
                                textScaleFactor: textScaleFactor,
                              ), //Title is the only Required Item
                              subtitle: Text(
                                'Black and grey theme (Tap to Change)',
                                textScaleFactor: textScaleFactor,
                              ),
                              onTap: () {
                                // You Can Navigate to Locations in the App
                                Navigator.of(context).pushNamed("/settings");
                              },
                            ),
                            ListTile(
                              leading: const Icon(Icons.map),
                              title: Text(
                                'Google Maps',
                                textScaleFactor: textScaleFactor,
                              ),
                              subtitle: Text(
                                'Open Address Links in Google Maps instead of Apple Maps (Tap to Change)',
                                textScaleFactor: textScaleFactor,
                              ),
                              onTap: () {
                                // You Can Navigate to Locations in the App
                                Navigator.of(context).pushNamed("/settings");
                              },
                            ),
                            ListTile(
                              leading: const Icon(Icons.notifications_active),
                              title: Text(
                                'Push Notifications',
                                textScaleFactor: textScaleFactor,
                              ),
                              subtitle: Text(
                                'Stay tuned for important information that can be pushed to you',
                                textScaleFactor: textScaleFactor,
                              ),
                              onTap: () {
                                WhatsNewPage.showDetailPopUp(
                                  context,
                                  'Info',
                                  "You can turn off push notifications any time in your application settings.",
                                );
                              },
                            ),
                          ], //Required
                        ),
                    fullscreenDialog: true,
                  ),
                );
              },
            ),
          ],
        ),
      )),
    );
  }
}

1.0.2 #

  • Adding Path Option
  • Removing Native Widgets

1.0.1 #

  • Bumping Version

1.0.0 #

  • Addign Cupertino UI

0.3.0 - 04.06.2019 #

  • Making Example Desktop Aware

0.2.1 - 04.05.2019 #

  • tb2761 Added Button Colors

[0.2.0] - Breaking Changes

  • Updated Example
  • Added Ability to Read from Changelog
  • Removed Method WhatsNewPage.show()
  • Adding flutter_markdown

[0.1.0] - Breaking Change

  • Updated Example
  • Removed get_version
  • Plugin is now pure dart
  • Added Method WhatsNewPage.show()

[0.0.7] - New Button Action

  • Updated Example

[0.0.6] - New Button Action

  • Added Optional Callback for Button Press.
  • By Defualt it will Push to the Passed Widget.
  • Updating Dart Dependency

[0.0.5] - Updating for Flutter

  • Increased button width on android.
  • Updated native_widgets 0.1.0

[0.0.4] - Bug Fixes

  • Fixed Loading Bug.

[0.0.3] - Bug Fixes

  • Updating Startup Behavior.

[0.0.2] - Bug Fixes

  • Updating Startup Behavior.

[0.0.1] - Whats New Widget

  • Added Components, Version Check and Example.
  • Added native_widgets

example/README.md

flutter_whatsnew_example #

Demonstrates how to use the flutter_whatsnew plugin.

import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_whatsnew/flutter_whatsnew.dart';

void main() {
  runApp(MaterialApp(home: ShowWhatsNew()));
}

class ShowWhatsNew extends StatelessWidget {
  final double textScaleFactor = 1.0;

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: SafeArea(
          child: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            RaisedButton(
              child: Text("Show Changelog"),
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => WhatsNewPage.changelog(
                          title: Text(
                            "What's New",
                            textScaleFactor: textScaleFactor,
                            textAlign: TextAlign.center,
                            style: const TextStyle(
                              // Text Style Needed to Look like iOS 11
                              fontSize: 22.0,
                              fontWeight: FontWeight.bold,
                            ),
                          ),
                          buttonText: Text(
                            'Continue',
                            textScaleFactor: textScaleFactor,
                            style: const TextStyle(color: Colors.white),
                          ),
                        ),
                    fullscreenDialog: true,
                  ),
                );
              },
            ),
            Container(height: 50.0),
            RaisedButton(
              child: Text("Show Changes"),
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) => WhatsNewPage(
                          title: Text(
                            "What's New",
                            textScaleFactor: textScaleFactor,
                            textAlign: TextAlign.center,
                            style: const TextStyle(
                              // Text Style Needed to Look like iOS 11
                              fontSize: 22.0,
                              fontWeight: FontWeight.bold,
                            ),
                          ),
                          buttonText: Text(
                            'Continue',
                            textScaleFactor: textScaleFactor,
                            style: const TextStyle(color: Colors.white),
                          ),
                          // Create a List of WhatsNewItem for use in the Whats New Page
                          // Create as many as you need, it will be scrollable
                          items: <ListTile>[
                            ListTile(
                              leading: const Icon(Icons.color_lens),
                              title: Text(
                                'Dark Theme',
                                textScaleFactor: textScaleFactor,
                              ), //Title is the only Required Item
                              subtitle: Text(
                                'Black and grey theme (Tap to Change)',
                                textScaleFactor: textScaleFactor,
                              ),
                              onTap: () {
                                // You Can Navigate to Locations in the App
                                Navigator.of(context).pushNamed("/settings");
                              },
                            ),
                            ListTile(
                              leading: const Icon(Icons.map),
                              title: Text(
                                'Google Maps',
                                textScaleFactor: textScaleFactor,
                              ),
                              subtitle: Text(
                                'Open Address Links in Google Maps instead of Apple Maps (Tap to Change)',
                                textScaleFactor: textScaleFactor,
                              ),
                              onTap: () {
                                // You Can Navigate to Locations in the App
                                Navigator.of(context).pushNamed("/settings");
                              },
                            ),
                            ListTile(
                              leading: const Icon(Icons.notifications_active),
                              title: Text(
                                'Push Notifications',
                                textScaleFactor: textScaleFactor,
                              ),
                              subtitle: Text(
                                'Stay tuned for important information that can be pushed to you',
                                textScaleFactor: textScaleFactor,
                              ),
                              onTap: () {
                                WhatsNewPage.showDetailPopUp(
                                  context,
                                  'Info',
                                  "You can turn off push notifications any time in your application settings.",
                                );
                              },
                            ),
                          ], //Required
                        ),
                    fullscreenDialog: true,
                  ),
                );
              },
            ),
          ],
        ),
      )),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_whatsnew: ^1.0.2+2

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:flutter_whatsnew/flutter_whatsnew.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
88
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
87
Overall:
Weighted score of the above. [more]
91
Learn more about scoring.

We analyzed this package on Oct 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

The package description is too short. (-13 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
flutter 0.0.0
flutter_markdown ^0.2.0 0.2.0
Transitive dependencies
args 1.5.2
charcode 1.1.2
collection 1.14.11 1.14.12
markdown 2.1.1
meta 1.1.7
path 1.6.4
sky_engine 0.0.99
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test