Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After the Flutter web build is published, accessing index.html will cause the Safari browser and other return keys to light up #3266

Open
tangbincheng opened this issue Dec 3, 2024 · 0 comments
Assignees

Comments

@tangbincheng
Copy link

tangbincheng commented Dec 3, 2024

Hello, I recently encountered an issue where after building the release version of Flutter Web, it was released to the nginx server and accessed through the Safari browser on my iPhone https://cphone.ileadtek.com/ The return button will light up, and the same phenomenon will occur when this project is embedded in the webview of a third-party app. At the same time, if I bring parameters, it will also have the same problem
I compiled using 'flutter build web - web renderer html - release'

void main() async {
  usePathUrlStrategy();
  Get.put(LocaleController());
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    Get.config(enableLog: kDebugMode);
    return OKToast(
        child: GetMaterialApp(
      title: "my title",
      navigatorKey: Get.key,
      getPages: AppPages.routes,
      navigatorObservers: [NavigatorObserver()],
      debugShowCheckedModeBanner: false,
      color: Colors.white,
      theme: ThemeData(
          primaryColor: const Color(0xFF3FAC33),
          primarySwatch: Colors.blue,
          primaryColorLight: Colors.blue,
          primaryColorDark: Colors.blue,
          brightness: Brightness.light,
          textSelectionTheme: const TextSelectionThemeData(
              cursorColor: Color(0xFF3FAC33),
              selectionColor: Color(0xFF3FAC33),
              selectionHandleColor: Color(0xFF3FAC33)),
          switchTheme: SwitchThemeData(trackOutlineColor:
              WidgetStateProperty.resolveWith<Color?>(
                  (Set<WidgetState> states) {
            return Colors.transparent;
          }))).copyWith(
        appBarTheme: ThemeData().appBarTheme.copyWith(
              elevation: 0,
              titleTextStyle:
                  const TextStyle(fontSize: 18, color: Colors.black),
              iconTheme: ThemeData().iconTheme.copyWith(
                    color: Colors.black,
                  ),
              backgroundColor: Colors.white,
              centerTitle: true,
              surfaceTintColor: Colors.transparent,
            ),
        scaffoldBackgroundColor: Colors.white,
        colorScheme: const ColorScheme.light(primary: Colors.white),
        elevatedButtonTheme: const ElevatedButtonThemeData(
            style: ButtonStyle(
                overlayColor:
                    WidgetStatePropertyAll<Color>(Colors.transparent))),
        tabBarTheme: const TabBarTheme(
            dividerHeight: 0,
            tabAlignment: TabAlignment.start,
            overlayColor: WidgetStatePropertyAll<Color>(Colors.transparent)),
      ),
      builder: EasyLoading.init(),
      locale: Get.find<LocaleController>().locale.value,
      supportedLocales: const [Locale('en', ''), Locale('zh', '')],
      localizationsDelegates: const [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate
      ],
      defaultTransition: Transition.noTransition,
      popGesture: false,
    ));
  }
}
class AppPages {
  AppPages._();

  static const initial = Routes.homePage;
  static final routes = [
    GetPage(
        name: Routes.homePage,
        page: () => const HomePage()),
    GetPage(
        name: Routes.addressBookHomePage,
        page: () => const AddressBookHomePage()),
  ];
}
class Routes {
  static const homePage = '/';
  static const addressBookHomePage = '/addressBookHomePage';
}

Reproduce
Directly accessing /, the Safari browser return key will light up

Expected behavior
I hope that when accessing the homepage, similar to the Safari browser or Android webview, the return button will not light up when loading

Screenshots
a
b

Flutter Version:
3.24.4

Getx Version:
4.6.6

Describe on which device you found the bug:
ex: iphone 11 ios verson 18.0.1

Minimal reproduce code
as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants