Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

git_info_plus

pub package

get git information from within the flutter application.

screenshot-android screenshot-ios

usage

dart

final string branchname = await gitinfo.branchname;
final datetime lastcommitdate = await gitinfo.lastcommitdate;
final string lastcommithash = await gitinfo.lastcommithash;
final string lastcommithashshort = await gitinfo.lastcommithashshort;
final string lastcommitmessage = await gitinfo.lastcommitmessage;

setup

android

you do not need to set this up.

ios

in order to use this library on ios, you have to do some settings.

1. add values in your info.plist

|key|type|value|
|gitbranchname|string|undefined|
|gitcommitdate|string|undefined|
|gitcommithash|string|undefined|
|gitcommithashshort|string|undefined|
|gitcommitmessage|string|undefined|

you can also copy and paste these lines.

	<key>gitbranchname</key>
	<string>undefined</string>
	<key>gitcommitdate</key>
	<string>undefined</string>
	<key>gitcommithash</key>
	<string>undefined</string>
	<key>gitcommithashshort</key>
	<string>undefined</string>
	<key>gitcommitmessage</key>
	<string>undefined</string>

setup-ios-1

2. enable processes info.plist file

buildsettings > processes info.plist file
change to yes

setup-ios-2

3. add run script

buildphase >

add new run script and paste these lines.

plistbuddy="/usr/libexec/plistbuddy"
infoplistfile="${temp_dir}/preprocessed-info.plist"

branchname=$(git rev-parse --abbrev-ref head)
commitdate=$(git --no-pager log -1 --format="%ai")
commithash=$(git rev-parse --short head)
commithashshort=$(git rev-parse head)
commitmessage=$(git log -1 --pretty=%s)

$plistbuddy -c "set :gitbranchname $branchname" $infoplistfile
$plistbuddy -c "set :gitcommitdate $commitdate" $infoplistfile
$plistbuddy -c "set :gitcommithash $commithash" $infoplistfile
$plistbuddy -c "set :gitcommithashshort $commithashshort" $infoplistfile
$plistbuddy -c "set :gitcommitmessage $commitmessage" $infoplistfile

setup-ios-3

4. add input files.

${temp_dir}/preprocessed-info.plist


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Comments are closed.