implemented a central haptic feedback system with configurable levels (off, reduced, full), added a Haptics facade providing semantic feedback methods, integrated haptic cues across navigation, settings toggles, and async action results, and updated version to 1.1.0+54
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'haptic_settings.g.dart';
|
||||
|
||||
enum HapticLevel { off, reduced, full }
|
||||
|
||||
@JsonSerializable()
|
||||
class HapticSettings {
|
||||
HapticLevel level;
|
||||
|
||||
HapticSettings({required this.level});
|
||||
|
||||
factory HapticSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$HapticSettingsFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$HapticSettingsToJson(this);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'haptic_settings.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
HapticSettings _$HapticSettingsFromJson(Map<String, dynamic> json) =>
|
||||
HapticSettings(level: $enumDecode(_$HapticLevelEnumMap, json['level']));
|
||||
|
||||
Map<String, dynamic> _$HapticSettingsToJson(HapticSettings instance) =>
|
||||
<String, dynamic>{'level': _$HapticLevelEnumMap[instance.level]!};
|
||||
|
||||
const _$HapticLevelEnumMap = {
|
||||
HapticLevel.off: 'off',
|
||||
HapticLevel.reduced: 'reduced',
|
||||
HapticLevel.full: 'full',
|
||||
};
|
||||
@@ -4,6 +4,7 @@ import 'package:json_annotation/json_annotation.dart';
|
||||
import 'dev_tools_settings.dart';
|
||||
import 'file_settings.dart';
|
||||
import 'file_view_settings.dart';
|
||||
import 'haptic_settings.dart';
|
||||
import 'holidays_settings.dart';
|
||||
import 'modules_settings.dart';
|
||||
import 'notification_settings.dart';
|
||||
@@ -26,6 +27,7 @@ class Settings {
|
||||
FileViewSettings fileViewSettings;
|
||||
NotificationSettings notificationSettings;
|
||||
DevToolsSettings devToolsSettings;
|
||||
HapticSettings hapticSettings;
|
||||
|
||||
Settings({
|
||||
required this.appTheme,
|
||||
@@ -38,6 +40,7 @@ class Settings {
|
||||
required this.fileViewSettings,
|
||||
required this.notificationSettings,
|
||||
required this.devToolsSettings,
|
||||
required this.hapticSettings,
|
||||
});
|
||||
|
||||
static String _themeToJson(ThemeMode m) => m.name;
|
||||
|
||||
@@ -33,6 +33,9 @@ Settings _$SettingsFromJson(Map<String, dynamic> json) => Settings(
|
||||
devToolsSettings: DevToolsSettings.fromJson(
|
||||
json['devToolsSettings'] as Map<String, dynamic>,
|
||||
),
|
||||
hapticSettings: HapticSettings.fromJson(
|
||||
json['hapticSettings'] as Map<String, dynamic>,
|
||||
),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SettingsToJson(Settings instance) => <String, dynamic>{
|
||||
@@ -46,4 +49,5 @@ Map<String, dynamic> _$SettingsToJson(Settings instance) => <String, dynamic>{
|
||||
'fileViewSettings': instance.fileViewSettings.toJson(),
|
||||
'notificationSettings': instance.notificationSettings.toJson(),
|
||||
'devToolsSettings': instance.devToolsSettings.toJson(),
|
||||
'hapticSettings': instance.hapticSettings.toJson(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user