diff --git a/.github/workflows/build-flutter.yml b/.github/workflows/build-flutter.yml index 0a4e9b9..c3cd58d 100644 --- a/.github/workflows/build-flutter.yml +++ b/.github/workflows/build-flutter.yml @@ -52,10 +52,6 @@ jobs: cd app flutter --disable-analytics flutter pub get --enforce-lockfile - - name: Patch Packages - run: | - cd app - bash patch_pubdev.sh - name: 🤖📦 Create Android release run: | cd app diff --git a/.github/workflows/flutter-release.yml b/.github/workflows/flutter-release.yml index 362cbea..4d4e29c 100644 --- a/.github/workflows/flutter-release.yml +++ b/.github/workflows/flutter-release.yml @@ -54,10 +54,6 @@ jobs: cd app flutter --disable-analytics flutter pub get --enforce-lockfile - - name: Patch Packages - run: | - cd app - bash patch_pubdev.sh - name: 🤖📦 Create Android release run: | cd app diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d319a3..b974746 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Other changes: - Prepare for predictive back gesture +- Removed splash animation to fix adding to f-droid, see #1 +- Fixed list of used dependencies in about screen ## [0.4.2] - 2023-11-14 diff --git a/app/assets/trale_icon_extended.svg b/app/assets/trale_icon_extended.svg index 302d24b..658edcb 100644 --- a/app/assets/trale_icon_extended.svg +++ b/app/assets/trale_icon_extended.svg @@ -8,7 +8,7 @@ style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;" id="svg62" sodipodi:docname="trale_icon_extended.svg" - inkscape:version="1.2 (dc2aedaf03, 2022-05-15)" + inkscape:version="1.3 (0e150ed6c4, 2023-07-21)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" @@ -24,59 +24,40 @@ inkscape:deskcolor="#d1d1d1" showgrid="false" inkscape:zoom="0.44438203" - inkscape:cx="628.96333" - inkscape:cy="228.40708" + inkscape:cx="499.57016" + inkscape:cy="519.823" inkscape:window-width="1920" - inkscape:window-height="1139" + inkscape:window-height="1135" inkscape:window-x="26" inkscape:window-y="23" inkscape:window-maximized="0" - inkscape:current-layer="icon" /> - - - - - - - - - - - - - - - - - - - - + transform="matrix(1.37979,0,0,1.02374,-6771.4,-4924.9)" /> diff --git a/app/lib/pages/about.dart b/app/lib/pages/about.dart index fe852f9..c83d69b 100644 --- a/app/lib/pages/about.dart +++ b/app/lib/pages/about.dart @@ -100,12 +100,40 @@ final List tpls = [ // years: '2019', // ), ThirdPartyLicence( - name: 'AutoSizeText', + name: 'auto size text', url: 'https://github.com/leisim/auto_size_text', licence: 'MIT', author: 'Simon Leier', years: '2018', ), + ThirdPartyLicence( + name: 'dynamic color', + url: 'https://github.com/material-foundation/flutter-packages/tree/main/packages/dynamic_color', + licence: 'Apache', + author: 'Material Foundation', + years: '2023', + ), + ThirdPartyLicence( + name: 'file picker', + url: 'https://github.com/miguelpruivo/flutter_file_picker', + licence: 'MIT', + author: 'Miguel Ruivo', + years: '2018', + ), + ThirdPartyLicence( + name: 'fl chart', + url: 'https://github.com/imaNNeoFighT/fl_chart', + licence: 'BSD 3', + author: 'Iman Khoshabi', + years: '2019', + ), + ThirdPartyLicence( + name: 'flutter svg', + url: 'https://github.com/dnfield/flutter_svg/tree/master/packages/flutter_svg', + licence: 'MIT', + author: 'Dan Field', + years: '2018', + ), ThirdPartyLicence( name: 'font awesome flutter', url: 'https://github.com/fluttercommunity/font_awesome_flutter', @@ -113,6 +141,20 @@ final List tpls = [ author: 'Brian Egan', years: '2017', ), + ThirdPartyLicence( + name: 'hive', + url: 'https://github.com/hivedb/hive/', + licence: 'Apache', + author: 'Simon Leier', + years: '2019', + ), + ThirdPartyLicence( + name: 'hive flutter', + url: 'https://github.com/hivedb/hive_flutter/', + licence: 'Apache', + author: 'Simon Leier', + years: '2019', + ), ThirdPartyLicence( name: 'intl', url: 'https://github.com/dart-lang/intl', @@ -121,18 +163,25 @@ final List tpls = [ years: '2013', ), ThirdPartyLicence( - name: 'PackageInfo', - url: 'https://github.com/flutter/plugins/tree/master/packages/package_info', + name: 'introduction screen', + url: 'https://github.com/pyozer/introduction_screen', + licence: 'MIT', + author: 'Jean-Charles Moussé', + years: '2019', + ), + ThirdPartyLicence( + name: 'package info plus', + url: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/package_info_plus/package_info_plus', licence: 'BSD', - author: 'Flutter authors', - years: '2013', + author: 'Chromium authors', + years: '2017', ), ThirdPartyLicence( - name: 'path', - url: 'https://github.com/dart-lang/path', + name: 'path provider', + url: 'https://github.com/flutter/packages/tree/main/packages/path_provider/path_provider', licence: 'BSD', - author: 'Dart project authors', - years: '2014', + author: 'Flutter authors', + years: '2013', ), ThirdPartyLicence( name: 'provider', @@ -148,6 +197,13 @@ final List tpls = [ author: 'Flutter authors', years: '2013', ), + ThirdPartyLicence( + name: 'share plus', + url: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/share_plus/share_plus', + licence: 'BSD', + author: 'Flutter authors', + years: '2017', + ), ThirdPartyLicence( name: 'url launcher', url: 'https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher', @@ -162,41 +218,6 @@ final List tpls = [ author: 'Mark O\'Sullivan', years: '2019', ), - ThirdPartyLicence( - name: 'Flutter Slidable', - url: 'https://github.com/letsar/flutter_slidable', - licence: 'MIT', - author: 'Romain Rastel', - years: '2018', - ), - ThirdPartyLicence( - name: 'Sliding Up Panel', - url: 'https://github.com/akshathjain/sliding_up_panel', - licence: 'modified BSD', - author: 'Akshath Jain', - years: '2020', - ), - ThirdPartyLicence( - name: 'hive', - url: 'https://github.com/hivedb/hive/', - licence: 'Apache', - author: 'Simon Leier', - years: '2019', - ), - ThirdPartyLicence( - name: 'hive flutter', - url: 'https://github.com/hivedb/hive_flutter/', - licence: 'Apache', - author: 'Simon Leier', - years: '2019', - ), - ThirdPartyLicence( - name: 'fl chart', - url: 'https://github.com/imaNNeoFighT/fl_chart', - licence: 'BSD 3', - author: 'Iman Khoshabi', - years: '2019', - ), ]..sort( (ThirdPartyLicence tpl1, ThirdPartyLicence tpl2) => tpl1.name.toLowerCase().compareTo(tpl2.name.toLowerCase()) diff --git a/app/lib/pages/splash.dart b/app/lib/pages/splash.dart index fc96265..a8e6278 100644 --- a/app/lib/pages/splash.dart +++ b/app/lib/pages/splash.dart @@ -5,7 +5,6 @@ import 'package:trale/core/measurementDatabase.dart'; import 'package:trale/core/preferences.dart'; import 'package:trale/pages/home.dart'; import 'package:trale/pages/onBoarding.dart'; -import 'package:trale/widget/splashHero.dart'; /// splash scaffold @@ -54,10 +53,10 @@ class _SplashState extends State { } final Future loadMeasurements = Future( - () { + () { MeasurementDatabase().reinit(); }, - ); + ).then((_) => onStop()); return Scaffold( backgroundColor: Theme.of(context).colorScheme.background, @@ -70,7 +69,7 @@ class _SplashState extends State { child: FutureBuilder( future: loadMeasurements, builder: (BuildContext context, AsyncSnapshot snap) { - return SplashHero(onStop: onStop); + return const CircularProgressIndicator(); }, ) ), diff --git a/app/lib/widget/iconHero.dart b/app/lib/widget/iconHero.dart index a4e0a06..db34a69 100644 --- a/app/lib/widget/iconHero.dart +++ b/app/lib/widget/iconHero.dart @@ -1,6 +1,42 @@ import 'package:flutter/material.dart'; -import 'package:rive/rive.dart'; -import 'package:rive/src/rive_core/component.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + + +class TraleIconColorMapper implements ColorMapper { + const TraleIconColorMapper({ + required this.bgColor, + required this.wolfColor, + required this.titleColor, + required this.sloganColor, + }); + + static const Color _defaultBgColor = Color(0xFF44464f); + static const Color _defaultWolfColor = Color(0xFFdae2ff); + static const Color _defaultTitleColor = Color(0xFF1b1b1f); + static const Color _defaultSloganColor = Color(0xFF0161a3); + + final Color bgColor; + final Color wolfColor; + final Color titleColor; + final Color sloganColor; + + @override + Color substitute( + String? id, String elementName, String attributeName, Color color + ) { + if (color == _defaultBgColor) { + return bgColor; + } else if (color == _defaultWolfColor) { + return wolfColor; + } else if (color == _defaultTitleColor) { + return titleColor; + } else if (color == _defaultSloganColor) { + return sloganColor; + } + + return color; + } +} /// Hero with icon for drawer @@ -14,41 +50,21 @@ class IconHero extends StatefulWidget { class _IconHeroState extends State { /// path to rive file - static const String assetName = 'assets/trale.riv'; - static const String artboard = 'icon'; - static const String animation = 'idle'; + static const String assetName = 'assets/trale_icon_extended.svg'; @override Widget build(BuildContext context) { final ColorScheme ctheme = Theme.of(context).colorScheme; - - final Map colors = { - 'background': ctheme.onSurfaceVariant, - 'wolf': ctheme.primaryContainer, - 'title': ctheme.onSurface, - 'subtitle': ctheme.onSurfaceVariant, - 'slogan': ctheme.primary, - }; - - return RiveAnimation.asset( - assetName, - artboard: artboard, - animations: const [animation], - onInit: (Artboard artboard) { - artboard.forEachComponent( - (Component child) { - if (child is Shape) { - if (colors.containsKey(child.name)) { - final Shape shape = child; - if (shape.fills.isNotEmpty) { - (shape.fills.first.children[0] as SolidColor).colorValue = - colors[child.name]!.value; - } - } - } - }, - ); - }, + return SvgPicture( + SvgAssetLoader( + assetName, + colorMapper: TraleIconColorMapper( + bgColor: ctheme.onSurfaceVariant, + wolfColor: ctheme.primaryContainer, + titleColor: ctheme.onSurface, + sloganColor: ctheme.primary, + ), + ) ); } } diff --git a/app/lib/widget/splashHero.dart b/app/lib/widget/splashHero.dart deleted file mode 100644 index 2fa5a74..0000000 --- a/app/lib/widget/splashHero.dart +++ /dev/null @@ -1,82 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:rive/rive.dart'; -import 'package:rive/src/rive_core/component.dart'; - - -/// Hero with splash animation -class SplashHero extends StatefulWidget { - /// constructor - const SplashHero({Key? key, required this.onStop}) : super(key: key); - - /// function called once finished - final void Function() onStop; - - @override - State createState() => _SplashHeroState(); -} - -class _SplashHeroState extends State { - /// path to rive file - static const String assetName = 'assets/trale.riv'; - static const String artboard = 'splash'; - static const String animation = 'splash'; - - /// Controller for playback - late RiveAnimationController controller; - - @override - void initState() { - super.initState(); - controller = OneShotAnimation( - animation, - autoplay: true, - onStop: () => widget.onStop(), - ); - } - - @override - Widget build(BuildContext context) { - final ColorScheme ctheme = Theme.of(context).colorScheme; - - final Map colors = { - 'background': ctheme.onSurfaceVariant, - 'wolf': ctheme.primaryContainer, - 'background_outline': ctheme.onBackground, - 'wolf_outline': ctheme.onBackground, - 'title': ctheme.onBackground, - 'subtitle': ctheme.onSurfaceVariant, - 'bars': ctheme.onSurfaceVariant, - 'slogan': ctheme.primary, - 'poweredby': ctheme.onSurfaceVariant, - }; - - return RiveAnimation.asset( - assetName, - artboard: artboard, - controllers: [controller], - animations: const [animation], - onInit: (Artboard artboard) { - artboard.forEachComponent( - (Component child) { - if (child is Shape) { - if (colors.containsKey(child.name)) { - final Shape shape = child; - //shape.fills.first.paint.color = colors[child.name]!; - if (shape.fills.isNotEmpty) { - (shape.fills.first.children[0] as SolidColor).colorValue = - colors[child.name]!.value; - } - if (shape.strokes.isNotEmpty) { - (shape.strokes.first.children[0] as SolidColor).colorValue = - colors[child.name]!.value; - shape.strokes.first.thickness = 25; - } - } - } - }, - ); - }, - ); - } -} - diff --git a/app/patch_pubdev.sh b/app/patch_pubdev.sh deleted file mode 100644 index 2b50083..0000000 --- a/app/patch_pubdev.sh +++ /dev/null @@ -1,13 +0,0 @@ -# This file is intendet to patch packages from pub.dev -# -# Path rive_common to remove build-id -RIVE_COMMON_VERSION="$(grep -A7 -P '^..rive_common' pubspec.lock | sed -E -n -e 's/^.*version:\ "([0-9.]+)"/\1/p')" - -# get path to pub_cache directory -if [[ -v PUB_CACHE ]]; then - PUB_PATH="$PUB_CACHE" -else - PUB_PATH="$HOME/.pub-cache" -fi - -patch -N "${PUB_PATH}/hosted/pub.dev/rive_common-${RIVE_COMMON_VERSION}/premake5_rive_plugin.lua" "rive_common.patch" diff --git a/app/pubspec.lock b/app/pubspec.lock index aaad63b..36929c8 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -117,10 +117,10 @@ packages: dependency: transitive description: name: built_value - sha256: "723b4021e903217dfc445ec4cf5b42e27975aece1fc4ebbc1ca6329c2d9fb54e" + sha256: "69acb7007eb2a31dc901512bfe0f7b767168be34cb734835d54c070bfa74c1b2" url: "https://pub.dev" source: hosted - version: "8.7.0" + version: "8.8.0" characters: dependency: transitive description: @@ -269,10 +269,10 @@ packages: dependency: "direct main" description: name: fl_chart - sha256: "6b9eb2b3017241d05c482c01f668dd05cc909ec9a0114fdd49acd958ff2432fa" + sha256: "5a74434cc83bf64346efb562f1a06eefaf1bcb530dc3d96a104f631a1eff8d79" url: "https://pub.dev" source: hosted - version: "0.64.0" + version: "0.65.0" flutter: dependency: "direct main" description: flutter @@ -339,10 +339,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "3.0.1" flutter_localizations: dependency: "direct main" description: flutter @@ -356,6 +356,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.17" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c + url: "https://pub.dev" + source: hosted + version: "2.0.9" flutter_test: dependency: "direct dev" description: flutter @@ -498,10 +506,10 @@ packages: dependency: transitive description: name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "3.0.0" logging: dependency: transitive description: @@ -582,6 +590,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.8.3" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" path_provider: dependency: "direct main" description: @@ -694,22 +710,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.3" - rive: - dependency: "direct main" - description: - name: rive - sha256: fd15b219f5cc110285ebf52093b0b0f4038c3ca750f2fc5fc44d9c80a56c44f3 - url: "https://pub.dev" - source: hosted - version: "0.12.3" - rive_common: - dependency: transitive - description: - name: rive_common - sha256: f4e20d0a99c5040c85624a3eb2b0b6b19e614d93a693c3bb25cf6e7bb2d3d6d3 - url: "https://pub.dev" - source: hosted - version: "0.2.8" share_plus: dependency: "direct main" description: @@ -803,14 +803,6 @@ packages: description: flutter source: sdk version: "0.0.99" - sliding_up_panel: - dependency: "direct main" - description: - name: sliding_up_panel - sha256: "578e90956a6212d1e406373250b2436a0f3afece29aee3c24c8360094d6cf968" - url: "https://pub.dev" - source: hosted - version: "2.0.0+1" source_gen: dependency: transitive description: @@ -987,6 +979,30 @@ packages: url: "https://pub.dev" source: hosted version: "4.2.1" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "0f0c746dd2d6254a0057218ff980fc7f5670fd0fcf5e4db38a490d31eed4ad43" + url: "https://pub.dev" + source: hosted + version: "1.1.9+1" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "0edf6d630d1bfd5589114138ed8fada3234deacc37966bec033d3047c29248b7" + url: "https://pub.dev" + source: hosted + version: "1.1.9+1" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: d24333727332d9bd20990f1483af4e09abdb9b1fc7c3db940b56ab5c42790c26 + url: "https://pub.dev" + source: hosted + version: "1.1.9+1" vector_math: dependency: transitive description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 64d5f95..1518c7e 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -30,7 +30,8 @@ dependencies: auto_size_text: ^3.0.0 dynamic_color: ^1.6.8 file_picker: ^6.1.1 - fl_chart: ^0.64.0 + fl_chart: ^0.65.0 + flutter_svg: ^2.0.9 font_awesome_flutter: ^10.6.0 hive: ^2.2.3 hive_flutter: ^1.1.0 @@ -39,10 +40,8 @@ dependencies: package_info_plus: ^5.0.1 path_provider: ^2.1.1 provider: ^6.1.1 - rive: ^0.12.3 shared_preferences: ^2.2.2 share_plus: ^7.2.1 - sliding_up_panel: ^2.0.0+1 url_launcher: ^6.2.1 # The following adds the Cupertino Icons font to your application. @@ -57,7 +56,7 @@ dev_dependencies: # flutter_launcher_icons: ^0.10.0 flutter_launcher_icons: git: https://github.com/nvi9/flutter_launcher_icons.git - flutter_lints: ^2.0.3 + flutter_lints: ^3.0.1 hive_generator: ^2.0.1 translations_cleaner: ^0.0.5 @@ -92,7 +91,7 @@ flutter: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg assets: - - assets/trale.riv + - assets/trale_icon_extended.svg # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. diff --git a/app/rive_common.patch b/app/rive_common.patch deleted file mode 100644 index 83966ff..0000000 --- a/app/rive_common.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- premake5_rive_plugin.lua 2023-11-08 21:16:37.466026217 +0100 -+++ premake5_rive_plugin.lua 2023-11-08 21:36:12.735951780 +0100 -@@ -101,7 +101,8 @@ - linkoptions { - '-Oz', - '-g0', -- '-flto' -+ '-flto', -+ '--build-id=None' - } - end - filter {'system:macosx', 'options:arch=arm64'} -@@ -452,7 +453,8 @@ - linkoptions { - '-Oz', - '-g0', -- '-flto' -+ '-flto', -+ '--build-id=None' - } - end -