Add flutter-web as a platform type

Having a dedicated type for flutter-web will allow us to differentiate
between Flutter Web and Web in the Appwrite Console.
This commit is contained in:
Steven Nguyen
2023-01-11 15:47:49 -08:00
parent 514b42bea2
commit be77b10549
7 changed files with 106 additions and 10 deletions
@@ -14,6 +14,7 @@ class Origin extends Validator
public const CLIENT_TYPE_FLUTTER_MACOS = 'flutter-macos';
public const CLIENT_TYPE_FLUTTER_WINDOWS = 'flutter-windows';
public const CLIENT_TYPE_FLUTTER_LINUX = 'flutter-linux';
public const CLIENT_TYPE_FLUTTER_WEB = 'flutter-web';
public const CLIENT_TYPE_APPLE_IOS = 'apple-ios';
public const CLIENT_TYPE_APPLE_MACOS = 'apple-macos';
public const CLIENT_TYPE_APPLE_WATCHOS = 'apple-watchos';
@@ -69,6 +70,7 @@ class Origin extends Validator
switch ($type) {
case self::CLIENT_TYPE_WEB:
case self::CLIENT_TYPE_FLUTTER_WEB:
$this->clients[] = (isset($platform['hostname'])) ? $platform['hostname'] : '';
break;
@@ -43,7 +43,7 @@ class Platform extends Model
'type' => self::TYPE_STRING,
'description' => 'Platform type. Possible values are: web, flutter-ios, flutter-android, ios, android, and unity.',
'default' => '',
'example' => 'My Web App',
'example' => 'web',
])
->addRule('key', [
'type' => self::TYPE_STRING,