git_stamp 2.11.0
git_stamp: ^2.11.0 copied to clipboard
A tool to generate a git history that you can see when you run the application.
Git Stamp 🏷 #
Build-Time Git History Integration in Your Flutter App
Table of contents #
🏞️ Preview #
Light | Dark |
---|---|
![]() |
![]() |
🕯️ Mechanism #
graph TD
CODE((SOURCE CODE))-->SYNC(flutter pub get)
SYNC-->BUILD(flutter build ...)
subgraph "App"
CODE
PUB
PUB((PACKAGES))-->CODE
end
subgraph "Git Stamp"
GIT_CLI(GIT CLI)-->GENERATOR
DART_CLI(DART CLI)-->GENERATOR
FLUTTER_CLI(FLUTTER CLI)-->GENERATOR
end
subgraph "Git Stamp CLI"
GENERATE
ADD
end
GENERATOR((GENERATOR))-->ADD(~$ dart pub add git_stamp)
ADD-->|Add package|PUB
GENERATOR-->GENERATE(~$ dart run git_stamp)
GENERATE-->|Create ./git_stamp directory with .dart files|CODE
🛠️ Installation #
dart pub add git_stamp
or
dev_dependencies:
git_stamp: ^2.6.0
or
dependencies:
url_launcher: ^6.2.3
dev_dependencies:
git_stamp:
git:
url: https://github.com/arononak/git_stamp
ref: main
Important
Add git_stamp to .gitignore.
echo "lib/git_stamp/" >> .gitignore
.
🏗️ Generating #
CLI Command | Build type | Use url_launcher |
---|---|---|
dart run git_stamp |
LITE | DISABLED |
dart run git_stamp --buildtype full --url_launcher enabled |
FULL | ENABLED |
Caution
Generating requires the use of the git
command-line interface (CLI).
Important
If you use Github Action, you only get a single commit because GitHub Actions by default only retrieves the latest version (single commit) and does not include the full history of the repository. This is normal behavior to optimize the build process and improve performance, especially for large repositories. Try configuring github actions or generating Git Stamp files before git push
.
💻 Usage #
Default usage:
if (isProd == false) ...[
IconButton(
onPressed: () => showGitStampPage(context: context),
icon: const Icon(Icons.book),
),
],
Advanced usage:
Central GitStamp node:
class GitStamp {
static const buildBranch
static const buildDateTime
static const buildSystemInfo
static const repoCreationDate
static const diffOutput
static const isLiteVersion
static const jsonOutput
static const repoPath
static List<GitStampCommit> commitList
static GitStampCommit latestCommit;
}
Example usage:
import 'git_stamp.dart';
Text('Version: v1.2.3'),
Text('Build: 1234'),
Text('Branch: ${GitStamp.buildBranch}'),
Text('SHA: ${GitStamp.latestCommit.hash}'),
🔧 Git Stamp - Development #
Step | Description |
---|---|
🔧 Run pana command |
Check 160/160 points |
📸 New SS | Create a new screenshots |
🏷️ New tag and push | Deploy every Wednesday ! |
Package structure
📝 License #
Note
Copyright © 2024 Aron Onak. All rights reserved.
Licensed under the MIT license.
If you have any feedback, please contact me at arononak@gmail.com