Skip to content

Commit

Permalink
add: option to disable animations
Browse files Browse the repository at this point in the history
  • Loading branch information
harljo committed Apr 7, 2024
1 parent 070755e commit 1c8a4f2
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 4 deletions.
7 changes: 6 additions & 1 deletion lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class MessageLookup extends MessageLookupByLibrary {
"DeleteTwitterCookies": MessageLookupByLibrary.simpleMessage(
"Delete all cookies of the account"),
"about": MessageLookupByLibrary.simpleMessage("About"),
"accessibility": MessageLookupByLibrary.simpleMessage("Accessibility"),
"account": MessageLookupByLibrary.simpleMessage("Account"),
"account_suspended":
MessageLookupByLibrary.simpleMessage("Account suspended"),
Expand Down Expand Up @@ -138,6 +139,10 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Date Subscribed"),
"default_tab": MessageLookupByLibrary.simpleMessage("Default tab"),
"delete": MessageLookupByLibrary.simpleMessage("Delete"),
"disable_animations":
MessageLookupByLibrary.simpleMessage("Disable animations?"),
"disable_animations_description": MessageLookupByLibrary.simpleMessage(
"Disables animations within the app"),
"disable_screenshots":
MessageLookupByLibrary.simpleMessage("Disable screenshots"),
"disable_screenshots_hint": MessageLookupByLibrary.simpleMessage(
Expand Down Expand Up @@ -335,7 +340,7 @@ class MessageLookup extends MessageLookupByLibrary {
"should_check_for_updates_label":
MessageLookupByLibrary.simpleMessage("Check for updates"),
"show_navigation_labels":
MessageLookupByLibrary.simpleMessage(" Show navigation labels"),
MessageLookupByLibrary.simpleMessage("Show navigation labels?"),
"small": MessageLookupByLibrary.simpleMessage("Small"),
"something_broke_in_fritter":
MessageLookupByLibrary.simpleMessage("Something broke in Quacker."),
Expand Down
34 changes: 32 additions & 2 deletions lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,9 @@
"functionality_unsupported": "This functionality is no longer supported by X!",
"add_subscriptions": "Add subscriptions",
"account": "Account",
"accessibility": "Accessibility",
"disable_animations": "Disable animations?",
"disable_animations_description": "Disables animations within the app",
"browsingTweets": "Browsing Posts",
"loginNameTwitterAcc": "Username",
"passwordTwitterAcc": "Password",
Expand All @@ -421,7 +424,7 @@
"DeleteTwitterCookies": "Delete all cookies of the account",
"foryou": "For You",
"clickToShowMore": " \nClick to show more..",
"show_navigation_labels": " Show navigation labels",
"show_navigation_labels": "Show navigation labels?",
"top": "Top",
"latest": "Latest",
"people": "People"
Expand Down
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'dart:io';
import 'dart:ui';

import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/foundation.dart';
Expand Down
28 changes: 28 additions & 0 deletions lib/settings/_accessibility.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
import 'package:quacker/constants.dart';
import 'package:quacker/generated/l10n.dart';
import 'package:quacker/utils/iterables.dart';
import 'package:pref/pref.dart';

class SettingsAccessibilityFragment extends StatelessWidget {
const SettingsAccessibilityFragment({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(L10n.current.accessibility)),
body: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: ListView(children: [
PrefSwitch(
title: Text(L10n.of(context).disable_animations),
pref: optionDisableAnimations,
subtitle: Text(
L10n.of(context).disable_animations_description,
),
),
]),
),
);
}
}
9 changes: 9 additions & 0 deletions lib/settings/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:pref/pref.dart';
import 'package:quacker/generated/l10n.dart';
import 'package:quacker/settings/_about.dart';
import 'package:quacker/settings/_accessibility.dart';
import 'package:quacker/settings/_account.dart';
import 'package:quacker/settings/_data.dart';
import 'package:quacker/settings/_general.dart';
Expand Down Expand Up @@ -89,6 +90,14 @@ class _SettingsScreenState extends State<SettingsScreen> {
MaterialPageRoute(builder: (context) => const SettingsThemeFragment()),
),
),
ListTile(
title: Text(L10n.of(context).accessibility),
trailing: Icon(Icons.arrow_forward_ios),
onTap: () => Navigator.push(
context,
MaterialPageRoute(builder: (context) => const SettingsAccessibilityFragment()),
),
),
]),
ExpansionTile(
title: Text(
Expand Down

0 comments on commit 1c8a4f2

Please sign in to comment.