mirror of
https://github.com/asjqkkkk/flutter-todos.git
synced 2025-08-26 05:59:08 +08:00
🎉 One Day List 1.0.7 released!
1.🐛Fixed: some bugs had been discovered! 2.✨Add: Now you can change your background to network image in main page!It will be very beautiful!
This commit is contained in:
33
README.md
33
README.md
@ -8,7 +8,13 @@ Language:[简体中文](https://github.com/asjqkkkk/todo-list-app/blob/master/RE
|
||||
[](https://github.com/asjqkkkk/todo-list-app)
|
||||
[](https://github.com/asjqkkkk/todo-list-app/blob/master/LICENSE)
|
||||
[](https://travis-ci.org/asjqkkkk/flutter-todos)
|
||||
[](https://github.com/asjqkkkk/flutter-todos/releases/download/1.0.6/todo-list.apk)
|
||||
[](https://github.com/asjqkkkk/flutter-todos/releases/download/1.0.7/todo-list.apk)
|
||||
|
||||
|
||||
| <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65006496-c7cb6300-d935-11e9-839b-0f84c8c1b20b.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65006498-c863f980-d935-11e9-88c2-bc2308248da9.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65006501-c9952680-d935-11e9-8bc7-0f94031a9942.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65006492-c732cc80-d935-11e9-89c3-7e75df55c3d4.png"/> |
|
||||
|---|---|---|---|
|
||||
|<img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65006481-c437dc00-d935-11e9-89c5-ca82ecfad87f.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65006482-c4d07280-d935-11e9-9ae5-b84eea52febb.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65006484-c4d07280-d935-11e9-90a7-bfa99d2394d9.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65006486-c5690900-d935-11e9-9ec9-e53fa5a57d7c.png"/> |
|
||||
| <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65006487-c5690900-d935-11e9-9459-d10928aa8440.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65006488-c6019f80-d935-11e9-8751-745a22443b73.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65006489-c69a3600-d935-11e9-8d3b-ac226d54b7f9.png"/> | |
|
||||
|
||||
|
||||
|
||||
@ -27,7 +33,7 @@ For users and developers, I will introduce them separately
|
||||
Before we start, you can take a look at the demo:
|
||||
|
||||
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/63140875-f80da200-c015-11e9-8b14-60d6725620f1.gif"/>
|
||||
<img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/63140875-f80da200-c015-11e9-8b14-60d6725620f1.gif"/>
|
||||
|
||||
## Introduction to the user
|
||||
|
||||
@ -37,8 +43,9 @@ Before we start, you can take a look at the demo:
|
||||
|
||||
In the app, you can switch between the theme colors in the theme switching interface.The app comes with six default themes, which are the color combinations I've chosen over many attempts. You can also choose a custom theme color.
|
||||
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/62599499-fa3d7580-b91e-11e9-8e7a-868add28d67f.png"/>
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/62599500-fa3d7580-b91e-11e9-926d-d2e76c6e2e85.png"/>
|
||||
Change Theme | Custom Theme
|
||||
---|---
|
||||
<img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65006481-c437dc00-d935-11e9-89c5-ca82ecfad87f.png"> | <img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65006482-c4d07280-d935-11e9-9ae5-b84eea52febb.png">
|
||||
|
||||
|
||||
### Colorful Task Icons
|
||||
@ -46,8 +53,10 @@ In the app, you can switch between the theme colors in the theme switching inter
|
||||
|
||||
In the app, each task comes with an icon, and the app provides all the **Material Design** style icons that Flutter comes with. You can customize with any color.
|
||||
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/62599503-fad60c00-b91e-11e9-8984-27fd78382707.png"/>
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/62599505-fad60c00-b91e-11e9-9656-4469eeba64b6.png"/>
|
||||
Icon Setting | Custom Icon
|
||||
---|---
|
||||
<img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65006484-c4d07280-d935-11e9-90a7-bfa99d2394d9.png"> | <img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65006486-c5690900-d935-11e9-9ec9-e53fa5a57d7c.png">
|
||||
|
||||
|
||||
|
||||
### Diverse Custom Combinations
|
||||
@ -57,8 +66,10 @@ In the app, there are a number of other operations that you can customize.
|
||||
|
||||
For example, the head of the homepage slide bar displays content, of course, there are some other operations that you will experience on your own.
|
||||
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/62599506-fb6ea280-b91e-11e9-8396-86058b239f12.png"/>
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/62599509-fc073900-b91e-11e9-9535-9482e3e3dac4.png"/>
|
||||
Navigator Setting | Settings | MainPage background
|
||||
---|---|---
|
||||
<img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65006487-c5690900-d935-11e9-9459-d10928aa8440.png"> | <img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65006488-c6019f80-d935-11e9-8751-745a22443b73.png"> | <img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65006496-c7cb6300-d935-11e9-839b-0f84c8c1b20b.png">
|
||||
|
||||
|
||||
|
||||
|
||||
@ -67,7 +78,7 @@ For example, the head of the homepage slide bar displays content, of course, the
|
||||
|
||||
When you have completed a task, the task will be moved from the home page to the done list page, where you can see some additional information about the task.
|
||||
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/62599510-fc9fcf80-b91e-11e9-8479-8bd559a4ccb4.png"/>
|
||||
<img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65006489-c69a3600-d935-11e9-8d3b-ac226d54b7f9.png">
|
||||
|
||||
Then, the introduction to the user ends here.
|
||||
|
||||
@ -204,7 +215,9 @@ widgets | custom widgets
|
||||
|
||||
Android download link:
|
||||
|
||||

|
||||
|
||||
|
||||
<img width="250" height="250" src="https://user-images.githubusercontent.com/30992818/63785102-5f82f600-c922-11e9-9bd7-2f79784fca71.png"/>
|
||||
|
||||
Ios download link:
|
||||
|
||||
|
40
README_ZH.md
40
README_ZH.md
@ -8,7 +8,14 @@ Language:[简体中文](https://github.com/asjqkkkk/todo-list-app/blob/master/RE
|
||||
[](https://github.com/asjqkkkk/todo-list-app)
|
||||
[](https://github.com/asjqkkkk/todo-list-app/blob/master/LICENSE)
|
||||
[](https://travis-ci.org/asjqkkkk/flutter-todos)
|
||||
[](https://github.com/asjqkkkk/flutter-todos/releases/download/1.0.6/todo-list.apk)
|
||||
[](https://github.com/asjqkkkk/flutter-todos/releases/download/1.0.7/todo-list.apk)
|
||||
|
||||
|
||||
|
||||
| <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65004647-aebfb380-d92f-11e9-8294-f6ab9b939388.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65004648-aebfb380-d92f-11e9-9f1f-de47ec0cb649.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65004649-aebfb380-d92f-11e9-9264-5ca13dd4a9b5.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65004650-af584a00-d92f-11e9-8bd3-79490a987eb0.png"/> |
|
||||
|---|---|---|---|
|
||||
|<img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65004636-acf5f000-d92f-11e9-855c-bce2a7dff182.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65004640-ad8e8680-d92f-11e9-9111-5720178a864e.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65004641-ad8e8680-d92f-11e9-8acb-9fd444336a47.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65004642-ad8e8680-d92f-11e9-8072-398d9b996090.png"/> |
|
||||
|<img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65004644-ae271d00-d92f-11e9-875f-411467fe6811.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65004645-ae271d00-d92f-11e9-8b82-b9b7e5854b47.png"/> | <img width="150" alt="018" src="https://user-images.githubusercontent.com/30992818/65004646-ae271d00-d92f-11e9-8424-4149a15d274b.png"/> |
|
||||
|
||||
|
||||
|
||||
@ -23,7 +30,8 @@ Language:[简体中文](https://github.com/asjqkkkk/todo-list-app/blob/master/RE
|
||||
开始之前,可以先看一下demo效果
|
||||
|
||||
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/63140284-05c22800-c014-11e9-9aa1-e256b856920a.gif"/>
|
||||
<img width="200" alt="018"
|
||||
src="https://user-images.githubusercontent.com/30992818/63140284-05c22800-c014-11e9-9aa1-e256b856920a.gif"/>
|
||||
|
||||
|
||||
## 面向使用者的介绍
|
||||
@ -34,16 +42,22 @@ Language:[简体中文](https://github.com/asjqkkkk/todo-list-app/blob/master/RE
|
||||
|
||||
app中,可以在主题切换界面选择各种主题颜色进行切换,app自带六个默认主题,这些都是我经过多次尝试所调选出来的颜色搭配。同时你也可以选择自定义主题颜色。
|
||||
|
||||

|
||||

|
||||
|
||||
主题切换 | 主题自定义
|
||||
---|---
|
||||
<img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65004636-acf5f000-d92f-11e9-855c-bce2a7dff182.png"> | <img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65004640-ad8e8680-d92f-11e9-9111-5720178a864e.png">
|
||||
|
||||
|
||||
|
||||
### 丰富的任务图标
|
||||
|
||||
在app中,每项任务都会带有一个图标,而app提供了所有 Flutter 自带的 **Material design** 风格的图标,这些图标,你可以进行任意颜色的自定义
|
||||
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/62598774-032d4780-b91d-11e9-8dca-32c826c4ab9d.png"/>
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/62598775-032d4780-b91d-11e9-976f-4b6aaf55e60e.png"/>
|
||||
|
||||
新增图标 | 自定义图标
|
||||
---|---
|
||||
<img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65004641-ad8e8680-d92f-11e9-8acb-9fd444336a47.png"> | <img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65004642-ad8e8680-d92f-11e9-8072-398d9b996090.png">
|
||||
|
||||
|
||||
### 多样的自定义组合
|
||||
|
||||
@ -51,14 +65,17 @@ app中,可以在主题切换界面选择各种主题颜色进行切换,app
|
||||
|
||||
比如说主页测滑栏的头部展示内容,当然,还有一些其他的操作,就由你去自行体验了
|
||||
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/62598778-03c5de00-b91d-11e9-84aa-697d94f313a9.png"/>
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/62598780-045e7480-b91d-11e9-91c9-1887f41e13d5.png"/>
|
||||
|
||||
导航栏设置 | 所有设置 | 主页背景
|
||||
---|---|---
|
||||
<img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65004644-ae271d00-d92f-11e9-875f-411467fe6811.png"> | <img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65004645-ae271d00-d92f-11e9-8b82-b9b7e5854b47.png"> | <img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65004647-aebfb380-d92f-11e9-8294-f6ab9b939388.png">
|
||||
|
||||
|
||||
### 完成列表
|
||||
|
||||
当你完成了一项任务后,这个任务就会从主页转移到完成列表页面,在这里你可以看到任务的一些额外信息
|
||||
|
||||
<img width="250" height="500" src="https://user-images.githubusercontent.com/30992818/62598781-04f70b00-b91d-11e9-8f6f-868a886f3d21.png"/>
|
||||
<img width="200" alt="018" src="https://user-images.githubusercontent.com/30992818/65004646-ae271d00-d92f-11e9-8424-4149a15d274b.png">
|
||||
|
||||
那么,对于使用者的介绍就到这里结束
|
||||
|
||||
@ -177,6 +194,7 @@ widgets | 封装好的各种Widget
|
||||
- [x] 图标搜索功能
|
||||
- [x] 意见反馈展示墙
|
||||
- [x] 邮箱账号登录
|
||||
- [x] 主页背景可为网络图片
|
||||
- [ ] 自定义任务详情页字体大小
|
||||
- [ ] 行业相关新闻浏览界面
|
||||
- [ ] 是否展示开场动画
|
||||
@ -189,7 +207,9 @@ widgets | 封装好的各种Widget
|
||||
|
||||
Android 下载地址:
|
||||
|
||||

|
||||
|
||||
<img width="250" height="250" src="https://user-images.githubusercontent.com/30992818/63785102-5f82f600-c922-11e9-9bd7-2f79784fca71.png"/>
|
||||
|
||||
|
||||
Ios 下载地址:
|
||||
目前尚未购买一年99$的ios开发者账号,所以暂时没有。
|
||||
|
@ -8,20 +8,24 @@ class NavHeadType{
|
||||
static const String netPicture = "NetPicture";
|
||||
|
||||
|
||||
///每日壁纸的图片地址
|
||||
static const String DAILY_PIC_URL = "https://api.dujin.org/bing/1366.php";
|
||||
}
|
||||
|
||||
|
||||
///网络图片页面的图片用途
|
||||
class NetPicturesUseType{
|
||||
///用作账号页面的背景
|
||||
///用作"我的账号"页面的背景
|
||||
static const String accountBackground = "account_background";
|
||||
|
||||
///用作测滑栏的头部
|
||||
static const String navigatorHeader = NavHeadType.netPicture;
|
||||
|
||||
///用作主页的背景
|
||||
static const String mainPageBackground = "main_page_background";
|
||||
}
|
||||
|
||||
///头像页面背景类型
|
||||
///"我的账号"页面背景类型
|
||||
class AccountBGType{
|
||||
static const String defaultType = "default_account_background_type";
|
||||
static const String netPicture = "net_account_picture_type";
|
||||
|
@ -19,6 +19,7 @@ class Keys{
|
||||
static final String currentNetPicUrl = "current_net_pic_url";
|
||||
static final String currentPosition = "currentPosition";
|
||||
static final String enableWeatherShow = "enable_weather_show";
|
||||
static final String enableNetPicBgInMainPage = "enable_net_pic_bg_in_main_page";
|
||||
static final String currentUserName = "current_user_name";
|
||||
static final String lastSuggestTime = "last_suggest_time";
|
||||
static final String token = "token";
|
||||
@ -26,6 +27,7 @@ class Keys{
|
||||
static final String hasSavedDefaultIcons = "has_saved_default_icons";
|
||||
static final String currentAccountBackground = "current_account_background";
|
||||
static final String currentAccountBackgroundType = "current_account_background_type";
|
||||
static final String currentMainPageBackgroundUrl = "current_main_page_background_url";
|
||||
|
||||
|
||||
}
|
@ -142,26 +142,29 @@ class ProviderConfig {
|
||||
}
|
||||
|
||||
///重设密码页provider,可以设重设密码,也可以设是记密码
|
||||
ChangeNotifierProvider<ResetPasswordPageModel> getResetPasswordPage({bool isReset = true}){
|
||||
return ChangeNotifierProvider<ResetPasswordPageModel>(
|
||||
builder:(context) => ResetPasswordPageModel(isReset),
|
||||
child: ResetPasswordPage(),
|
||||
);
|
||||
}
|
||||
ChangeNotifierProvider<ResetPasswordPageModel> getResetPasswordPage(
|
||||
{bool isReset = true}) {
|
||||
return ChangeNotifierProvider<ResetPasswordPageModel>(
|
||||
builder: (context) => ResetPasswordPageModel(isReset),
|
||||
child: ResetPasswordPage(),
|
||||
);
|
||||
}
|
||||
|
||||
///网络图片页provider,用于设置账号页面的背景,或者侧滑栏的头部
|
||||
ChangeNotifierProvider<NetPicturesPageModel> getNetPicturesPage({@required String useType,AccountPageModel accountPageModel}){
|
||||
return ChangeNotifierProvider<NetPicturesPageModel>(
|
||||
builder:(context) => NetPicturesPageModel(useType: useType,accountPageModel: accountPageModel),
|
||||
child: NetPicturesPage(),
|
||||
);
|
||||
}
|
||||
///网络图片页provider,用于设置账号页面的背景,或者侧滑栏的头部,或者主页背景
|
||||
ChangeNotifierProvider<NetPicturesPageModel> getNetPicturesPage(
|
||||
{@required String useType, AccountPageModel accountPageModel}) {
|
||||
return ChangeNotifierProvider<NetPicturesPageModel>(
|
||||
builder: (context) => NetPicturesPageModel(
|
||||
useType: useType, accountPageModel: accountPageModel),
|
||||
child: NetPicturesPage(),
|
||||
);
|
||||
}
|
||||
|
||||
///账号页面的provider
|
||||
ChangeNotifierProvider<AccountPageModel> getAccountPage(){
|
||||
return ChangeNotifierProvider<AccountPageModel>(
|
||||
builder:(context) => AccountPageModel(),
|
||||
child: AccountPage(),
|
||||
);
|
||||
}
|
||||
///账号页面的provider
|
||||
ChangeNotifierProvider<AccountPageModel> getAccountPage() {
|
||||
return ChangeNotifierProvider<AccountPageModel>(
|
||||
builder: (context) => AccountPageModel(),
|
||||
child: AccountPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -106,6 +106,7 @@ class DemoLocalizations {
|
||||
String get cardChangeWithBg => Intl.message('Task icon color follow background', name: 'cardChangeWithBg', desc: '任务图标颜色跟随背景',);
|
||||
String get enableInfiniteScroll => Intl.message('Task card cycle slide', name: 'enableInfiniteScroll', desc: '任务卡片循环滑动',);
|
||||
String get enableWeatherShow => Intl.message('Turn on the weather', name: 'enableWeatherShow', desc: '开启天气',);
|
||||
String get enableNetPicBgInMainPage => Intl.message('Turn on the net-picture background', name: 'enableNetPicBgInMainPage', desc: '开启主页网络图片背景',);
|
||||
String get inputCurrentCity => Intl.message('input your city', name: 'inputCurrentCity', desc: '手动输入你的城市',);
|
||||
String get weatherGetWrong => Intl.message('failed to get the weather,please try again', name: 'weatherGetWrong', desc: '天气获取失败,请重新尝试',);
|
||||
String get weatherGetting => Intl.message('the weather is inquiring...', name: 'weatherGetting', desc: '天气获取中...',);
|
||||
@ -420,6 +421,13 @@ class DemoLocalizations {
|
||||
'3.新增:你可以在账号页面设置网络图片作为背景啦',
|
||||
);
|
||||
|
||||
String get version107 => Intl.message('Version:1.0.7 \n\n'
|
||||
'1.Fixed: some bugs had been discovered! \n'
|
||||
'2.Add: Now you can change your background to network image in main page!It will be very beautiful! \n', name: 'version107', desc: '版本:1.0.7 \n\n'
|
||||
'1.修复:已经发现的一些bug\n'
|
||||
'2.新增:现在可以将主页的背景更换为网络图片啦,非常漂亮哦! \n',
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
//Locale代理类
|
||||
|
@ -81,6 +81,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"emailCantBeEmpty" : MessageLookupByLibrary.simpleMessage("email cannot be empty"),
|
||||
"emailIncorrectFormat" : MessageLookupByLibrary.simpleMessage("email format is incorrect"),
|
||||
"enableInfiniteScroll" : MessageLookupByLibrary.simpleMessage("Task card cycle slide"),
|
||||
"enableNetPicBgInMainPage" : MessageLookupByLibrary.simpleMessage("Turn on the net-picture background"),
|
||||
"enableWeatherShow" : MessageLookupByLibrary.simpleMessage("Turn on the weather"),
|
||||
"endBeforeStart" : MessageLookupByLibrary.simpleMessage("The end date need be bigger than the start date."),
|
||||
"feedback" : MessageLookupByLibrary.simpleMessage("Feedback"),
|
||||
@ -196,6 +197,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"version104" : MessageLookupByLibrary.simpleMessage("Version:1.0.4 \n\n1.Fixed: Search page overflow bugs, other small bugs \n2.Add: Account System.🎉 Celebrating github Star’s number over 500! \n\nTodo: Sync task list information to the cloud \n"),
|
||||
"version105" : MessageLookupByLibrary.simpleMessage("Version:1.0.5 \n\n1.Fixed: Fix the bug that the homepage returns to log in and then returns to the homepage to create a task that cannot be refreshed \n2.Optimization: upgrade popup display timeout error \n3.Add: 🎉 Sync tasks to the cloud! Ma Ma no longer have to worry about changing my phone! 🎉 \n"),
|
||||
"version106" : MessageLookupByLibrary.simpleMessage("Version:1.0.6 \n\n1.Fixed: a lot of bugs due to the online account system. \n2.Optimization: now you can edit all icons when the icons\'s number is bigger than six \n3.Add: You can set the network image as the background on the account page. \n"),
|
||||
"version107" : MessageLookupByLibrary.simpleMessage("Version:1.0.7 \n\n1.Fixed: some bugs had been discovered! \n2.Add: Now you can change your background to network image in main page!It will be very beautiful! \n"),
|
||||
"versionDescription" : MessageLookupByLibrary.simpleMessage("Version Description"),
|
||||
"waitAMoment" : MessageLookupByLibrary.simpleMessage("please wait for a moment..."),
|
||||
"waiting" : MessageLookupByLibrary.simpleMessage("waiting..."),
|
||||
|
@ -81,6 +81,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"emailCantBeEmpty" : MessageLookupByLibrary.simpleMessage("邮箱不能为空"),
|
||||
"emailIncorrectFormat" : MessageLookupByLibrary.simpleMessage("邮箱格式不正确"),
|
||||
"enableInfiniteScroll" : MessageLookupByLibrary.simpleMessage("任务卡片循环滑动"),
|
||||
"enableNetPicBgInMainPage" : MessageLookupByLibrary.simpleMessage("开启主页网络图片背景"),
|
||||
"enableWeatherShow" : MessageLookupByLibrary.simpleMessage("开启天气"),
|
||||
"endBeforeStart" : MessageLookupByLibrary.simpleMessage("结束日期要比开始日期大才行哦"),
|
||||
"feedback" : MessageLookupByLibrary.simpleMessage("意见反馈"),
|
||||
@ -196,6 +197,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"version104" : MessageLookupByLibrary.simpleMessage("版本:1.0.4 \n\n1.修复:搜索页面的控件溢出bug、其他各种小bug \n2.新增:账号系统!🎉庆祝github Star数过500! \n\nTodo:任务列表信息同步至云端功能,麻麻再也不用担心我换手机啦\n"),
|
||||
"version105" : MessageLookupByLibrary.simpleMessage("版本:1.0.5 \n\n1.修复:从主页进入登录页登录后再进入主页后,创建task不能刷新的bug \n2.优化:升级弹窗显示timeout报错 \n3.新增:🎉任务同步至云端功能!麻麻再也不用担心我换手机啦!🎉 \n"),
|
||||
"version106" : MessageLookupByLibrary.simpleMessage("版本:1.0.6 \n\n1.修复:大量因为上线账号系统,而新增的bug \n2.优化:当自定义图标数量不低于6个的时候,你可以任意编辑图标啦 \n3.新增:你可以在账号页面设置网络图片作为背景啦 \n"),
|
||||
"version107" : MessageLookupByLibrary.simpleMessage("版本:1.0.7 \n\n1.修复:已经发现的一些bug\n2.新增:现在可以将主页的背景更换为网络图片啦,非常漂亮哦! \n"),
|
||||
"versionDescription" : MessageLookupByLibrary.simpleMessage("版本描述"),
|
||||
"waitAMoment" : MessageLookupByLibrary.simpleMessage("请稍后..."),
|
||||
"waiting" : MessageLookupByLibrary.simpleMessage("请稍后..."),
|
||||
|
@ -80,7 +80,7 @@ class AccountPageLogic{
|
||||
}
|
||||
|
||||
void onBackgroundTap(){
|
||||
Navigator.of(_model.context).push(new MaterialPageRoute(builder: (ctx) {
|
||||
Navigator.of(_model.context).push(new CupertinoPageRoute(builder: (ctx) {
|
||||
return ProviderConfig.getInstance().getNetPicturesPage(
|
||||
useType: NetPicturesUseType.accountBackground,
|
||||
accountPageModel: _model,
|
||||
|
@ -46,6 +46,7 @@ class GlobalLogic{
|
||||
return themeType == MyTheme.darkTheme ? Colors.white : Colors.black;
|
||||
}
|
||||
|
||||
///获取当前的语言code
|
||||
Future getCurrentLanguageCode() async{
|
||||
final list = await SharedUtil.instance.getStringList(Keys.currentLanguageCode);
|
||||
if (list == null) return;
|
||||
@ -53,6 +54,7 @@ class GlobalLogic{
|
||||
_model.currentLanguageCode = list;
|
||||
}
|
||||
|
||||
///获取当前的语言
|
||||
Future getCurrentLanguage() async{
|
||||
final currentLanguage = await SharedUtil.instance.getString(Keys.currentLanguage);
|
||||
if (currentLanguage == null) return;
|
||||
@ -60,6 +62,7 @@ class GlobalLogic{
|
||||
_model.currentLanguage = currentLanguage;
|
||||
}
|
||||
|
||||
///获取当前的主题数据
|
||||
Future getCurrentTheme() async{
|
||||
final theme = await SharedUtil.instance.getString(Keys.currentThemeBean);
|
||||
if(theme == null) return;
|
||||
@ -68,6 +71,7 @@ class GlobalLogic{
|
||||
_model.currentThemeBean = themeBean;
|
||||
}
|
||||
|
||||
///获取app的名字
|
||||
Future getAppName() async{
|
||||
final appName = await SharedUtil.instance.getString(Keys.appName);
|
||||
if(appName == null) return;
|
||||
@ -76,6 +80,7 @@ class GlobalLogic{
|
||||
}
|
||||
|
||||
|
||||
///是否开启背景渐变
|
||||
Future getIsBgGradient()async{
|
||||
final isBgGradient = await SharedUtil.instance.getBoolean(Keys.backgroundGradient);
|
||||
if(isBgGradient == null) return;
|
||||
@ -83,6 +88,7 @@ class GlobalLogic{
|
||||
_model.isBgGradient = isBgGradient;
|
||||
}
|
||||
|
||||
///获取导航栏的类型
|
||||
Future getCurrentNavHeader()async{
|
||||
final currentNavHeader = await SharedUtil.instance.getString(Keys.currentNavHeader);
|
||||
if(currentNavHeader == null) return;
|
||||
@ -90,6 +96,7 @@ class GlobalLogic{
|
||||
_model.currentNavHeader = currentNavHeader;
|
||||
}
|
||||
|
||||
///获取当前导航栏头部选择网络图片时的图片地址
|
||||
Future getCurrentNetPicUrl()async{
|
||||
final currentNetPicUrl = await SharedUtil.instance.getString(Keys.currentNetPicUrl);
|
||||
if(currentNetPicUrl == null) return;
|
||||
@ -97,27 +104,25 @@ class GlobalLogic{
|
||||
_model.currentNetPicUrl = currentNetPicUrl;
|
||||
}
|
||||
|
||||
///是否开启主页背景跟随任务卡片颜色
|
||||
Future getIsBgChangeWithCard() async {
|
||||
final isBgChangeWithCard = await SharedUtil.instance.getBoolean(Keys.backgroundChangeWithCard);
|
||||
if(isBgChangeWithCard == null) return;
|
||||
if(isBgChangeWithCard == _model.isBgChangeWithCard) return;
|
||||
_model.isBgChangeWithCard = isBgChangeWithCard;
|
||||
}
|
||||
|
||||
///是否开启任务卡片颜色跟随背景
|
||||
Future getIsCardChangeWithBg() async {
|
||||
final isCardChangeWithBg = await SharedUtil.instance.getBoolean(Keys.cardChangeWithBackground);
|
||||
if(isCardChangeWithBg == null) return;
|
||||
if(isCardChangeWithBg == _model.isCardChangeWithBg) return;
|
||||
_model.isCardChangeWithBg = isCardChangeWithBg;
|
||||
}
|
||||
|
||||
///是否开启主页的卡片左右无限循环
|
||||
Future getEnableInfiniteScroll() async{
|
||||
final enableInfiniteScroll = await SharedUtil.instance.getBoolean(Keys.enableInfiniteScroll);
|
||||
if(enableInfiniteScroll == null) return;
|
||||
if(enableInfiniteScroll == _model.enableInfiniteScroll) return;
|
||||
_model.enableInfiniteScroll = enableInfiniteScroll;
|
||||
}
|
||||
|
||||
///获取当前的位置,拿到天气
|
||||
Future getCurrentPosition() async{
|
||||
final currentPosition = await SharedUtil.instance.getString(Keys.currentPosition);
|
||||
if(currentPosition == null) return;
|
||||
@ -125,10 +130,9 @@ class GlobalLogic{
|
||||
_model.currentPosition = currentPosition;
|
||||
}
|
||||
|
||||
///是否开启天气
|
||||
Future getEnableWeatherShow() async{
|
||||
final enableWeatherShow = await SharedUtil.instance.getBoolean(Keys.enableWeatherShow);
|
||||
if(enableWeatherShow == null) return;
|
||||
if(enableWeatherShow == _model.enableWeatherShow) return;
|
||||
_model.enableWeatherShow = enableWeatherShow;
|
||||
}
|
||||
|
||||
@ -138,6 +142,20 @@ class GlobalLogic{
|
||||
_model.goToLogin = !hasLogged;
|
||||
}
|
||||
|
||||
///是否开启主页背景为网络图片
|
||||
Future getEnableNetPicBgInMainPage() async{
|
||||
final enableNetPicBgInMainPage = await SharedUtil.instance.getBoolean(Keys.enableNetPicBgInMainPage);
|
||||
_model.enableNetPicBgInMainPage = enableNetPicBgInMainPage;
|
||||
}
|
||||
|
||||
///获取当前主页背景图片的url
|
||||
Future getCurrentMainPageBgUrl() async{
|
||||
final currentMainPageBgUrl = await SharedUtil.instance.getString(Keys.currentMainPageBackgroundUrl);
|
||||
if(currentMainPageBgUrl == null) return;
|
||||
if(currentMainPageBgUrl == _model.currentMainPageBgUrl) return;
|
||||
_model.currentMainPageBgUrl = currentMainPageBgUrl;
|
||||
}
|
||||
|
||||
void getWeatherNow(String position,{BuildContext context, LoadingController controller}){
|
||||
ApiService.instance.getWeatherNow(success : (WeatherBean weatherBean){
|
||||
_model.weatherBean = weatherBean;
|
||||
|
@ -3,6 +3,7 @@ import 'dart:math';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:todo_list/config/all_types.dart';
|
||||
import 'package:todo_list/config/api_service.dart';
|
||||
import 'package:todo_list/config/api_strategy.dart';
|
||||
import 'package:todo_list/config/provider_config.dart';
|
||||
@ -22,7 +23,7 @@ import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:todo_list/widgets/net_loading_widget.dart';
|
||||
import 'package:todo_list/widgets/update_dialog.dart';
|
||||
import 'package:package_info/package_info.dart';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
|
||||
class MainPageLogic {
|
||||
final MainPageModel _model;
|
||||
@ -91,15 +92,23 @@ class MainPageLogic {
|
||||
Decoration getBackground(GlobalModel globalModel) {
|
||||
bool isBgGradient = globalModel.isBgGradient;
|
||||
bool isBgChangeWithCard = globalModel.isBgChangeWithCard;
|
||||
return BoxDecoration(
|
||||
gradient: isBgGradient
|
||||
? LinearGradient(
|
||||
colors: _getGradientColors(isBgChangeWithCard),
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter)
|
||||
: null,
|
||||
color: _getBgColor(isBgGradient, isBgChangeWithCard),
|
||||
);
|
||||
bool enableBg = globalModel.enableNetPicBgInMainPage;
|
||||
return enableBg
|
||||
? BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: CachedNetworkImageProvider(
|
||||
globalModel.currentMainPageBgUrl),
|
||||
fit: BoxFit.cover,
|
||||
))
|
||||
: BoxDecoration(
|
||||
gradient: isBgGradient
|
||||
? LinearGradient(
|
||||
colors: _getGradientColors(isBgChangeWithCard),
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter)
|
||||
: null,
|
||||
color: _getBgColor(isBgGradient, isBgChangeWithCard),
|
||||
);
|
||||
}
|
||||
|
||||
List<Color> _getGradientColors(bool isBgChangeWithCard) {
|
||||
@ -138,18 +147,21 @@ class MainPageLogic {
|
||||
return ColorBean.fromBean(_model.tasks[index].taskIconBean.colorBean);
|
||||
}
|
||||
|
||||
void deleteTask(TaskBean taskBean) async{
|
||||
final account = await SharedUtil.instance.getString(Keys.account) ?? 'default';
|
||||
if(account == "defalut"){
|
||||
void deleteTask(TaskBean taskBean) async {
|
||||
final account =
|
||||
await SharedUtil.instance.getString(Keys.account) ?? 'default';
|
||||
if (account == "defalut") {
|
||||
_deleteDataBaseTask(taskBean);
|
||||
} else {
|
||||
if(taskBean.uniqueId == null){
|
||||
if (taskBean.uniqueId == null) {
|
||||
_deleteDataBaseTask(taskBean);
|
||||
} else {
|
||||
final token = await SharedUtil.instance.getString(Keys.token);
|
||||
showDialog(context: _model.context, builder: (ctx){
|
||||
return NetLoadingWidget();
|
||||
});
|
||||
showDialog(
|
||||
context: _model.context,
|
||||
builder: (ctx) {
|
||||
return NetLoadingWidget();
|
||||
});
|
||||
ApiService.instance.postDeleteTask(
|
||||
success: (CommonBean bean) {
|
||||
Navigator.of(_model.context).pop();
|
||||
@ -157,7 +169,7 @@ class MainPageLogic {
|
||||
},
|
||||
failed: (CommonBean bean) {
|
||||
Navigator.of(_model.context).pop();
|
||||
if(bean.description.contains("任务不存在")){
|
||||
if (bean.description.contains("任务不存在")) {
|
||||
_deleteDataBaseTask(taskBean);
|
||||
} else {
|
||||
_showTextDialog(bean.description);
|
||||
@ -218,6 +230,7 @@ class MainPageLogic {
|
||||
///无论是网络头像还是asset头像,最后将转换为本地文件头像
|
||||
Future getCurrentAvatar() async {
|
||||
switch (_model.currentAvatarType) {
|
||||
|
||||
///头像为默认头像的时候,将asset转换为file,方便imageCrop与之后的suggestion直接用到file
|
||||
case CurrentAvatarType.defaultAvatar:
|
||||
final path = await FileUtil.getInstance()
|
||||
@ -245,11 +258,12 @@ class MainPageLogic {
|
||||
url: net,
|
||||
filePath: "/avatar/",
|
||||
fileName: net.split('/').last ?? "avatar.png",
|
||||
onComplete: (path){
|
||||
onComplete: (path) {
|
||||
_model.currentAvatarUrl = path;
|
||||
_model.currentAvatarType = CurrentAvatarType.local;
|
||||
SharedUtil().saveString(Keys.localAvatarPath, path);
|
||||
SharedUtil().saveInt(Keys.currentAvatarType, CurrentAvatarType.local);
|
||||
SharedUtil()
|
||||
.saveInt(Keys.currentAvatarType, CurrentAvatarType.local);
|
||||
_model.refresh();
|
||||
},
|
||||
);
|
||||
@ -257,8 +271,6 @@ class MainPageLogic {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Widget getAvatarWidget() {
|
||||
switch (_model.currentAvatarType) {
|
||||
case CurrentAvatarType.defaultAvatar:
|
||||
@ -279,15 +291,16 @@ class MainPageLogic {
|
||||
height: 60,
|
||||
width: 60,
|
||||
child: CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation(Theme.of(_model.context).primaryColorLight),
|
||||
valueColor: AlwaysStoppedAnimation(
|
||||
Theme.of(_model.context).primaryColorLight),
|
||||
),
|
||||
);
|
||||
break;
|
||||
}
|
||||
return Image.asset(
|
||||
"images/icon.png",
|
||||
fit: BoxFit.cover,
|
||||
);
|
||||
"images/icon.png",
|
||||
fit: BoxFit.cover,
|
||||
);
|
||||
}
|
||||
|
||||
Future getAvatarType() async {
|
||||
@ -317,18 +330,20 @@ class MainPageLogic {
|
||||
_model.currentEditingUserName = text;
|
||||
},
|
||||
initialValue: _model.currentUserName,
|
||||
onPositive: () async{
|
||||
onPositive: () async {
|
||||
if (_model.currentEditingUserName.isEmpty) {
|
||||
_showTextDialog(DemoLocalizations.of(context).userNameCantBeNull);
|
||||
_showTextDialog(
|
||||
DemoLocalizations.of(context).userNameCantBeNull);
|
||||
return;
|
||||
}
|
||||
final account = await SharedUtil.instance.getString(Keys.account);
|
||||
if(account == "default" || account == null){
|
||||
if (account == "default" || account == null) {
|
||||
_model.currentUserName = _model.currentEditingUserName;
|
||||
SharedUtil.instance.saveString(Keys.currentUserName, _model.currentUserName);
|
||||
SharedUtil.instance
|
||||
.saveString(Keys.currentUserName, _model.currentUserName);
|
||||
Navigator.of(context).pop();
|
||||
_model.refresh();
|
||||
} else{
|
||||
} else {
|
||||
_changeUserName(account, _model.currentEditingUserName);
|
||||
}
|
||||
},
|
||||
@ -336,29 +351,28 @@ class MainPageLogic {
|
||||
});
|
||||
}
|
||||
|
||||
void _showTextDialog(String text){
|
||||
void _showTextDialog(String text) {
|
||||
final context = _model.context;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) {
|
||||
return AlertDialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(20.0))),
|
||||
content: Text(
|
||||
text),
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.0))),
|
||||
content: Text(text),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
void _changeUserName(String account, String userName) async{
|
||||
void _changeUserName(String account, String userName) async {
|
||||
final context = _model.context;
|
||||
final token = await SharedUtil.instance.getString(Keys.token);
|
||||
_showLoadingDialog(context);
|
||||
ApiService.instance.changeUserName(
|
||||
success: (bean) async {
|
||||
_model.currentUserName = _model.currentEditingUserName;
|
||||
SharedUtil.instance.saveString(Keys.currentUserName, _model.currentUserName);
|
||||
SharedUtil.instance
|
||||
.saveString(Keys.currentUserName, _model.currentUserName);
|
||||
Navigator.of(context).pop();
|
||||
_model.refresh();
|
||||
Navigator.pop(context);
|
||||
@ -367,34 +381,31 @@ class MainPageLogic {
|
||||
Navigator.of(context).pop();
|
||||
_showTextDialog(msg);
|
||||
},
|
||||
failed: (CommonBean commonBean){
|
||||
failed: (CommonBean commonBean) {
|
||||
Navigator.of(context).pop();
|
||||
_showTextDialog(commonBean.description);
|
||||
},
|
||||
params: {
|
||||
"account": account,
|
||||
"token": token,
|
||||
"userName": userName
|
||||
},
|
||||
params: {"account": account, "token": token, "userName": userName},
|
||||
token: _model.cancelToken,
|
||||
);
|
||||
}
|
||||
|
||||
void _showLoadingDialog(BuildContext context) {
|
||||
showDialog(context: context, builder: (ctx){
|
||||
return NetLoadingWidget();
|
||||
});
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) {
|
||||
return NetLoadingWidget();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
void onSearchTap() {
|
||||
Navigator.of(_model.context).push(new CupertinoPageRoute(builder: (ctx) {
|
||||
return ProviderConfig.getInstance().getSearchPage();
|
||||
}));
|
||||
}
|
||||
|
||||
void checkUpdate(GlobalModel globalModel){
|
||||
if(Platform.isIOS) return;
|
||||
void checkUpdate(GlobalModel globalModel) {
|
||||
if (Platform.isIOS) return;
|
||||
final context = _model.context;
|
||||
CancelToken cancelToken = CancelToken();
|
||||
ApiService.instance.checkUpdate(
|
||||
@ -412,14 +423,12 @@ class MainPageLogic {
|
||||
updateInfo: updateInfo.updateInfo,
|
||||
updateInfoColor: globalModel.logic.getBgInDark(),
|
||||
backgroundColor:
|
||||
globalModel.logic.getPrimaryGreyInDark(context),
|
||||
globalModel.logic.getPrimaryGreyInDark(context),
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
error: (msg) {
|
||||
|
||||
},
|
||||
error: (msg) {},
|
||||
params: {
|
||||
"language": globalModel.currentLocale.languageCode,
|
||||
"appId": "001"
|
||||
@ -429,22 +438,22 @@ class MainPageLogic {
|
||||
}
|
||||
|
||||
///在云端更新一个任务
|
||||
void postUpdateTask(TaskBean taskBean) async{
|
||||
void postUpdateTask(TaskBean taskBean) async {
|
||||
final account = await SharedUtil.instance.getString(Keys.account);
|
||||
if(account == 'default') return;
|
||||
if (account == 'default') return;
|
||||
final token = await SharedUtil.instance.getString(Keys.token);
|
||||
ApiService.instance.postUpdateTask(
|
||||
success: (CommonBean bean){
|
||||
success: (CommonBean bean) {
|
||||
taskBean.needUpdateToCloud = 'false';
|
||||
DBProvider.db.updateTask(taskBean);
|
||||
},
|
||||
failed: (CommonBean bean){
|
||||
failed: (CommonBean bean) {
|
||||
taskBean.needUpdateToCloud = 'true';
|
||||
_model.needSyn = true;
|
||||
_model.refresh();
|
||||
DBProvider.db.updateTask(taskBean);
|
||||
},
|
||||
error: (msg){
|
||||
error: (msg) {
|
||||
taskBean.needUpdateToCloud = 'true';
|
||||
_model.needSyn = true;
|
||||
_model.refresh();
|
||||
@ -457,24 +466,26 @@ class MainPageLogic {
|
||||
}
|
||||
|
||||
///在云端创建一个任务
|
||||
void postCreateTask(TaskBean taskBean) async{
|
||||
showDialog(context: _model.context, builder: (ctx){
|
||||
return NetLoadingWidget();
|
||||
});
|
||||
void postCreateTask(TaskBean taskBean) async {
|
||||
showDialog(
|
||||
context: _model.context,
|
||||
builder: (ctx) {
|
||||
return NetLoadingWidget();
|
||||
});
|
||||
final token = await SharedUtil.instance.getString(Keys.token);
|
||||
ApiService.instance.postCreateTask(
|
||||
success: (UploadTaskBean bean){
|
||||
success: (UploadTaskBean bean) {
|
||||
taskBean.needUpdateToCloud = 'false';
|
||||
taskBean.uniqueId = bean.uniqueId;
|
||||
DBProvider.db.updateTask(taskBean);
|
||||
},
|
||||
failed: (UploadTaskBean bean){
|
||||
failed: (UploadTaskBean bean) {
|
||||
taskBean.needUpdateToCloud = 'true';
|
||||
_model.needSyn = true;
|
||||
_model.refresh();
|
||||
DBProvider.db.updateTask(taskBean);
|
||||
},
|
||||
error: (msg){
|
||||
error: (msg) {
|
||||
taskBean.needUpdateToCloud = 'true';
|
||||
_model.needSyn = true;
|
||||
_model.refresh();
|
||||
@ -486,4 +497,11 @@ class MainPageLogic {
|
||||
);
|
||||
}
|
||||
|
||||
void onBackGroundTap(GlobalModel globalModel){
|
||||
Navigator.of(_model.context).push(new CupertinoPageRoute(builder: (ctx) {
|
||||
return ProviderConfig.getInstance().getNetPicturesPage(
|
||||
useType: NetPicturesUseType.mainPageBackground,
|
||||
);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
@ -92,20 +92,33 @@ class NetPicturesPageLogic{
|
||||
initialPageIndex: index,
|
||||
onSelect: (current) {
|
||||
final currentUrl =
|
||||
_model.photos[current].urls.small;
|
||||
_model.photos[current].urls.regular;
|
||||
|
||||
if(_model.useType == NetPicturesUseType.accountBackground){
|
||||
|
||||
SharedUtil.instance.saveString(Keys.currentAccountBackground, currentUrl);
|
||||
SharedUtil.instance.saveString(Keys.currentAccountBackgroundType, AccountBGType.netPicture);
|
||||
final accountPageModel = _model.accountPageModel;
|
||||
accountPageModel.backgroundUrl = currentUrl;
|
||||
accountPageModel.backgroundType = AccountBGType.netPicture;
|
||||
accountPageModel.refresh();
|
||||
} else {
|
||||
|
||||
} else if(_model.useType == NetPicturesUseType.navigatorHeader){
|
||||
|
||||
SharedUtil.instance.saveString(Keys.currentNetPicUrl, currentUrl);
|
||||
SharedUtil.instance.saveString(Keys.currentNavHeader, _model.useType);
|
||||
globalModel.currentNetPicUrl = currentUrl;
|
||||
globalModel.currentNavHeader = _model.useType;
|
||||
globalModel.refresh();
|
||||
|
||||
} else {
|
||||
|
||||
SharedUtil.instance.saveString(Keys.currentMainPageBackgroundUrl, currentUrl);
|
||||
SharedUtil.instance.saveBoolean(Keys.enableNetPicBgInMainPage, true);
|
||||
globalModel.currentMainPageBgUrl = currentUrl;
|
||||
globalModel.enableNetPicBgInMainPage = true;
|
||||
globalModel.refresh();
|
||||
|
||||
}
|
||||
Navigator.of(_model.context).pop();
|
||||
},
|
||||
|
@ -32,11 +32,17 @@ class GlobalModel extends ChangeNotifier {
|
||||
bool isCardChangeWithBg = false;
|
||||
|
||||
///是否开启主页卡片无限循环滚动
|
||||
bool enableInfiniteScroll = true;
|
||||
bool enableInfiniteScroll = false;
|
||||
|
||||
///是否开启天气
|
||||
bool enableWeatherShow = false;
|
||||
|
||||
///是否开启主页背景为网络图片
|
||||
bool enableNetPicBgInMainPage = false;
|
||||
|
||||
///当前主页网络背景图片地址
|
||||
String currentMainPageBgUrl = "";
|
||||
|
||||
///当前位置信息(经纬度)
|
||||
String currentPosition = "";
|
||||
|
||||
@ -80,6 +86,8 @@ class GlobalModel extends ChangeNotifier {
|
||||
logic.getEnableInfiniteScroll(),
|
||||
logic.getEnableWeatherShow(),
|
||||
logic.getLoginState(),
|
||||
logic.getCurrentMainPageBgUrl(),
|
||||
logic.getEnableNetPicBgInMainPage(),
|
||||
logic.getCurrentPosition(),
|
||||
]).then((value) {
|
||||
currentLocale = Locale(currentLanguageCode[0], currentLanguageCode[1]);
|
||||
|
@ -28,6 +28,7 @@ class NetPicturesPageModel extends ChangeNotifier{
|
||||
String useType;
|
||||
|
||||
|
||||
///[accountPageModel]是从'我的账号'页面进入时传过来的值
|
||||
AccountPageModel accountPageModel;
|
||||
|
||||
NetPicturesPageModel({String useType, AccountPageModel accountPageModel}){
|
||||
|
@ -26,6 +26,7 @@ class _AboutPageState extends State<AboutPage> {
|
||||
Widget build(BuildContext context) {
|
||||
final globalModel = Provider.of<GlobalModel>(context);
|
||||
if(descriptions.isEmpty){
|
||||
descriptions.add(DemoLocalizations.of(context).version107);
|
||||
descriptions.add(DemoLocalizations.of(context).version106);
|
||||
descriptions.add(DemoLocalizations.of(context).version105);
|
||||
descriptions.add(DemoLocalizations.of(context).version104);
|
||||
|
@ -17,147 +17,150 @@ class MainPage extends StatelessWidget {
|
||||
final size = MediaQuery.of(context).size;
|
||||
model.setContext(context,globalModel: globalModel);
|
||||
globalModel.setMainPageModel(model);
|
||||
return Container(
|
||||
decoration: model.logic.getBackground(globalModel),
|
||||
child: Scaffold(
|
||||
key: model.scaffoldKey,
|
||||
backgroundColor: Colors.transparent,
|
||||
appBar: AppBar(
|
||||
return GestureDetector(
|
||||
onTap: () => model.logic.onBackGroundTap(globalModel),
|
||||
child: Container(
|
||||
decoration: model.logic.getBackground(globalModel),
|
||||
child: Scaffold(
|
||||
key: model.scaffoldKey,
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
title: Text(DemoLocalizations.of(context).appName),
|
||||
leading: FlatButton(
|
||||
child: MenuIcon(globalModel.logic.getWhiteInDark()),
|
||||
onPressed: () {
|
||||
model.scaffoldKey.currentState.openDrawer();
|
||||
},
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
title: Text(DemoLocalizations.of(context).appName),
|
||||
leading: FlatButton(
|
||||
child: MenuIcon(globalModel.logic.getWhiteInDark()),
|
||||
onPressed: () {
|
||||
model.scaffoldKey.currentState.openDrawer();
|
||||
},
|
||||
),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
size: 28,
|
||||
color: globalModel.logic.getWhiteInDark(),
|
||||
),
|
||||
onPressed: () => model.logic.onSearchTap(),
|
||||
)
|
||||
],
|
||||
),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
size: 28,
|
||||
color: globalModel.logic.getWhiteInDark(),
|
||||
),
|
||||
onPressed: () => model.logic.onSearchTap(),
|
||||
)
|
||||
],
|
||||
),
|
||||
drawer: Drawer(
|
||||
child: NavPage(),
|
||||
),
|
||||
floatingActionButtonAnimator: FloatingActionButtonAnimator.scaling,
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
||||
floatingActionButton: AnimatedFloatingButton(
|
||||
bgColor: globalModel.isBgChangeWithCard
|
||||
? model.logic.getCurrentCardColor()
|
||||
: null,
|
||||
),
|
||||
body: Container(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(62, 8, 50, 0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: InkWell(
|
||||
onTap: model.logic.onAvatarTap,
|
||||
child: Hero(
|
||||
tag: 'avatar',
|
||||
child: Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
child: ClipRRect(
|
||||
child: model.logic.getAvatarWidget(),
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
drawer: Drawer(
|
||||
child: NavPage(),
|
||||
),
|
||||
floatingActionButtonAnimator: FloatingActionButtonAnimator.scaling,
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
||||
floatingActionButton: AnimatedFloatingButton(
|
||||
bgColor: globalModel.isBgChangeWithCard
|
||||
? model.logic.getCurrentCardColor()
|
||||
: null,
|
||||
),
|
||||
body: Container(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(62, 8, 50, 0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: InkWell(
|
||||
onTap: model.logic.onAvatarTap,
|
||||
child: Hero(
|
||||
tag: 'avatar',
|
||||
child: Container(
|
||||
width: 60,
|
||||
height: 60,
|
||||
child: ClipRRect(
|
||||
child: model.logic.getAvatarWidget(),
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(
|
||||
alignment: Alignment.centerRight,
|
||||
child: model.needSyn ? SynchronizeWidget(mainPageModel: model,) : Container(),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(
|
||||
alignment: Alignment.centerRight,
|
||||
child: model.needSyn ? SynchronizeWidget(mainPageModel: model,) : Container(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(50, 0, 50, 0),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 20, left: 12),
|
||||
child: SingleChildScrollView(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: InkWell(
|
||||
onTap: model.currentUserName.isEmpty ? null : model.logic.onUserNameTap,
|
||||
child: Text(
|
||||
"${DemoLocalizations.of(context).welcomeWord}${model.currentUserName}",
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
color: globalModel.logic.getWhiteInDark()),
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(50, 0, 50, 0),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 20, left: 12),
|
||||
child: SingleChildScrollView(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: InkWell(
|
||||
onTap: model.currentUserName.isEmpty ? null : model.logic.onUserNameTap,
|
||||
child: Text(
|
||||
"${DemoLocalizations.of(context).welcomeWord}${model.currentUserName}",
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
color: globalModel.logic.getWhiteInDark()),
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
model.currentUserName.isEmpty
|
||||
? IconButton(
|
||||
icon: Icon(Icons.account_circle, color: globalModel.logic.getWhiteInDark(),),
|
||||
onPressed: model.logic.onUserNameTap,
|
||||
)
|
||||
: SizedBox()
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(50, 0, 50, 0),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 8, left: 12),
|
||||
child: Text(
|
||||
"${DemoLocalizations.of(context).taskItems(model.tasks.length)}",
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: globalModel.logic.getWhiteInDark()),
|
||||
),
|
||||
),
|
||||
),
|
||||
model.tasks.length == 0
|
||||
? model.logic.getEmptyWidget(globalModel)
|
||||
: Container(
|
||||
margin: EdgeInsets.only(top: 40, bottom: 40),
|
||||
child: CarouselSlider(
|
||||
items: model.logic.getCards(context),
|
||||
aspectRatio: 16 / 9,
|
||||
height: min(size.width, size.height) - 100,
|
||||
viewportFraction:
|
||||
size.height >= size.width ? 0.8 : 0.5,
|
||||
initialPage: 0,
|
||||
enableInfiniteScroll: model.tasks.length >= 3 &&
|
||||
globalModel.enableInfiniteScroll,
|
||||
reverse: false,
|
||||
enlargeCenterPage: true,
|
||||
onPageChanged: (index) {
|
||||
model.currentCardIndex = index;
|
||||
if (globalModel.isBgChangeWithCard) model.refresh();
|
||||
},
|
||||
scrollDirection: Axis.horizontal,
|
||||
model.currentUserName.isEmpty
|
||||
? IconButton(
|
||||
icon: Icon(Icons.account_circle, color: globalModel.logic.getWhiteInDark(),),
|
||||
onPressed: model.logic.onUserNameTap,
|
||||
)
|
||||
: SizedBox()
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(50, 0, 50, 0),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 8, left: 12),
|
||||
child: Text(
|
||||
"${DemoLocalizations.of(context).taskItems(model.tasks.length)}",
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: globalModel.logic.getWhiteInDark()),
|
||||
),
|
||||
),
|
||||
),
|
||||
model.tasks.length == 0
|
||||
? model.logic.getEmptyWidget(globalModel)
|
||||
: Container(
|
||||
margin: EdgeInsets.only(top: 40, bottom: 40),
|
||||
child: CarouselSlider(
|
||||
items: model.logic.getCards(context),
|
||||
aspectRatio: 16 / 9,
|
||||
height: min(size.width, size.height) - 100,
|
||||
viewportFraction:
|
||||
size.height >= size.width ? 0.8 : 0.5,
|
||||
initialPage: 0,
|
||||
enableInfiniteScroll: model.tasks.length >= 3 &&
|
||||
globalModel.enableInfiniteScroll,
|
||||
reverse: false,
|
||||
enlargeCenterPage: true,
|
||||
onPageChanged: (index) {
|
||||
model.currentCardIndex = index;
|
||||
if (globalModel.isBgChangeWithCard) model.refresh();
|
||||
},
|
||||
scrollDirection: Axis.horizontal,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -18,9 +18,9 @@ class NetPicturesPage extends StatelessWidget {
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(model.useType == NetPicturesUseType.accountBackground
|
||||
? DemoLocalizations.of(context).accountBackgroundSetting
|
||||
: DemoLocalizations.of(context).netPicture),
|
||||
title: Text(model.useType == NetPicturesUseType.navigatorHeader
|
||||
? DemoLocalizations.of(context).netPicture
|
||||
: DemoLocalizations.of(context).accountBackgroundSetting),
|
||||
),
|
||||
body: Container(
|
||||
child: model.loadingFlag == LoadingFlag.success ||
|
||||
@ -38,7 +38,7 @@ class NetPicturesPage extends StatelessWidget {
|
||||
children: List.generate(model.photos.length, (index) {
|
||||
final url = model.photos[index].urls.regular;
|
||||
final urls = model.photos
|
||||
.map((photoBean) => photoBean.urls.small)
|
||||
.map((photoBean) => photoBean.urls.regular)
|
||||
.toList();
|
||||
return InkWell(
|
||||
onTap: () => model.logic.onPictureTap(urls, index, globalModel),
|
||||
|
@ -3,6 +3,7 @@ import 'dart:math';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:todo_list/config/all_types.dart';
|
||||
import 'package:todo_list/config/api_service.dart';
|
||||
import 'package:todo_list/config/provider_config.dart';
|
||||
import 'package:todo_list/i10n/localization_intl.dart';
|
||||
@ -83,17 +84,22 @@ class SettingPage extends StatelessWidget {
|
||||
),
|
||||
SwitchListTile(
|
||||
title: Text(DemoLocalizations.of(context).enableWeatherShow),
|
||||
secondary: Transform(
|
||||
transform: Matrix4.rotationY(pi),
|
||||
origin: Offset(12, 0.0),
|
||||
child: const Icon(
|
||||
Icons.wb_sunny,
|
||||
),
|
||||
secondary: const Icon(
|
||||
Icons.wb_sunny,
|
||||
),
|
||||
value: globalModel.enableWeatherShow,
|
||||
activeColor: Theme.of(context).primaryColor,
|
||||
onChanged: (value) => onWeatherOpen(value, context, globalModel),
|
||||
),
|
||||
SwitchListTile(
|
||||
title: Text(DemoLocalizations.of(context).enableNetPicBgInMainPage),
|
||||
secondary: const Icon(
|
||||
Icons.image,
|
||||
),
|
||||
value: globalModel.enableNetPicBgInMainPage,
|
||||
activeColor: Theme.of(context).primaryColor,
|
||||
onChanged: (value) => onNetPicBgSelect(value, context, globalModel),
|
||||
),
|
||||
SwitchListTile(
|
||||
title: Text(DemoLocalizations.of(context).enableInfiniteScroll),
|
||||
secondary: const Icon(
|
||||
@ -193,4 +199,18 @@ class SettingPage extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
void onNetPicBgSelect(bool value, BuildContext context, GlobalModel globalModel){
|
||||
if(value){
|
||||
Navigator.of(context).push(new CupertinoPageRoute(builder: (ctx) {
|
||||
return ProviderConfig.getInstance().getNetPicturesPage(
|
||||
useType: NetPicturesUseType.mainPageBackground,
|
||||
);
|
||||
}));
|
||||
} else {
|
||||
globalModel.enableNetPicBgInMainPage = false;
|
||||
SharedUtil.instance.saveBoolean(Keys.enableNetPicBgInMainPage, false);
|
||||
globalModel.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ class _SynchronizeWidgetState extends State< SynchronizeWidget> {
|
||||
break;
|
||||
case SynFlag.synchronizing:
|
||||
return Container(
|
||||
width: 60,
|
||||
width: 200,
|
||||
height: 60,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -117,7 +117,7 @@ class _SynchronizeWidgetState extends State< SynchronizeWidget> {
|
||||
break;
|
||||
case SynFlag.cloudSynchronizing:
|
||||
return Container(
|
||||
width: 60,
|
||||
width: 100,
|
||||
height: 60,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
@ -3,7 +3,7 @@ description: A new Flutter project.
|
||||
|
||||
#打包命令:flutter build apk --target-platform android-arm --split-per-abi
|
||||
|
||||
version: 1.0.6+1
|
||||
version: 1.0.7+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.1.0 <3.0.0"
|
||||
|
@ -506,6 +506,12 @@
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNetPicBgInMainPage": "Turn on the net-picture background",
|
||||
"@enableNetPicBgInMainPage": {
|
||||
"description": "开启主页网络图片背景",
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"inputCurrentCity": "input your city",
|
||||
"@inputCurrentCity": {
|
||||
"description": "手动输入你的城市",
|
||||
@ -1079,5 +1085,11 @@
|
||||
"description": "版本:1.0.6 \n\n1.修复:大量因为上线账号系统,而新增的bug \n2.优化:当自定义图标数量不低于6个的时候,你可以任意编辑图标啦 \n3.新增:你可以在账号页面设置网络图片作为背景啦",
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"version107": "Version:1.0.7 \n\n1.Fixed: some bugs had been discovered! \n2.Add: Now you can change your background to network image in main page!It will be very beautiful! \n",
|
||||
"@version107": {
|
||||
"description": "版本:1.0.7 \n\n1.修复:已经发现的一些bug\n2.新增:现在可以将主页的背景更换为网络图片啦,非常漂亮哦! \n",
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"@@last_modified": "2019-09-03T16:05:18.840394",
|
||||
"@@last_modified": "2019-09-16T17:17:07.143162",
|
||||
"appName": "One Day List",
|
||||
"@appName": {
|
||||
"description": "app的名字",
|
||||
@ -206,6 +206,12 @@
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNetPicBgInMainPage": "Turn on the net-picture background",
|
||||
"@enableNetPicBgInMainPage": {
|
||||
"description": "开启主页网络图片背景",
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"inputCurrentCity": "input your city",
|
||||
"@inputCurrentCity": {
|
||||
"description": "手动输入你的城市",
|
||||
@ -1077,5 +1083,11 @@
|
||||
"description": "版本:1.0.6 \n\n1.修复:大量因为上线账号系统,而新增的bug \n2.优化:当自定义图标数量不低于6个的时候,你可以任意编辑图标啦 \n3.新增:你可以在账号页面设置网络图片作为背景啦",
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"version107": "Version:1.0.7 \n\n1.Fixed: some bugs had been discovered! \n2.Add: Now you can change your background to network image in main page!It will be very beautiful! \n",
|
||||
"@version107": {
|
||||
"description": "版本:1.0.7 \n\n1.修复:已经发现的一些bug\n2.新增:现在可以将主页的背景更换为网络图片啦,非常漂亮哦! \n",
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
}
|
||||
}
|
@ -482,6 +482,12 @@
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNetPicBgInMainPage": "开启主页网络图片背景",
|
||||
"@enableNetPicBgInMainPage": {
|
||||
"description": "开启主页网络图片背景",
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"inputCurrentCity": "手动输入你的城市",
|
||||
"@inputCurrentCity": {
|
||||
"description": "手动输入你的城市",
|
||||
@ -1077,5 +1083,11 @@
|
||||
"description": "版本:1.0.6 \n\n1.修复:大量因为上线账号系统,而新增的bug \n2.优化:当自定义图标数量不低于6个的时候,你可以任意编辑图标啦 \n3.新增:你可以在账号页面设置网络图片作为背景啦",
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"version107": "版本:1.0.7 \n\n1.修复:已经发现的一些bug\n2.新增:现在可以将主页的背景更换为网络图片啦,非常漂亮哦! \n",
|
||||
"@version107": {
|
||||
"description": "版本:1.0.7 \n\n1.修复:已经发现的一些bug\n2.新增:现在可以将主页的背景更换为网络图片啦,非常漂亮哦! \n",
|
||||
"type": "text",
|
||||
"placeholders": {}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user