Context
My Flutter web on mobile browsers (not on computers or emulator's browser) starts up the splash screen, following by redirecting to a new route (including usePathUrlStrategy, until here works well.
But then no matter the route and screen widget, it only shows a blank page.
Problem
Debugging the web app running on my Android Chrome via my computer's Chrome developer console via USB chrome://inspect/#devices
said:
MissingPluginException(No implementation found for method getSupportedModes on channel flutter_display_mode)
Solution
Delete code associated to that library flutter_displaymode (refresh rate of the phone screen), else use the conditional import method to not import the library incompatible with web.
Here is an example of unrelated to flutter_displaymode
, nonetheless, it could help you
// The file of your widget where you use the functionality runned only for web.
import 'logic/common/platform_specific.dart' if (dart.library.html) 'logic/common/platform_specific_web.dart';
...
PlatformSpecificImpl.setPageTitle(title);
// File `platform_specific_web.dart`. On web, it setups up the web page.
import 'dart:html' as html;
import 'platform_specific_abstract.dart';
class PlatformSpecificImpl implements PlatformSpecific {
static void setPageTitle(String title) {
html.document.title = title;
}
}
// File `platform_specific.dart`. On desktop and mobile, it does nothing.
import 'platform_specific_abstract.dart';
class PlatformSpecificImpl implements PlatformSpecific {
static void setPageTitle(String title) {}
}
// File `platform_specific_abstract.dart`
abstract class PlatformSpecific {
static void setPageTitle(String title) {}
}