add flutter_whatsnew

This commit is contained in:
2026-01-14 01:05:24 -08:00
parent ea97794e19
commit 42350734bb
43 changed files with 60270 additions and 0 deletions
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences_ios","path":"/Users/rodydavis/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/","native_build":true,"dependencies":[]}],"android":[{"name":"shared_preferences_android","path":"/Users/rodydavis/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.13/","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/rodydavis/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.4/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/rodydavis/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/rodydavis/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.1/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"/Users/rodydavis/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/rodydavis/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.1/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"/Users/rodydavis/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.4/","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2022-10-31 19:15:52.967674","version":"3.4.0-30.0.pre.12"}
@@ -0,0 +1,70 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# Visual Studio Code related
.vscode/
# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/
/build/
# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
@@ -0,0 +1,45 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
version:
revision: 7679b8c37130170ddcf60afac00954dfdccd2763
channel: master
project_type: app
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
base_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
- platform: android
create_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
base_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
- platform: ios
create_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
base_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
- platform: linux
create_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
base_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
- platform: macos
create_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
base_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
- platform: web
create_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
base_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
- platform: windows
create_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
base_revision: 7679b8c37130170ddcf60afac00954dfdccd2763
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
@@ -0,0 +1,44 @@
## [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.
+142
View File
@@ -0,0 +1,142 @@
# flutter_whatsnew_example
Demonstrates how to use the flutter_whatsnew plugin.
```dart
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,
),
);
},
),
],
),
)),
);
}
}
```
@@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
@@ -0,0 +1,181 @@
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_whatsnew/flutter_whatsnew.dart';
import 'dart:io' show Platform;
import 'package:flutter/foundation.dart';
// The existing imports
// !! Keep your existing impots here !!
/// main is entry point of Flutter application
void main() {
// Desktop platforms aren't a valid platform.
if (!kIsWeb) _setTargetPlatformForDesktop();
return runApp(MyApp());
}
/// If the current platform is desktop, override the default platform to
/// a supported platform (iOS for macOS, Android for Linux and Windows).
/// Otherwise, do nothing.
void _setTargetPlatformForDesktop() {
TargetPlatform targetPlatform;
if (Platform.isMacOS) {
targetPlatform = TargetPlatform.iOS;
} else if (Platform.isLinux || Platform.isWindows) {
targetPlatform = TargetPlatform.android;
}
if (targetPlatform != null) {
debugDefaultTargetPlatformOverride = targetPlatform;
}
}
class MyApp extends StatelessWidget {
final double textScaleFactor = 1.0;
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: HomeScreen(textScaleFactor: textScaleFactor),
);
}
}
class HomeScreen extends StatelessWidget {
const HomeScreen({
Key key,
@required this.textScaleFactor,
}) : super(key: key);
final double textScaleFactor;
@override
Widget build(BuildContext context) {
return ScheduledWhatsNewPage(
details: WhatsNewPage.changelog(),
delay: Duration(seconds: 7),
child: Scaffold(
body: SafeArea(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
ElevatedButton(
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),
ElevatedButton(
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,
),
);
},
),
],
),
),
),
),
);
}
}
@@ -0,0 +1,24 @@
name: flutter_whatsnew_example
description: Demonstrates how to use the flutter_whatsnew plugin.
publish_to: 'none'
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_whatsnew:
path: ../
flutter:
uses-material-design: true
assets:
- CHANGELOG.md
Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="example">
<link rel="apple-touch-icon" href="/icons/Icon-192.png">
<!-- Favicon -->
<link rel="shortcut icon" type="image/png" href="/favicon.png"/>
<title>example</title>
<link rel="manifest" href="/manifest.json">
</head>
<body>
<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register('/flutter_service_worker.js');
});
}
</script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>
@@ -0,0 +1,23 @@
{
"name": "example",
"short_name": "example",
"start_url": ".",
"display": "minimal-ui",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "A new Flutter project.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}