open method

Future<void> open({
  1. required SettingsPage page,
  2. List<String>? uiLocales,
  3. ColorScheme? colorScheme,
  4. String? wechatRedirectURI,
})

Implementation

Future<void> open({
  required SettingsPage page,
  List<String>? uiLocales,
  ColorScheme? colorScheme,
  String? wechatRedirectURI,
}) async {
  final Map<String, String> q = {};
  final uiLocalesString = uiLocales?.join(" ") ?? "";
  if (uiLocalesString != "") {
    q["ui_locales"] = uiLocalesString;
  }
  if (colorScheme != null) {
    q["x_color_scheme"] = colorScheme.name;
  }

  final url = Uri.parse(endpoint)
      .replace(path: page.path, queryParameters: q)
      .toString();
  return openURL(url: url, wechatRedirectURI: wechatRedirectURI);
}