A Flutter widget that displays version information with optional changelog date and link. This widget is designed to be used across multiple apps to maintain consistent version display and changelog access.
- Display version information in a simple text widget
- Optionally also display the release date
- Automatic date extraction from CHANGELOG.md files
- Clickable to view the full CHANGELOG in an in-app dialogue with markdown rendering
- Customisable styling
- Fallback date support
- Custom tooltip messages
- Visual indicator for outdated version
- Network connectivity handling
- Formatted date display (DD MMM YYYY)
Add the package to you app's pubspec.yaml file:
dependencies:
version_widget: ^1.0.5Basic usage:
import 'package:version_widget/version_widget.dart';
// In your widget tree:
VersionWidget(
version: '1.0.5', // Required parameter
)With CHANGELOG support:
VersionWidget(
version: '1.0.5',
changelogUrl: 'https://raw.githubusercontent.com/anusii/version_widget/main/CHANGELOG.md',
showDate: true,
defaultDate: '20240101',
)With custom tooltip messages:
VersionWidget(
version: '1.0.5', // Required parameter
changelogUrl: 'https://github.com/anusii/version_widget/raw/main/CHANGELOG.md',
isLatestTooltip: 'Your app is up to date! Enjoy the latest features.',
notLatestTooltip: 'Version $_latestVersion is available with new features!',
)- Grey text: Version is being checked
- Blue text: Version is up to date
- Red bold text: Newer version is available
- No date shown: Internet connection unavailable
The widget expects the CHANGELOG.md file to have dates in the
following format. The important part is [1.0.5 20250101 and the
first such text found is interpreted as the latest version and
timestamp. This allows, for example, the string to be [1.0.5 20250514 fred] as a common format to attribute changes to users.
## [1.0.5 20250101]
- Initial releaseThe widget will automatically find the correct release date for the current version by matching against all version entries in the changelog.
version(required): The version string to display. Must be provided.changelogUrl(optional): URL to the CHANGELOG.md fileshowDate(optional): Whether to show the release date (defaults to true)defaultDate(optional): Default date to show if changelog cannot be fetched (format: YYYYMMDD)isLatestTooltip(optional): Custom message to show when version is latestnotLatestTooltip(optional): Custom message to show when newer version is available
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
