|
@@ -19,7 +19,10 @@ import 'package:photos/ui/components/buttons/button_widget.dart';
|
|
import 'package:photos/ui/components/dialog_widget.dart';
|
|
import 'package:photos/ui/components/dialog_widget.dart';
|
|
import 'package:photos/ui/components/models/button_type.dart';
|
|
import 'package:photos/ui/components/models/button_type.dart';
|
|
import 'package:photos/ui/payment/subscription.dart';
|
|
import 'package:photos/ui/payment/subscription.dart';
|
|
|
|
+import "package:photos/ui/settings/developer_settings_page.dart";
|
|
|
|
+import "package:photos/ui/settings/developer_settings_widget.dart";
|
|
import "package:photos/ui/settings/language_picker.dart";
|
|
import "package:photos/ui/settings/language_picker.dart";
|
|
|
|
+import "package:photos/utils/dialog_util.dart";
|
|
import "package:photos/utils/navigation_util.dart";
|
|
import "package:photos/utils/navigation_util.dart";
|
|
|
|
|
|
class LandingPageWidget extends StatefulWidget {
|
|
class LandingPageWidget extends StatefulWidget {
|
|
@@ -30,7 +33,10 @@ class LandingPageWidget extends StatefulWidget {
|
|
}
|
|
}
|
|
|
|
|
|
class _LandingPageWidgetState extends State<LandingPageWidget> {
|
|
class _LandingPageWidgetState extends State<LandingPageWidget> {
|
|
|
|
+ static const kDeveloperModeTapCountThreshold = 7;
|
|
|
|
+
|
|
double _featureIndex = 0;
|
|
double _featureIndex = 0;
|
|
|
|
+ int _developerModeTapCount = 0;
|
|
|
|
|
|
@override
|
|
@override
|
|
void initState() {
|
|
void initState() {
|
|
@@ -40,7 +46,35 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
- return Scaffold(body: _getBody(), resizeToAvoidBottomInset: false);
|
|
|
|
|
|
+ return Scaffold(
|
|
|
|
+ body: GestureDetector(
|
|
|
|
+ onTap: () async {
|
|
|
|
+ _developerModeTapCount++;
|
|
|
|
+ if (_developerModeTapCount >= kDeveloperModeTapCountThreshold) {
|
|
|
|
+ _developerModeTapCount = 0;
|
|
|
|
+ final result = await showChoiceDialog(
|
|
|
|
+ context,
|
|
|
|
+ title: S.of(context).developerSettings,
|
|
|
|
+ firstButtonLabel: S.of(context).yes,
|
|
|
|
+ body: S.of(context).developerSettingsWarning,
|
|
|
|
+ isDismissible: false,
|
|
|
|
+ );
|
|
|
|
+ if (result?.action == ButtonAction.first) {
|
|
|
|
+ await Navigator.of(context).push(
|
|
|
|
+ MaterialPageRoute(
|
|
|
|
+ builder: (BuildContext context) {
|
|
|
|
+ return const DeveloperSettingsPage();
|
|
|
|
+ },
|
|
|
|
+ ),
|
|
|
|
+ );
|
|
|
|
+ setState(() {});
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ child: _getBody(),
|
|
|
|
+ ),
|
|
|
|
+ resizeToAvoidBottomInset: false,
|
|
|
|
+ );
|
|
}
|
|
}
|
|
|
|
|
|
Widget _getBody() {
|
|
Widget _getBody() {
|
|
@@ -131,6 +165,7 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
|
|
+ const DeveloperSettingsWidget(),
|
|
const Padding(
|
|
const Padding(
|
|
padding: EdgeInsets.all(20),
|
|
padding: EdgeInsets.all(20),
|
|
),
|
|
),
|
|
@@ -195,7 +230,9 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
|
|
// No key
|
|
// No key
|
|
if (Configuration.instance.getKeyAttributes() == null) {
|
|
if (Configuration.instance.getKeyAttributes() == null) {
|
|
// Never had a key
|
|
// Never had a key
|
|
- page = const PasswordEntryPage(mode: PasswordEntryMode.set,);
|
|
|
|
|
|
+ page = const PasswordEntryPage(
|
|
|
|
+ mode: PasswordEntryMode.set,
|
|
|
|
+ );
|
|
} else if (Configuration.instance.getKey() == null) {
|
|
} else if (Configuration.instance.getKey() == null) {
|
|
// Yet to decrypt the key
|
|
// Yet to decrypt the key
|
|
page = const PasswordReentryPage();
|
|
page = const PasswordReentryPage();
|
|
@@ -223,7 +260,9 @@ class _LandingPageWidgetState extends State<LandingPageWidget> {
|
|
// No key
|
|
// No key
|
|
if (Configuration.instance.getKeyAttributes() == null) {
|
|
if (Configuration.instance.getKeyAttributes() == null) {
|
|
// Never had a key
|
|
// Never had a key
|
|
- page = const PasswordEntryPage(mode: PasswordEntryMode.set,);
|
|
|
|
|
|
+ page = const PasswordEntryPage(
|
|
|
|
+ mode: PasswordEntryMode.set,
|
|
|
|
+ );
|
|
} else if (Configuration.instance.getKey() == null) {
|
|
} else if (Configuration.instance.getKey() == null) {
|
|
// Yet to decrypt the key
|
|
// Yet to decrypt the key
|
|
page = const PasswordReentryPage();
|
|
page = const PasswordReentryPage();
|