我遇到的问题是,当我将应用程序上传到游戏控制台时,在之前的报告中,我总是看到覆盖整个屏幕的辅助功能警告。我的所有应用程序都会发生这种情况,即使是作为示例生成的应用程序也是如此。我已经添加了几个
Semantics()
标签,但没有解决。我什至尝试过只显示空白屏幕,如图所示。
至少,我想知道遇到此错误的人是否已成功发布其应用程序或已被拒绝。
这是我用于该屏幕的代码
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:planificat2/services/app_version_info_service.dart';
import 'package:planificat2/services/firebase_remote_config_service.dart';
import 'firebase_options.dart';
import 'package:planificat2/share_prefs/preferecias_usuario.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
//////////CRASHLYTICS
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
FlutterError.onError = (errorDetails) {
FirebaseCrashlytics.instance.recordFlutterFatalError(errorDetails);
};
// Pass all uncaught asynchronous errors that aren't handled by the Flutter framework to Crashlytics
PlatformDispatcher.instance.onError = (error, stack) {
FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
return true;
};
final prefs = Preferenciasusuario();
await prefs.initPrefs();
final remoteConfigService = FirebaseRemoteConfigService();
await remoteConfigService.initialize();
await AppVersionPackageInfo().initialize();
runApp(Semantics(label: "Test", child: const MyApp()));
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return Semantics(
label: "PlanificAT",
child: Scaffold(
appBar: AppBar(),
body: Semantics(label: "Test", child: const SizedBox()),
));
}
}
我也遇到同样的问题,一直没能解决。