Skip to content

Commit

Permalink
add ui color to synced watch items
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Nov 25, 2024
1 parent 7d00d90 commit 3d83a85
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Backend/wear_bridge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:tail_app/Backend/sensors.dart';
import 'package:watch_connectivity/watch_connectivity.dart';

import '../constants.dart';
import 'Definitions/Action/base_action.dart';
import 'action_registry.dart';
import 'favorite_actions.dart';
import 'logging_wrappers.dart';

part 'wear_bridge.freezed.dart';
part 'wear_bridge.g.dart';
Expand Down Expand Up @@ -41,7 +43,6 @@ Future<bool> isReachable() {
return _watch.isReachable.catchError((e) => false).onError(
(error, stackTrace) => false,
);
;
}

Future<bool> isSupported() {
Expand All @@ -54,7 +55,6 @@ Future<bool> isPaired() {
return _watch.isPaired.catchError((e) => false).onError(
(error, stackTrace) => false,
);
;
}

Future<Map<String, dynamic>> applicationContext() {
Expand All @@ -77,7 +77,7 @@ Future<void> updateWearActions(UpdateWearActionsRef ref) async {
final List<WearActionData> favoriteMap = allActions.map((e) => WearActionData(uuid: e.uuid, name: e.name)).toList();
final List<WearTriggerData> triggersMap = triggers.map((e) => WearTriggerData(uuid: e.uuid, name: e.triggerDefinition!.name, enabled: e.enabled)).toList();

final WearData wearData = WearData(favoriteActions: favoriteMap, configuredTriggers: triggersMap);
final WearData wearData = WearData(favoriteActions: favoriteMap, configuredTriggers: triggersMap, uiColor: HiveProxy.getOrDefault(settings, appColor, defaultValue: appColorDefault));
if (await _watch.isReachable) {
await _watch.updateApplicationContext(wearData.toJson());
}
Expand All @@ -91,6 +91,7 @@ class WearData with _$WearData {
const factory WearData({
required List<WearActionData> favoriteActions,
required List<WearTriggerData> configuredTriggers,
required int uiColor,
}) = _WearData;

factory WearData.fromJson(Map<String, dynamic> json) => _$WearDataFromJson(json);
Expand Down

0 comments on commit 3d83a85

Please sign in to comment.