| 
									
										
										
										
											2023-05-23 23:55:21 +08:00
										 |  |  | import 'package:json_annotation/json_annotation.dart'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-14 13:37:13 +08:00
										 |  |  | // Run `dart run build_runner build` to generate the json serialization If the
 | 
					
						
							|  |  |  | // file `env_serde.i.dart` is existed, delete it first.
 | 
					
						
							|  |  |  | //
 | 
					
						
							| 
									
										
										
										
											2023-07-05 20:57:09 +08:00
										 |  |  | // the file `env_serde.g.dart` will be generated in the same directory. Rename
 | 
					
						
							|  |  |  | // the file to `env_serde.i.dart` because the file is ignored by default.
 | 
					
						
							|  |  |  | part 'env_serde.i.dart'; | 
					
						
							| 
									
										
										
										
											2023-05-23 23:55:21 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | @JsonSerializable() | 
					
						
							|  |  |  | class AppFlowyEnv { | 
					
						
							|  |  |  |   final SupabaseConfiguration supabase_config; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-14 13:37:13 +08:00
										 |  |  |   AppFlowyEnv({ | 
					
						
							|  |  |  |     required this.supabase_config, | 
					
						
							|  |  |  |   }); | 
					
						
							| 
									
										
										
										
											2023-05-23 23:55:21 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   factory AppFlowyEnv.fromJson(Map<String, dynamic> json) => | 
					
						
							|  |  |  |       _$AppFlowyEnvFromJson(json); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Map<String, dynamic> toJson() => _$AppFlowyEnvToJson(this); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @JsonSerializable() | 
					
						
							|  |  |  | class SupabaseConfiguration { | 
					
						
							| 
									
										
										
										
											2023-07-14 13:37:13 +08:00
										 |  |  |   /// Indicates whether the sync feature is enabled.
 | 
					
						
							|  |  |  |   final bool enable_sync; | 
					
						
							| 
									
										
										
										
											2023-05-23 23:55:21 +08:00
										 |  |  |   final String url; | 
					
						
							| 
									
										
										
										
											2023-07-29 09:46:24 +08:00
										 |  |  |   final String anon_key; | 
					
						
							| 
									
										
										
										
											2023-05-23 23:55:21 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-05 20:57:09 +08:00
										 |  |  |   SupabaseConfiguration({ | 
					
						
							| 
									
										
										
										
											2023-07-14 13:37:13 +08:00
										 |  |  |     this.enable_sync = true, | 
					
						
							| 
									
										
										
										
											2023-07-05 20:57:09 +08:00
										 |  |  |     required this.url, | 
					
						
							| 
									
										
										
										
											2023-07-29 09:46:24 +08:00
										 |  |  |     required this.anon_key, | 
					
						
							| 
									
										
										
										
											2023-07-05 20:57:09 +08:00
										 |  |  |   }); | 
					
						
							| 
									
										
										
										
											2023-05-23 23:55:21 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   factory SupabaseConfiguration.fromJson(Map<String, dynamic> json) => | 
					
						
							|  |  |  |       _$SupabaseConfigurationFromJson(json); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Map<String, dynamic> toJson() => _$SupabaseConfigurationToJson(this); | 
					
						
							|  |  |  | } |