mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-15 08:12:28 -06:00
feat: add accessibility setting and conditionally disable animations
This commit is contained in:
@@ -35,6 +35,9 @@ class GlobalSettings with HiveObjectMixin {
|
||||
@HiveField(8, defaultValue: false)
|
||||
bool skipDocumentPreprarationOnUpload;
|
||||
|
||||
@HiveField(9, defaultValue: false)
|
||||
bool disableAnimations;
|
||||
|
||||
GlobalSettings({
|
||||
required this.preferredLocaleSubtag,
|
||||
this.preferredThemeMode = ThemeMode.system,
|
||||
@@ -45,5 +48,6 @@ class GlobalSettings with HiveObjectMixin {
|
||||
this.defaultShareType = FileDownloadType.alwaysAsk,
|
||||
this.enforceSinglePagePdfUpload = false,
|
||||
this.skipDocumentPreprarationOnUpload = false,
|
||||
this.disableAnimations = false,
|
||||
});
|
||||
}
|
||||
|
||||
20
lib/core/notifier/go_router_refresh_stream.dart
Normal file
20
lib/core/notifier/go_router_refresh_stream.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class GoRouterRefreshStream extends ChangeNotifier {
|
||||
GoRouterRefreshStream(Stream<dynamic> stream) {
|
||||
notifyListeners();
|
||||
_subscription = stream.asBroadcastStream().listen(
|
||||
(dynamic _) => notifyListeners(),
|
||||
);
|
||||
}
|
||||
|
||||
late final StreamSubscription<dynamic> _subscription;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_subscription.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:paperless_mobile/accessibility/accessibility_utils.dart';
|
||||
import 'package:paperless_mobile/core/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
@@ -24,7 +26,7 @@ class HintCard extends StatelessWidget {
|
||||
crossFadeState:
|
||||
show ? CrossFadeState.showFirst : CrossFadeState.showSecond,
|
||||
secondChild: const SizedBox.shrink(),
|
||||
duration: const Duration(milliseconds: 500),
|
||||
duration: 500.milliseconds.accessible(),
|
||||
firstChild: Card(
|
||||
elevation: elevation,
|
||||
child: Column(
|
||||
|
||||
Reference in New Issue
Block a user