feat(app): 完善播放协议搜索与空状态
This commit is contained in:
1 parent
671e0ce143
commit
ef29fc5f15
85 files changed
+2976
-768
No files matched your search
@@ -0,0 +1,27 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../config/app_config.dart';
|
||||
|
||||
/// 隐私协议公开路径,对应 `/privacy/{语言}`。
|
||||
const String legalPrivacyPath = 'privacy';
|
||||
|
||||
/// 服务条款公开路径,对应 `/terms/{语言}`。
|
||||
const String legalTermsPath = 'terms';
|
||||
|
||||
const Set<String> _legalLanguages = {'zh', 'en', 'id'};
|
||||
|
||||
/// 界面语言落到协议页支持的三种语言。其余语言用英文。
|
||||
String legalLanguageCode(Locale locale) {
|
||||
final code = locale.languageCode;
|
||||
if (_legalLanguages.contains(code)) return code;
|
||||
return 'en';
|
||||
}
|
||||
|
||||
/// 拼出当前服务器上的协议页地址。
|
||||
String legalPageUrl(String path, Locale locale) {
|
||||
final base = AppConfig.apiBaseUrl;
|
||||
final root = base.endsWith('/') ? base.substring(0, base.length - 1) : base;
|
||||
return '$root/$path/${legalLanguageCode(locale)}';
|
||||
}
|
||||
Reference in new issue
Block a user