forked from firka/firka
Compare commits
14 Commits
dev
...
backup/dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38f2837034 | ||
|
|
b3b40b5e39 | ||
|
|
85c2576804 | ||
|
|
22d17f6969 | ||
|
|
7f09c507eb | ||
|
|
1d00505ca7 | ||
|
|
94e6a13ab7 | ||
|
|
0e65f8e68c | ||
|
|
3912ad593b | ||
|
|
1f6eaaeccc | ||
| 40f188c2e2 | |||
| 0aae3801b7 | |||
| 26902b7616 | |||
| ffaf2c77e0 |
52
build.ps1
Normal file
52
build.ps1
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
||||||
|
$ROOT = $PSScriptRoot
|
||||||
|
$SHA = (git -C $ROOT rev-parse --short HEAD)
|
||||||
|
$COMMIT_COUNT = [int](git -C $ROOT rev-list --count HEAD)
|
||||||
|
|
||||||
|
function Build-App {
|
||||||
|
param([string]$App)
|
||||||
|
|
||||||
|
$pubspec = Join-Path $ROOT $App "pubspec.yaml"
|
||||||
|
if (-not (Test-Path $pubspec)) {
|
||||||
|
Write-Error "Not found: $pubspec"
|
||||||
|
}
|
||||||
|
|
||||||
|
$versionLine = Get-Content $pubspec | Select-String -Pattern '^\s*version:\s*' | Select-Object -First 1
|
||||||
|
if (-not $versionLine) {
|
||||||
|
Write-Error "No version line in $pubspec"
|
||||||
|
}
|
||||||
|
$line = $versionLine.Line
|
||||||
|
if ($line -match '^\s*version:\s*([^+\s]+)') {
|
||||||
|
$baseVersion = $Matches[1].Trim()
|
||||||
|
} else {
|
||||||
|
Write-Error "Could not parse version from: $line"
|
||||||
|
}
|
||||||
|
|
||||||
|
$buildName = "${baseVersion}-${SHA}"
|
||||||
|
$versionCode = 2000 + $COMMIT_COUNT
|
||||||
|
if ($App -eq "firka_wear") {
|
||||||
|
$versionCode += 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Building $App : version $buildName (version code: $versionCode)"
|
||||||
|
Push-Location (Join-Path $ROOT $App)
|
||||||
|
try {
|
||||||
|
flutter pub get
|
||||||
|
dart run scripts/codegen.dart
|
||||||
|
flutter build appbundle --build-name="$buildName" --build-number="$versionCode" --verbose
|
||||||
|
} finally {
|
||||||
|
Pop-Location
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$target = if ($args.Count -gt 0) { $args[0] } else { "all" }
|
||||||
|
|
||||||
|
switch ($target) {
|
||||||
|
"firka" { Build-App firka }
|
||||||
|
"firka_wear" { Build-App firka_wear }
|
||||||
|
"all" { Build-App firka; Build-App firka_wear }
|
||||||
|
default {
|
||||||
|
Write-Error "Usage: $MyInvocation.MyCommand.Name [firka|firka_wear|all]"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_ace"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_ace_round" >
|
android:roundIcon="@mipmap/ic_ace_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_ace_f"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_ace_f_round" >
|
android:roundIcon="@mipmap/ic_ace_f_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_bi"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_bi_round" >
|
android:roundIcon="@mipmap/ic_bi_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_bi_f"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_bi_f_round" >
|
android:roundIcon="@mipmap/ic_bi_f_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_cactus"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_cactus_round" >
|
android:roundIcon="@mipmap/ic_cactus_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_cc"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_cc_round" >
|
android:roundIcon="@mipmap/ic_cc_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_enby"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_enby_round" >
|
android:roundIcon="@mipmap/ic_enby_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_enby_f"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_enby_f_round" >
|
android:roundIcon="@mipmap/ic_enby_f_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_fidesz"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_fidesz_round" >
|
android:roundIcon="@mipmap/ic_fidesz_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_filc"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_filc_round" >
|
android:roundIcon="@mipmap/ic_filc_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -180,7 +180,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_filco"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_filco_round" >
|
android:roundIcon="@mipmap/ic_filco_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -194,7 +194,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_galaxy"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_galaxy_round" >
|
android:roundIcon="@mipmap/ic_galaxy_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_gay"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_gay_round" >
|
android:roundIcon="@mipmap/ic_gay_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -222,7 +222,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_gay_f"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_gay_f_round" >
|
android:roundIcon="@mipmap/ic_gay_f_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -236,7 +236,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_half_firka_2"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_half_firka_2_round" >
|
android:roundIcon="@mipmap/ic_half_firka_2_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -250,7 +250,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_kreta"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_kreta_round" >
|
android:roundIcon="@mipmap/ic_kreta_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -264,7 +264,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_lesb"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_lesb_round" >
|
android:roundIcon="@mipmap/ic_lesb_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_lesb_f"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_lesb_f_round" >
|
android:roundIcon="@mipmap/ic_lesb_f_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -292,7 +292,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_lgbtq"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_lgbtq_round" >
|
android:roundIcon="@mipmap/ic_lgbtq_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -306,7 +306,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_lgbtq_f"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_lgbtq_f_round" >
|
android:roundIcon="@mipmap/ic_lgbtq_f_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -320,7 +320,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_lgbtqp"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_lgbtqp_round" >
|
android:roundIcon="@mipmap/ic_lgbtqp_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -334,7 +334,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_lgbtqp_f"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_lgbtqp_f_round" >
|
android:roundIcon="@mipmap/ic_lgbtqp_f_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -348,7 +348,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_lidl"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_lidl_round" >
|
android:roundIcon="@mipmap/ic_lidl_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -362,7 +362,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_mkkp"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_mkkp_round" >
|
android:roundIcon="@mipmap/ic_mkkp_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -376,7 +376,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_nuke"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_nuke_round" >
|
android:roundIcon="@mipmap/ic_nuke_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -390,7 +390,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_modern"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_modern_round" >
|
android:roundIcon="@mipmap/ic_modern_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -404,7 +404,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_o1g"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_o1g_round" >
|
android:roundIcon="@mipmap/ic_o1g_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -418,7 +418,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_old"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_old_round" >
|
android:roundIcon="@mipmap/ic_old_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -432,7 +432,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_paper"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_paper_round" >
|
android:roundIcon="@mipmap/ic_paper_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -446,7 +446,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_pear"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_pear_round" >
|
android:roundIcon="@mipmap/ic_pear_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -460,7 +460,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_pixel"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_pixel_round" >
|
android:roundIcon="@mipmap/ic_pixel_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -474,7 +474,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_pixelized"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_pixelized_round" >
|
android:roundIcon="@mipmap/ic_pixelized_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -488,7 +488,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_pride"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_pride_round" >
|
android:roundIcon="@mipmap/ic_pride_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -502,7 +502,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_proto"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_proto_round" >
|
android:roundIcon="@mipmap/ic_proto_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -516,7 +516,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_refilc"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_refilc_round" >
|
android:roundIcon="@mipmap/ic_refilc_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -530,7 +530,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_refulc"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_refulc_round" >
|
android:roundIcon="@mipmap/ic_refulc_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -544,7 +544,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_repont"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_repont_round" >
|
android:roundIcon="@mipmap/ic_repont_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -558,7 +558,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_szivacs"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_szivacs_round" >
|
android:roundIcon="@mipmap/ic_szivacs_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -572,7 +572,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_tisza"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_tisza_round" >
|
android:roundIcon="@mipmap/ic_tisza_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -586,7 +586,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_trans"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_trans_round" >
|
android:roundIcon="@mipmap/ic_trans_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -600,7 +600,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_trans_f"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_trans_f_round" >
|
android:roundIcon="@mipmap/ic_trans_f_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -614,7 +614,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_void_icon"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_void_icon_round" >
|
android:roundIcon="@mipmap/ic_void_icon_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -628,7 +628,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_xmas1"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_xmas1_round" >
|
android:roundIcon="@mipmap/ic_xmas1_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -642,7 +642,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_xmas2"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_xmas2_round" >
|
android:roundIcon="@mipmap/ic_xmas2_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -656,7 +656,7 @@
|
|||||||
android:targetActivity=".MainActivity"
|
android:targetActivity=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:icon="@mipmap/ic_xmas3"
|
android:icon="@mipmap/launcher_icon"
|
||||||
android:roundIcon="@mipmap/ic_xmas3_round" >
|
android:roundIcon="@mipmap/ic_xmas3_round" >
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|||||||
1
firka/android/app/src/main/java/org/brotli
Submodule
1
firka/android/app/src/main/java/org/brotli
Submodule
Submodule firka/android/app/src/main/java/org/brotli added at da8f329432
@@ -1,6 +1,6 @@
|
|||||||
icons:
|
icons:
|
||||||
"flutter_launcher_icons.yaml": "c600507ca0df7cebd0f708124842512a14ed3d597b779176200d6ba25b1335b1"
|
"flutter_launcher_icons.yaml": "c600507ca0df7cebd0f708124842512a14ed3d597b779176200d6ba25b1335b1"
|
||||||
"pubspec.yaml": "c84752e36ab6218d2ac824c17ffb0edb5ac4f809ab87784c9c607a0d9f525abb"
|
"pubspec.yaml": "cc5c8123f956bca34e25cec666ccc13fe5b7bdec06e217a58e1fa0ee58dedc20"
|
||||||
"assets/images/logos/colored_logo.webp": "4b4fa99d144fe6694aa4487ba1b26aeecafae41e3c877836cd7da28d61a77983"
|
"assets/images/logos/colored_logo.webp": "4b4fa99d144fe6694aa4487ba1b26aeecafae41e3c877836cd7da28d61a77983"
|
||||||
"assets/images/logos/monochrome_logo.png": "188d2b0a64c70323b09bcee721663d6698fb557066f20ddaec97bba6869c1c6c"
|
"assets/images/logos/monochrome_logo.png": "188d2b0a64c70323b09bcee721663d6698fb557066f20ddaec97bba6869c1c6c"
|
||||||
"assets/images/logos/colored_logo_without_mustache.png": "d11cff9f38985885873bfdd2d84e61f8fab03803eada94d4caac1545ef3685f3"
|
"assets/images/logos/colored_logo_without_mustache.png": "d11cff9f38985885873bfdd2d84e61f8fab03803eada94d4caac1545ef3685f3"
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import 'package:firka/core/bloc/theme_cubit.dart';
|
|||||||
import 'package:firka/core/firka_bundle.dart';
|
import 'package:firka/core/firka_bundle.dart';
|
||||||
import 'package:firka/routing/app_router.dart';
|
import 'package:firka/routing/app_router.dart';
|
||||||
import 'package:firka/services/watch_sync_helper.dart';
|
import 'package:firka/services/watch_sync_helper.dart';
|
||||||
|
import 'package:firka/ui/theme/style.dart';
|
||||||
import 'package:firka/ui/phone/pages/extras/main_wear_pair.dart';
|
import 'package:firka/ui/phone/pages/extras/main_wear_pair.dart';
|
||||||
import 'package:firka/l10n/app_localizations.dart';
|
import 'package:firka/l10n/app_localizations.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
@@ -34,6 +35,23 @@ class _InitializationScreenState extends State<InitializationScreen> {
|
|||||||
const Duration(seconds: 20),
|
const Duration(seconds: 20),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ThemeData _buildTheme(FirkaStyle style) {
|
||||||
|
return ThemeData(
|
||||||
|
scaffoldBackgroundColor: style.colors.background,
|
||||||
|
canvasColor: style.colors.background,
|
||||||
|
bottomSheetTheme: const BottomSheetThemeData(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
),
|
||||||
|
colorScheme: ColorScheme.fromSeed(
|
||||||
|
seedColor: style.colors.accent,
|
||||||
|
brightness: style.isLight ? Brightness.light : Brightness.dark,
|
||||||
|
background: style.colors.background,
|
||||||
|
surface: style.colors.card,
|
||||||
|
),
|
||||||
|
useMaterial3: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return FutureBuilder<AppInitialization>(
|
return FutureBuilder<AppInitialization>(
|
||||||
@@ -180,40 +198,47 @@ class _InitializationScreenState extends State<InitializationScreen> {
|
|||||||
BlocProvider<ReauthCubit>.value(value: reauthCubit),
|
BlocProvider<ReauthCubit>.value(value: reauthCubit),
|
||||||
BlocProvider<HomeRefreshCubit>.value(value: homeRefreshCubit),
|
BlocProvider<HomeRefreshCubit>.value(value: homeRefreshCubit),
|
||||||
],
|
],
|
||||||
child: MaterialApp.router(
|
child: BlocBuilder<ThemeCubit, ThemeState>(
|
||||||
title: 'Firka',
|
builder: (context, themeState) {
|
||||||
key: const ValueKey('firkaApp'),
|
final isLight = themeState.isLightMode;
|
||||||
routerConfig: _router!,
|
final overlay = SystemUiOverlayStyle(
|
||||||
theme: ThemeData(
|
statusBarColor: Colors.transparent,
|
||||||
primarySwatch: Colors.lightGreen,
|
statusBarIconBrightness:
|
||||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
isLight ? Brightness.dark : Brightness.light,
|
||||||
),
|
statusBarBrightness:
|
||||||
localizationsDelegates: const [
|
isLight ? Brightness.light : Brightness.dark,
|
||||||
AppLocalizations.delegate,
|
systemStatusBarContrastEnforced: false,
|
||||||
GlobalMaterialLocalizations.delegate,
|
);
|
||||||
GlobalWidgetsLocalizations.delegate,
|
|
||||||
],
|
|
||||||
supportedLocales: AppLocalizations.supportedLocales,
|
|
||||||
builder: (context, child) {
|
|
||||||
return BlocBuilder<ThemeCubit, ThemeState>(
|
|
||||||
builder: (context, themeState) {
|
|
||||||
final isLight = themeState.isLightMode;
|
|
||||||
final overlay = SystemUiOverlayStyle(
|
|
||||||
statusBarColor: Colors.transparent,
|
|
||||||
statusBarIconBrightness: isLight
|
|
||||||
? Brightness.dark
|
|
||||||
: Brightness.light,
|
|
||||||
statusBarBrightness: isLight
|
|
||||||
? Brightness.light
|
|
||||||
: Brightness.dark,
|
|
||||||
systemStatusBarContrastEnforced: false,
|
|
||||||
);
|
|
||||||
|
|
||||||
SystemChrome.setSystemUIOverlayStyle(overlay);
|
final themeMode =
|
||||||
|
isLight ? ThemeMode.light : ThemeMode.dark;
|
||||||
|
|
||||||
|
final fallbackBg = isLight
|
||||||
|
? lightStyle.colors.background
|
||||||
|
: darkStyle.colors.background;
|
||||||
|
|
||||||
|
SystemChrome.setSystemUIOverlayStyle(overlay);
|
||||||
|
|
||||||
|
return MaterialApp.router(
|
||||||
|
title: 'Firka',
|
||||||
|
key: const ValueKey('firkaApp'),
|
||||||
|
routerConfig: _router!,
|
||||||
|
theme: _buildTheme(lightStyle),
|
||||||
|
darkTheme: _buildTheme(darkStyle),
|
||||||
|
themeMode: themeMode,
|
||||||
|
localizationsDelegates: const [
|
||||||
|
AppLocalizations.delegate,
|
||||||
|
GlobalMaterialLocalizations.delegate,
|
||||||
|
GlobalWidgetsLocalizations.delegate,
|
||||||
|
],
|
||||||
|
supportedLocales: AppLocalizations.supportedLocales,
|
||||||
|
builder: (context, child) {
|
||||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||||
value: overlay,
|
value: overlay,
|
||||||
child: child ?? const SizedBox.shrink(),
|
child: ColoredBox(
|
||||||
|
color: fallbackBg,
|
||||||
|
child: child ?? const SizedBox.shrink(),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Submodule firka/lib/l10n updated: 8287ed0936...c65b8073ca
@@ -1048,9 +1048,13 @@ class _GradeCalculatorSheetContent extends StatefulWidget {
|
|||||||
class _GradeCalculatorSheetContentState
|
class _GradeCalculatorSheetContentState
|
||||||
extends State<_GradeCalculatorSheetContent> {
|
extends State<_GradeCalculatorSheetContent> {
|
||||||
int selectedGrade = 3;
|
int selectedGrade = 3;
|
||||||
int weightPercent = 100;
|
int weightIndex = 1; // 0-based index into _snapPoints
|
||||||
final List<(int grade, int weight)> entries = [];
|
final List<(int grade, int weight)> entries = [];
|
||||||
|
|
||||||
|
static const _snapPoints = [50, 100, 200, 300, 500];
|
||||||
|
|
||||||
|
int get weightPercent => _snapPoints[weightIndex];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
@@ -1184,11 +1188,12 @@ class _GradeCalculatorSheetContentState
|
|||||||
trackHeight: 8,
|
trackHeight: 8,
|
||||||
),
|
),
|
||||||
child: Slider(
|
child: Slider(
|
||||||
value: weightPercent.toDouble(),
|
value: weightIndex.toDouble(),
|
||||||
min: 1,
|
min: 0,
|
||||||
max: 500,
|
max: (_snapPoints.length - 1).toDouble(),
|
||||||
divisions: 499,
|
divisions: _snapPoints.length - 1,
|
||||||
onChanged: (v) => setState(() => weightPercent = v.round()),
|
label: '${weightPercent}%',
|
||||||
|
onChanged: (v) => setState(() => weightIndex = v.round()),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class _HomeMainScreen extends FirkaState<HomeMainScreen> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> fetchData({bool cacheOnly = true}) async {
|
Future<void> fetchData({bool cacheOnly = false}) async {
|
||||||
final midnight = now.getMidnight();
|
final midnight = now.getMidnight();
|
||||||
|
|
||||||
var lessonsFetched = 0;
|
var lessonsFetched = 0;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'dart:math' as math;
|
|||||||
import 'package:carousel_slider/carousel_slider.dart';
|
import 'package:carousel_slider/carousel_slider.dart';
|
||||||
import 'package:firka/core/firka_bundle.dart';
|
import 'package:firka/core/firka_bundle.dart';
|
||||||
import 'package:firka/app/app_state.dart';
|
import 'package:firka/app/app_state.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:firka/ui/phone/widgets/login_webview.dart';
|
import 'package:firka/ui/phone/widgets/login_webview.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
@@ -68,6 +69,7 @@ class _LoginScreenState extends FirkaState<LoginScreen> {
|
|||||||
"assets/images/carousel_dark/slide3.webp",
|
"assets/images/carousel_dark/slide3.webp",
|
||||||
"assets/images/carousel_dark/slide4.webp",
|
"assets/images/carousel_dark/slide4.webp",
|
||||||
"assets/images/logos/colored_logo.webp",
|
"assets/images/logos/colored_logo.webp",
|
||||||
|
"assets/images/logos/loading.gif",
|
||||||
];
|
];
|
||||||
try {
|
try {
|
||||||
await ImagePreloader.preloadMultipleAssets(FirkaBundle(), imagePaths);
|
await ImagePreloader.preloadMultipleAssets(FirkaBundle(), imagePaths);
|
||||||
@@ -569,6 +571,7 @@ class _FloatingCardsSlideState extends State<_FloatingCardsSlide>
|
|||||||
static const double _friction = 0.878;
|
static const double _friction = 0.878;
|
||||||
static const double _cardHeight =
|
static const double _cardHeight =
|
||||||
45; //not in pixels, idk what unit but it works :p
|
45; //not in pixels, idk what unit but it works :p
|
||||||
|
// cap speeds so impacts stay tame
|
||||||
static const double _maxSpeed = _cardHeight * 1.2;
|
static const double _maxSpeed = _cardHeight * 1.2;
|
||||||
static const double _tiltForce = 0.05;
|
static const double _tiltForce = 0.05;
|
||||||
static const double _bounceDamping = 0.45;
|
static const double _bounceDamping = 0.45;
|
||||||
@@ -644,6 +647,7 @@ class _FloatingCardsSlideState extends State<_FloatingCardsSlide>
|
|||||||
Offset? _baseline;
|
Offset? _baseline;
|
||||||
StreamSubscription<AccelerometerEvent>? _accelerometerSub;
|
StreamSubscription<AccelerometerEvent>? _accelerometerSub;
|
||||||
Duration? _lastTick;
|
Duration? _lastTick;
|
||||||
|
AccelerometerEvent? _lastAccelEvent;
|
||||||
|
|
||||||
double _sceneWidth = 0;
|
double _sceneWidth = 0;
|
||||||
double _sceneHeight = 0;
|
double _sceneHeight = 0;
|
||||||
@@ -687,6 +691,7 @@ class _FloatingCardsSlideState extends State<_FloatingCardsSlide>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _handleTilt(AccelerometerEvent event) {
|
void _handleTilt(AccelerometerEvent event) {
|
||||||
|
_lastAccelEvent = event;
|
||||||
final raw = Offset(event.x, event.y);
|
final raw = Offset(event.x, event.y);
|
||||||
_baseline ??= raw;
|
_baseline ??= raw;
|
||||||
final rel = raw - _baseline!;
|
final rel = raw - _baseline!;
|
||||||
@@ -712,6 +717,7 @@ class _FloatingCardsSlideState extends State<_FloatingCardsSlide>
|
|||||||
if (_sceneWidth == 0 || _sceneHeight == 0) return;
|
if (_sceneWidth == 0 || _sceneHeight == 0) return;
|
||||||
|
|
||||||
bool collidedThisTick = false;
|
bool collidedThisTick = false;
|
||||||
|
bool wallHitThisTick = false;
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
final slope = Offset(-_tilt.dx, _tilt.dy);
|
final slope = Offset(-_tilt.dx, _tilt.dy);
|
||||||
@@ -811,30 +817,50 @@ class _FloatingCardsSlideState extends State<_FloatingCardsSlide>
|
|||||||
double vx = _velocities[i].dx;
|
double vx = _velocities[i].dx;
|
||||||
double vy = _velocities[i].dy;
|
double vy = _velocities[i].dy;
|
||||||
|
|
||||||
|
// capture incoming velocity components before any bounce damping
|
||||||
|
final double preVx = vx;
|
||||||
|
final double preVy = vy;
|
||||||
|
double impactSpeed = 0.0; // normal to the wall
|
||||||
|
|
||||||
|
bool hit = false;
|
||||||
|
|
||||||
if (pos.dx < minX) {
|
if (pos.dx < minX) {
|
||||||
pos = Offset(minX, pos.dy);
|
pos = Offset(minX, pos.dy);
|
||||||
vx = vx.abs() * _bounceDamping;
|
vx = vx.abs() * _bounceDamping;
|
||||||
|
impactSpeed = math.max(impactSpeed, preVx.abs());
|
||||||
|
hit = true;
|
||||||
} else if (pos.dx > maxX) {
|
} else if (pos.dx > maxX) {
|
||||||
pos = Offset(maxX, pos.dy);
|
pos = Offset(maxX, pos.dy);
|
||||||
vx = -vx.abs() * _bounceDamping;
|
vx = -vx.abs() * _bounceDamping;
|
||||||
|
impactSpeed = math.max(impactSpeed, preVx.abs());
|
||||||
|
hit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pos.dy < minY) {
|
if (pos.dy < minY) {
|
||||||
pos = Offset(pos.dx, minY);
|
pos = Offset(pos.dx, minY);
|
||||||
vy = vy.abs() * _bounceDamping;
|
vy = vy.abs() * _bounceDamping;
|
||||||
|
impactSpeed = math.max(impactSpeed, preVy.abs());
|
||||||
|
hit = true;
|
||||||
} else if (pos.dy > maxY) {
|
} else if (pos.dy > maxY) {
|
||||||
pos = Offset(pos.dx, maxY);
|
pos = Offset(pos.dx, maxY);
|
||||||
vy = -vy.abs() * _bounceDamping;
|
vy = -vy.abs() * _bounceDamping;
|
||||||
|
impactSpeed = math.max(impactSpeed, preVy.abs());
|
||||||
|
hit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_velocities[i] = _clampVel(Offset(vx, vy));
|
_velocities[i] = _clampVel(Offset(vx, vy));
|
||||||
_positions[i] = pos;
|
_positions[i] = pos;
|
||||||
|
|
||||||
|
// vibrate only when the component toward the wall exceeded threshold
|
||||||
|
if (hit && impactSpeed > _vibrateSpeedThreshold) {
|
||||||
|
wallHitThisTick = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// phone mating session
|
// vibration on collisions (card-card or walls)
|
||||||
if (collidedThisTick) _maybeVibrate();
|
if (collidedThisTick || wallHitThisTick) _maybeVibrate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -896,10 +922,59 @@ class _FloatingCardsSlideState extends State<_FloatingCardsSlide>
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
if (kDebugMode) _buildDebugOverlay(center),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildDebugOverlay(Offset center) {
|
||||||
|
final firstPos = _positions.isNotEmpty ? _positions.first : Offset.zero;
|
||||||
|
final firstVel = _velocities.isNotEmpty ? _velocities.first : Offset.zero;
|
||||||
|
final accel = _lastAccelEvent;
|
||||||
|
final speed = firstVel.distance;
|
||||||
|
|
||||||
|
String formatOffset(Offset o) =>
|
||||||
|
'(${o.dx.toStringAsFixed(2)}, ${o.dy.toStringAsFixed(2)})';
|
||||||
|
|
||||||
|
return Positioned(
|
||||||
|
left: 12,
|
||||||
|
top: 12,
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.black.withOpacity(0.55),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
width: math.min(260, _sceneWidth - 24),
|
||||||
|
child: DefaultTextStyle(
|
||||||
|
style: appStyle.fonts.B_12R.copyWith(
|
||||||
|
color: Colors.white,
|
||||||
|
height: 1.25,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text('Sim Debug'),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text('tilt: ${formatOffset(_tilt)}'),
|
||||||
|
if (accel != null)
|
||||||
|
Text(
|
||||||
|
'accel: (${accel.x.toStringAsFixed(2)}, ${accel.y.toStringAsFixed(2)}, ${accel.z.toStringAsFixed(2)})',
|
||||||
|
),
|
||||||
|
Text('baseline set: ${_baseline != null}'),
|
||||||
|
Text('scene: ${_sceneWidth.toStringAsFixed(0)} x ${_sceneHeight.toStringAsFixed(0)}'),
|
||||||
|
Text('center: ${formatOffset(center)}'),
|
||||||
|
Text('card[0] pos: ${formatOffset(firstPos)}'),
|
||||||
|
Text('card[0] vel: ${formatOffset(firstVel)} | |v|=${speed.toStringAsFixed(2)}'),
|
||||||
|
Text('cards: ${_cards.length}'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// this sucks :3
|
// this sucks :3
|
||||||
|
|||||||
@@ -93,6 +93,27 @@ class _GradeChartState extends State<GradeChart> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<FlSpot> _smoothSpots(List<FlSpot> input) {
|
||||||
|
if (input.length < 3) return input;
|
||||||
|
|
||||||
|
final smoothed = <FlSpot>[];
|
||||||
|
for (var i = 0; i < input.length; i++) {
|
||||||
|
if (i == 0 || i == input.length - 1) {
|
||||||
|
smoothed.add(input[i]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
final prev = input[i - 1].y;
|
||||||
|
final curr = input[i].y;
|
||||||
|
final next = input[i + 1].y;
|
||||||
|
final blended = (0.25 * prev) + (0.5 * curr) + (0.25 * next);
|
||||||
|
|
||||||
|
smoothed.add(FlSpot(input[i].x, blended));
|
||||||
|
}
|
||||||
|
|
||||||
|
return smoothed;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didUpdateWidget(covariant GradeChart oldWidget) {
|
void didUpdateWidget(covariant GradeChart oldWidget) {
|
||||||
super.didUpdateWidget(oldWidget);
|
super.didUpdateWidget(oldWidget);
|
||||||
@@ -213,8 +234,10 @@ class _GradeChartState extends State<GradeChart> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LineChartData avgData() {
|
LineChartData avgData() {
|
||||||
var firstX = spots.first.x;
|
final smoothedSpots = _smoothSpots(spots);
|
||||||
var lastX = spots.last.x;
|
|
||||||
|
var firstX = smoothedSpots.first.x;
|
||||||
|
var lastX = smoothedSpots.last.x;
|
||||||
if (firstX == lastX) {
|
if (firstX == lastX) {
|
||||||
lastX = firstX + 1;
|
lastX = firstX + 1;
|
||||||
}
|
}
|
||||||
@@ -359,12 +382,12 @@ class _GradeChartState extends State<GradeChart> {
|
|||||||
|
|
||||||
lineBarsData: [
|
lineBarsData: [
|
||||||
LineChartBarData(
|
LineChartBarData(
|
||||||
spots: spots,
|
spots: smoothedSpots,
|
||||||
isCurved: true,
|
isCurved: true,
|
||||||
curveSmoothness: 0.35,
|
curveSmoothness: 0.5,
|
||||||
showingIndicators: _touchedIndex != null ? [_touchedIndex!] : [],
|
showingIndicators: _touchedIndex != null ? [_touchedIndex!] : [],
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
colors: [for (final s in spots) colorForY(s.y)],
|
colors: [for (final s in smoothedSpots) colorForY(s.y)],
|
||||||
),
|
),
|
||||||
barWidth: 5,
|
barWidth: 5,
|
||||||
isStrokeCapRound: true,
|
isStrokeCapRound: true,
|
||||||
@@ -373,7 +396,8 @@ class _GradeChartState extends State<GradeChart> {
|
|||||||
show: true,
|
show: true,
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
colors: [
|
colors: [
|
||||||
for (final s in spots) colorForY(s.y).withValues(alpha: 0.1),
|
for (final s in smoothedSpots)
|
||||||
|
colorForY(s.y).withValues(alpha: 0.1),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -276,15 +276,10 @@ class _LoginWebviewWidgetState extends FirkaState<LoginWebviewWidget>
|
|||||||
child: Container(
|
child: Container(
|
||||||
color: appStyle.colors.background,
|
color: appStyle.colors.background,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: SizedBox(
|
child: Image.asset(
|
||||||
width: 32,
|
"assets/images/logos/loading.gif",
|
||||||
height: 32,
|
width: 50,
|
||||||
child: CircularProgressIndicator(
|
height: 50,
|
||||||
strokeWidth: 3,
|
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
|
||||||
appStyle.colors.accent,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: firka
|
|||||||
description: "Firka, Alternatív e-Kréta kliens."
|
description: "Firka, Alternatív e-Kréta kliens."
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 1.1.0+2001
|
version: 1.1.1+2001
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.11.0
|
sdk: ^3.11.0
|
||||||
@@ -81,6 +81,7 @@ flutter:
|
|||||||
- .env
|
- .env
|
||||||
- assets/images/logos/colored_logo.webp
|
- assets/images/logos/colored_logo.webp
|
||||||
- assets/images/logos/dave.svg
|
- assets/images/logos/dave.svg
|
||||||
|
- assets/images/logos/loading.gif
|
||||||
- assets/images/carousel/
|
- assets/images/carousel/
|
||||||
- assets/images/carousel_dark/
|
- assets/images/carousel_dark/
|
||||||
- assets/images/icons/
|
- assets/images/icons/
|
||||||
|
|||||||
@@ -13,10 +13,33 @@ void main() async {
|
|||||||
|
|
||||||
if (_iconsOutOfDate(root)) {
|
if (_iconsOutOfDate(root)) {
|
||||||
final inputs = _iconsInputs(root);
|
final inputs = _iconsInputs(root);
|
||||||
stdout.writeln('Icons out of date, running flutter_launcher_icons...');
|
final manifestFile = File(p.join(root, 'android/app/src/main/AndroidManifest.xml'));
|
||||||
await _run('dart', ['run', 'flutter_launcher_icons'], root);
|
String? manifestBackup;
|
||||||
_updateLockWithHashes(root, 'icons', _computeHashes(root, inputs));
|
if (manifestFile.existsSync()) {
|
||||||
ran = true;
|
manifestBackup = manifestFile.readAsStringSync();
|
||||||
|
}
|
||||||
|
late ProcessResult iconResult;
|
||||||
|
try {
|
||||||
|
stdout.writeln('Icons out of date, running flutter_launcher_icons...');
|
||||||
|
iconResult = await Process.run(
|
||||||
|
'dart',
|
||||||
|
['run', 'flutter_launcher_icons'],
|
||||||
|
workingDirectory: root,
|
||||||
|
runInShell: true,
|
||||||
|
);
|
||||||
|
if (iconResult.exitCode == 0) {
|
||||||
|
_updateLockWithHashes(root, 'icons', _computeHashes(root, inputs));
|
||||||
|
ran = true;
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
if (manifestBackup != null) {
|
||||||
|
manifestFile.writeAsStringSync(manifestBackup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (iconResult.exitCode != 0) {
|
||||||
|
stderr.write(iconResult.stderr);
|
||||||
|
exit(iconResult.exitCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_l10nOutOfDate(root)) {
|
if (_l10nOutOfDate(root)) {
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
icons:
|
icons:
|
||||||
"flutter_launcher_icons.yaml": "2c1bf9056dfe8db94333143643d2b46308fa332e08de9eda62046a941e83aaaa"
|
"flutter_launcher_icons.yaml": "2c1bf9056dfe8db94333143643d2b46308fa332e08de9eda62046a941e83aaaa"
|
||||||
"pubspec.yaml": "6be6ac0844c8554f0e2d3eb4d60adf3debae1b29528b4cfba2023d0ccc5e33bf"
|
"pubspec.yaml": "1948fc1c2c22fbf38f60f1e5b66d71aeefb7637757b26a12619d924c792ed882"
|
||||||
"assets/images/logos/colored_logo.png": "ff9c3452b1b0ed07ffa9067fa4cf4dae45dad3e46f5cb6ef4a62ac8c05d8c080"
|
"assets/images/logos/colored_logo.png": "ff9c3452b1b0ed07ffa9067fa4cf4dae45dad3e46f5cb6ef4a62ac8c05d8c080"
|
||||||
"assets/images/logos/monochrome_logo.png": "188d2b0a64c70323b09bcee721663d6698fb557066f20ddaec97bba6869c1c6c"
|
"assets/images/logos/monochrome_logo.png": "188d2b0a64c70323b09bcee721663d6698fb557066f20ddaec97bba6869c1c6c"
|
||||||
"assets/images/logos/colored_logo_without_mustache.png": "d11cff9f38985885873bfdd2d84e61f8fab03803eada94d4caac1545ef3685f3"
|
"assets/images/logos/colored_logo_without_mustache.png": "d11cff9f38985885873bfdd2d84e61f8fab03803eada94d4caac1545ef3685f3"
|
||||||
"assets/images/logos/colored_logo_only_mustache.png": "bad6220c11bdfb1dfe04e5173bd2ebedd3999689d4b3a68fc63dc520c96dd33b"
|
"assets/images/logos/colored_logo_only_mustache.png": "bad6220c11bdfb1dfe04e5173bd2ebedd3999689d4b3a68fc63dc520c96dd33b"
|
||||||
l10n:
|
l10n:
|
||||||
"l10n.yml": "a57bc304cac4a2b0235593586f17f400a5165d67fc9aadeaa11893cfa36ee082"
|
"l10n.yml": "a57bc304cac4a2b0235593586f17f400a5165d67fc9aadeaa11893cfa36ee082"
|
||||||
"lib/l10n/app_de.arb": "55f030b312cc07ff05cdc3d6ee10ef9bdec3243b507225e9a47196444518d955"
|
"lib/l10n/app_de.arb": "4be15b38c7a86bae77d5d44eb2172c687c94255716c7103ef16418d9a3aa2856"
|
||||||
"lib/l10n/app_en.arb": "efac3f14d8ecc3e278f80a3e5aff599a88e408d2e30ff9e30f889978f465823a"
|
"lib/l10n/app_en.arb": "6ee8594c5153a1e1fe714a05ea99ed38e63a42aa74faaa1d610c8ba669d7cbbb"
|
||||||
"lib/l10n/app_hu.arb": "a7f61bf4452a639d61c350f6674fdb5fd424f9ab31a195a200d446763fa8b396"
|
"lib/l10n/app_hu.arb": "9acbf3245d9b286c6b7b20d84750313e49e9c09689e1fe60ad5623877cdbf7a6"
|
||||||
isar:
|
isar:
|
||||||
"lib/data/models/app_settings_model.dart": "2bf4d089ccfcb73edbca5b2d5757e1e698ddde2b8783d212a870aac3157fbb5b"
|
"lib/data/models/app_settings_model.dart": "2bf4d089ccfcb73edbca5b2d5757e1e698ddde2b8783d212a870aac3157fbb5b"
|
||||||
"lib/data/models/generic_cache_model.dart": "dd9979a4f0ba37ce5fd733bf0966088a759b5f356d97ea09c65eefffe8984639"
|
"lib/data/models/generic_cache_model.dart": "dd9979a4f0ba37ce5fd733bf0966088a759b5f356d97ea09c65eefffe8984639"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.1.0+2000
|
version: 1.1.1+2000
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.11.0
|
sdk: ^3.11.0
|
||||||
|
|||||||
Reference in New Issue
Block a user