Skip to content

Commit

Permalink
up readme
Browse files Browse the repository at this point in the history
  • Loading branch information
thl committed Apr 3, 2019
1 parent baed79a commit 1af7f81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 26 deletions.
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Flutter版 WanAndroid App.

## 项目已全部开源(V0.1.5)。欢迎Star&Fork。
本项目包含启动页,引导页,主题色,国际化,Bloc,RxDart。拥有较好的项目结构,比较规范的代码。 App拥有精致的UI界面,统一的交互,侧滑退出,列表和Web界面均提供快速滚动至顶部功能。

有关项目最新动态,可以关注App内第一条Hot Item信息。
Expand Down Expand Up @@ -323,6 +322,7 @@ ScreenUtil.getScaleSp(context, size) ;//返回根据屏幕宽适配后字体尺
// 等待Sp初始化完成。
await SpUtil.getInstance();
SpUtil.getString('key');
SpUtil.getString('key', defValue: '');
SpUtil.getInt('key', defValue: 0);
Expand Down Expand Up @@ -430,13 +430,6 @@ Email   : [email protected]
如果您觉得本项目不错的话,来个star支持下作者吧!
关于项目任何问题请提交[issues](https://github.com/Sky24n/flutter_wanandroid/issues),私发QQ邮件将不再回复~

### 绿色出行

Flutter 仿滴滴出行 [GreenTravel](https://github.com/Sky24n/GreenTravel)

<img src="https://raw.githubusercontent.com/Sky24n/LDocuments/master/AppImgs/green_travel/home.gif" width="240"> <img src="https://raw.githubusercontent.com/Sky24n/LDocuments/master/AppImgs/green_travel/home_map.gif" width="240">



[flutter_wanandroid_github]: https://github.com/Sky24n/flutter_wanandroid
[flutter_wanandroid_apk]: https://raw.githubusercontent.com/Sky24n/LDocuments/master/AppStore/flutter_wanandroid.apk
Expand Down
24 changes: 6 additions & 18 deletions lib/common/sp_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,22 @@ class SpHelper {
SpUtil.putStringList(key, value);
break;
default:
SpUtil.putString(key, value == null ? "" : json.encode(value));
SpUtil.putObject(key, value);
break;
}
}

static LanguageModel getLanguageModel() {
String _saveLanguage = SpUtil.getString(Constant.keyLanguage);
if (ObjectUtil.isNotEmpty(_saveLanguage)) {
Map userMap = json.decode(_saveLanguage);
return LanguageModel.fromJson(userMap);
}
return null;
Map map = SpUtil.getObject(Constant.keyLanguage);
return map == null ? null : LanguageModel.fromJson(map);
}

static String getThemeColor() {
String _colorKey = SpUtil.getString(Constant.KEY_THEME_COLOR);
if (ObjectUtil.isEmpty(_colorKey)) {
_colorKey = 'gray';
}
return _colorKey;
return SpUtil.getString(Constant.KEY_THEME_COLOR, defValue: 'gray');
}

static SplashModel getSplashModel() {
String _splashModel = SpUtil.getString(Constant.KEY_SPLASH_MODEL);
if (ObjectUtil.isNotEmpty(_splashModel)) {
Map userMap = json.decode(_splashModel);
return SplashModel.fromJson(userMap);
}
return null;
Map map = SpUtil.getObject(Constant.KEY_SPLASH_MODEL);
return map == null ? null : SplashModel.fromJson(map);
}
}

0 comments on commit 1af7f81

Please sign in to comment.