Started build script

This commit is contained in:
reinjens 2024-11-09 22:03:33 +01:00 committed by Jens Reinemuth
parent b96919c118
commit 9f571a8688
49 changed files with 129 additions and 45 deletions

82
build.sh Executable file
View file

@ -0,0 +1,82 @@
#!/usr/bin/env bash
function _spinner() {
# $1 start/stop
#
# on start: $2 display message
# on stop : $2 process exit status
# $3 spinner function pid (supplied from stop_spinner)
local on_success="DONE"
local on_fail="FAIL"
local white="\e[1;37m"
local green="\e[1;32m"
local red="\e[1;31m"
local nc="\e[0m"
case $1 in
start)
# calculate the column where spinner and status msg will be displayed
# shellcheck disable=SC2219
let column=$(tput cols)-${#2}-60
# display message and position the cursor in $column column
echo -ne "${2}"
printf "%${column}s"
# start spinner
i=1
sp='\|/-'
delay=${SPINNER_DELAY:-0.15}
while :
do
# shellcheck disable=SC2059
printf "\b${sp:i++%${#sp}:1}"
sleep "$delay"
done
;;
stop)
if [[ -z ${3} ]]; then
echo "spinner is not running.."
exit 1
fi
kill "$3" > /dev/null 2>&1
# inform the user uppon success or failure
echo -en "\b["
if [[ $2 -eq 0 ]]; then
echo -en "${green}${on_success}${nc}"
else
echo -en "${red}${on_fail}${nc}"
fi
echo -e "]"
;;
*)
echo "invalid argument, try {start/stop}"
exit 1
;;
esac
}
function start_spinner {
# $1 : msg to display
_spinner "start" "${1}" &
# set global spinner pid
_sp_pid=$!
disown
}
function stop_spinner {
# $1 : command exit status
_spinner "stop" $1 $_sp_pid
unset _sp_pid
}
echo '##############################################################################################'
echo '# Starting AmBiTo build...'
echo '##############################################################################################'
echo
start_spinner "Cleaning up..."
flutter clean >/dev/null 2>&1
stop_spinner "OK"

View file

@ -112,44 +112,46 @@ class ActionsPrePageState extends State<ActionsPrePage> {
appBar: AmbitoAppbar(
links: const ['dashboard', 'massnahmen'],
),
body: Center(
child: SizedBox(
width: 1152,
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
baseTheme.verticalSpacerMax,
Text(
'Maßnahmenkategorien',
textAlign: TextAlign.start,
style: baseTheme.currentThemeData.textTheme.headlineLarge
?.copyWith(
color: baseTheme.currentColorScheme.onSurface,
body: SingleChildScrollView(
child: Center(
child: SizedBox(
width: 1152,
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
baseTheme.verticalSpacerMax,
Text(
'Maßnahmenkategorien',
textAlign: TextAlign.start,
style: baseTheme.currentThemeData.textTheme.headlineLarge
?.copyWith(
color: baseTheme.currentColorScheme.onSurface,
),
),
),
baseTheme.verticalSpacerMax,
Wrap(
alignment: WrapAlignment.center,
spacing: 32,
children: cards,
),
baseTheme.verticalSpacerMax,
TextButton(
onPressed: () async {
await prefs.setString('selected_areaType', '');
await Get.toNamed('/massnahmendatenbank');
},
child: Text(
'Zeig mir alle $counterComplete Maßnahmen...',
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.blueAccent,
),
))
],
baseTheme.verticalSpacerMax,
Wrap(
alignment: WrapAlignment.center,
spacing: 32,
children: cards,
),
baseTheme.verticalSpacerMax,
TextButton(
onPressed: () async {
await prefs.setString('selected_areaType', '');
await Get.toNamed('/massnahmendatenbank');
},
child: Text(
'Zeig mir alle $counterComplete Maßnahmen...',
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Colors.blueAccent,
),
))
],
),
),
),
),

View file

@ -387,7 +387,7 @@ class DashboardPageState extends State<DashboardPage> {
elevation: 4,
surfaceTintColor: Colors.white,
child: Padding(
padding: const EdgeInsets.all(8),
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -400,7 +400,7 @@ class DashboardPageState extends State<DashboardPage> {
fontWeight: FontWeight.bold,
),
),
baseTheme.verticalSpacer,
baseTheme.verticalSpacerSmall,
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

View file

@ -974,10 +974,10 @@ packages:
dependency: "direct main"
description:
name: shared_preferences
sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051"
sha256: "95f9997ca1fb9799d494d0cb2a780fd7be075818d59f00c43832ed112b158a82"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
version: "2.3.3"
shared_preferences_android:
dependency: transitive
description:
@ -1083,10 +1083,10 @@ packages:
dependency: transitive
description:
name: sqflite
sha256: "79a297dc3cc137e758c6a4baf83342b039e5a6d2436fcdf3f96a00adaaf2ad62"
sha256: "2d7299468485dca85efeeadf5d38986909c5eb0cd71fd3db2c2f000e6c9454bb"
url: "https://pub.dev"
source: hosted
version: "2.4.0"
version: "2.4.1"
sqflite_android:
dependency: transitive
description:
@ -1107,10 +1107,10 @@ packages:
dependency: transitive
description:
name: sqflite_darwin
sha256: "769733dddf94622d5541c73e4ddc6aa7b252d865285914b6fcd54a63c4b4f027"
sha256: "96a698e2bc82bd770a4d6aab00b42396a7c63d9e33513a56945cbccb594c2474"
url: "https://pub.dev"
source: hosted
version: "2.4.1-1"
version: "2.4.1"
sqflite_platform_interface:
dependency: transitive
description: