Skip to content

Commit

Permalink
Merge pull request #7 from QuantumPhysique/removeRive
Browse files Browse the repository at this point in the history
Remove rive dependency
  • Loading branch information
braniii authored Nov 26, 2023
2 parents ea98571 + 55609ab commit 79d4563
Show file tree
Hide file tree
Showing 12 changed files with 186 additions and 278 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/build-flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/flutter-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
50 changes: 15 additions & 35 deletions app/assets/trale_icon_extended.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 65 additions & 44 deletions app/lib/pages/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,61 @@ final List<ThirdPartyLicence> tpls = <ThirdPartyLicence>[
// 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',
licence: 'MIT',
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',
Expand All @@ -121,18 +163,25 @@ final List<ThirdPartyLicence> tpls = <ThirdPartyLicence>[
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',
Expand All @@ -148,6 +197,13 @@ final List<ThirdPartyLicence> tpls = <ThirdPartyLicence>[
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',
Expand All @@ -162,41 +218,6 @@ final List<ThirdPartyLicence> tpls = <ThirdPartyLicence>[
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())
Expand Down
7 changes: 3 additions & 4 deletions app/lib/pages/splash.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -54,10 +53,10 @@ class _SplashState extends State<Splash> {
}

final Future<void> loadMeasurements = Future<void>(
() {
() {
MeasurementDatabase().reinit();
},
);
).then((_) => onStop());

return Scaffold(
backgroundColor: Theme.of(context).colorScheme.background,
Expand All @@ -70,7 +69,7 @@ class _SplashState extends State<Splash> {
child: FutureBuilder<void>(
future: loadMeasurements,
builder: (BuildContext context, AsyncSnapshot<void> snap) {
return SplashHero(onStop: onStop);
return const CircularProgressIndicator();
},
)
),
Expand Down
82 changes: 49 additions & 33 deletions app/lib/widget/iconHero.dart
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -14,41 +50,21 @@ class IconHero extends StatefulWidget {

class _IconHeroState extends State<IconHero> {
/// 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<String, Color> colors = <String, Color>{
'background': ctheme.onSurfaceVariant,
'wolf': ctheme.primaryContainer,
'title': ctheme.onSurface,
'subtitle': ctheme.onSurfaceVariant,
'slogan': ctheme.primary,
};

return RiveAnimation.asset(
assetName,
artboard: artboard,
animations: const <String>[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,
),
)
);
}
}
Expand Down
82 changes: 0 additions & 82 deletions app/lib/widget/splashHero.dart

This file was deleted.

Loading

0 comments on commit 79d4563

Please sign in to comment.