feat: открытие дев-меню по 7 тапам по иконке на экране входа

This commit is contained in:
klockky
2026-06-02 16:11:18 +00:00
parent 7fbeb4b27e
commit 1d3a7306a5
+28 -4
View File
@@ -13,6 +13,7 @@ import 'select_country_screen.dart';
import 'proxy_settings_sheet.dart'; import 'proxy_settings_sheet.dart';
import 'server_settings_sheet.dart'; import 'server_settings_sheet.dart';
import '../profile/spoof_screen.dart'; import '../profile/spoof_screen.dart';
import '../profile/debug_menu_screen.dart';
import '../../widgets/custom_notification.dart'; import '../../widgets/custom_notification.dart';
import '../../widgets/adaptive_shell.dart'; import '../../widgets/adaptive_shell.dart';
import '../../../backend/api.dart'; import '../../../backend/api.dart';
@@ -34,6 +35,8 @@ class _LoginScreenState extends State<LoginScreen> {
bool _isTOSRead = false; bool _isTOSRead = false;
String? _phoneError; String? _phoneError;
Timer? _phoneErrorTimer; Timer? _phoneErrorTimer;
int _logoTapCount = 0;
Timer? _logoTapTimer;
@override @override
void initState() { void initState() {
@@ -74,6 +77,7 @@ class _LoginScreenState extends State<LoginScreen> {
@override @override
void dispose() { void dispose() {
_phoneErrorTimer?.cancel(); _phoneErrorTimer?.cancel();
_logoTapTimer?.cancel();
_phoneController.dispose(); _phoneController.dispose();
super.dispose(); super.dispose();
} }
@@ -87,6 +91,22 @@ class _LoginScreenState extends State<LoginScreen> {
} }
} }
void _onLogoTap() {
_logoTapTimer?.cancel();
_logoTapTimer = Timer(const Duration(milliseconds: 600), () {
_logoTapCount = 0;
});
_logoTapCount++;
if (_logoTapCount >= 7) {
_logoTapTimer?.cancel();
_logoTapCount = 0;
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const DebugMenuScreen()),
);
}
}
Future<void> _markTOSRead() async { Future<void> _markTOSRead() async {
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
await prefs.setBool('IsReadeTOS', true); await prefs.setBool('IsReadeTOS', true);
@@ -728,10 +748,14 @@ class _LoginScreenState extends State<LoginScreen> {
Center( Center(
child: Column( child: Column(
children: [ children: [
Image.asset( GestureDetector(
'assets/komet.png', behavior: HitTestBehavior.opaque,
height: 80, onTap: _onLogoTap,
color: cs.onSurface, child: Image.asset(
'assets/komet.png',
height: 80,
color: cs.onSurface,
),
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
Text( Text(