mirror of
https://github.com/asjqkkkk/flutter-todos.git
synced 2025-08-06 14:19:24 +08:00
🔨: Change server address
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -28,3 +28,4 @@ flutter_01.log
|
||||
flutter_02.log
|
||||
.flutter-plugins-dependencies
|
||||
Flutter.podspec
|
||||
android/android.iml
|
||||
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
|
||||
|
@ -6,7 +6,7 @@ export 'package:dio/dio.dart';
|
||||
class ApiStrategy {
|
||||
static ApiStrategy _instance;
|
||||
|
||||
static final String baseUrl = "http://111.230.251.115/oldchen/";
|
||||
static final String baseUrl = "http://42.194.193.85/oldchen/";
|
||||
// static final String baseUrl = "http://192.168.137.1:8080/";
|
||||
static const int connectTimeOut = 10 * 1000; //连接超时时间为10秒
|
||||
static const int receiveTimeOut = 15 * 1000; //响应超时时间为15秒
|
||||
|
@ -1,13 +1,12 @@
|
||||
|
||||
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:path/path.dart' as p;
|
||||
|
||||
|
||||
|
||||
//图片缓存管理类,目前没有用到
|
||||
class CustomCacheManager extends BaseCacheManager {
|
||||
class CustomCacheManager extends CacheManager {
|
||||
static const key = "customCache";
|
||||
|
||||
static CustomCacheManager _instance;
|
||||
@ -19,18 +18,11 @@ class CustomCacheManager extends BaseCacheManager {
|
||||
return _instance;
|
||||
}
|
||||
|
||||
CustomCacheManager._() : super(key,
|
||||
maxAgeCacheObject: Duration(hours: 12),
|
||||
maxNrOfCacheObjects: 1,
|
||||
fileFetcher: _customHttpGetter);
|
||||
CustomCacheManager._() : super(Config(key));
|
||||
|
||||
Future<String> getFilePath() async {
|
||||
var directory = await getTemporaryDirectory();
|
||||
return p.join(directory.path, key);
|
||||
}
|
||||
|
||||
static Future<FileFetcherResponse> _customHttpGetter(String url, {Map<String, String> headers}) async {
|
||||
// Do things with headers, the url or whatever.
|
||||
return HttpFileFetcherResponse(await http.get(url, headers: headers));
|
||||
}
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:todo_list/json/task_bean.dart';
|
||||
|
@ -21,7 +21,7 @@ class CloudTaskBean {
|
||||
}
|
||||
|
||||
static List<CloudTaskBean> fromMapList(dynamic mapList) {
|
||||
List<CloudTaskBean> list = new List(mapList.length);
|
||||
List<CloudTaskBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ class CommonBean {
|
||||
}
|
||||
|
||||
static List<CommonBean> fromMapList(dynamic mapList) {
|
||||
List<CommonBean> list = new List(mapList.length);
|
||||
List<CommonBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class LoginBean{
|
||||
}
|
||||
|
||||
static List<LoginBean> fromMapList(dynamic mapList) {
|
||||
List<LoginBean> list = new List(mapList.length);
|
||||
List<LoginBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class PhotoBean {
|
||||
}
|
||||
|
||||
static List<PhotoBean> fromMapList(dynamic mapList) {
|
||||
List<PhotoBean> list = new List(mapList.length);
|
||||
List<PhotoBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
@ -102,7 +102,7 @@ class LinksBean {
|
||||
}
|
||||
|
||||
static List<LinksBean> fromMapList(dynamic mapList) {
|
||||
List<LinksBean> list = new List(mapList.length);
|
||||
List<LinksBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
@ -149,7 +149,7 @@ class UrlsBean {
|
||||
}
|
||||
|
||||
static List<UrlsBean> fromMapList(dynamic mapList) {
|
||||
List<UrlsBean> list = new List(mapList.length);
|
||||
List<UrlsBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
@ -225,7 +225,7 @@ class UserBean {
|
||||
}
|
||||
|
||||
static List<UserBean> fromMapList(dynamic mapList) {
|
||||
List<UserBean> list = new List(mapList.length);
|
||||
List<UserBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
@ -254,7 +254,7 @@ class ProfileImageBean {
|
||||
}
|
||||
|
||||
static List<ProfileImageBean> fromMapList(dynamic mapList) {
|
||||
List<ProfileImageBean> list = new List(mapList.length);
|
||||
List<ProfileImageBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ class RegisterBean{
|
||||
}
|
||||
|
||||
static List<RegisterBean> fromMapList(dynamic mapList) {
|
||||
List<RegisterBean> list = new List(mapList.length);
|
||||
List<RegisterBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class SuggestionBean {
|
||||
}
|
||||
|
||||
static List<SuggestionBean> fromMapList(dynamic mapList) {
|
||||
List<SuggestionBean> list = new List(mapList.length);
|
||||
List<SuggestionBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
@ -61,7 +61,7 @@ class SuggestionsListBean {
|
||||
}
|
||||
|
||||
static List<SuggestionsListBean> fromMapList(dynamic mapList) {
|
||||
List<SuggestionsListBean> list = new List(mapList.length);
|
||||
List<SuggestionsListBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ class TaskBean {
|
||||
}
|
||||
|
||||
static List<TaskBean> fromMapList(dynamic mapList) {
|
||||
List<TaskBean> list = new List(mapList.length);
|
||||
List<TaskBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
@ -142,7 +142,7 @@ class TaskBean {
|
||||
}
|
||||
|
||||
static List<TaskBean> fromNetMapList(dynamic mapList) {
|
||||
List<TaskBean> list = new List(mapList.length);
|
||||
List<TaskBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromNetMap(mapList[i]);
|
||||
}
|
||||
@ -214,7 +214,7 @@ class TaskDetailBean {
|
||||
}
|
||||
|
||||
static List<TaskDetailBean> fromMapList(dynamic mapList) {
|
||||
List<TaskDetailBean> list = new List(mapList.length);
|
||||
List<TaskDetailBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class TaskIconBean {
|
||||
}
|
||||
|
||||
static List<TaskIconBean> fromMapList(dynamic mapList) {
|
||||
List<TaskIconBean> list = new List(mapList.length);
|
||||
List<TaskIconBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
@ -73,7 +73,7 @@ class IconBean {
|
||||
}
|
||||
|
||||
static List<IconBean> fromMapList(dynamic mapList) {
|
||||
List<IconBean> list = new List(mapList.length);
|
||||
List<IconBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ class UpdateInfoBean {
|
||||
}
|
||||
|
||||
static List<UpdateInfoBean> fromMapList(dynamic mapList) {
|
||||
List<UpdateInfoBean> list = new List(mapList.length);
|
||||
List<UpdateInfoBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class UploadAvatarBean {
|
||||
}
|
||||
|
||||
static List<UploadAvatarBean> fromMapList(dynamic mapList) {
|
||||
List<UploadAvatarBean> list = new List(mapList.length);
|
||||
List<UploadAvatarBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class UploadTaskBean {
|
||||
}
|
||||
|
||||
static List<UploadTaskBean> fromMapList(dynamic mapList) {
|
||||
List<UploadTaskBean> list = new List(mapList.length);
|
||||
List<UploadTaskBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ class WeatherBean {
|
||||
}
|
||||
|
||||
static List<WeatherBean> fromMapList(dynamic mapList) {
|
||||
List<WeatherBean> list = new List(mapList.length);
|
||||
List<WeatherBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
@ -46,7 +46,7 @@ class HeWeather6ListBean {
|
||||
}
|
||||
|
||||
static List<HeWeather6ListBean> fromMapList(dynamic mapList) {
|
||||
List<HeWeather6ListBean> list = new List(mapList.length);
|
||||
List<HeWeather6ListBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
@ -90,7 +90,7 @@ class BasicBean {
|
||||
}
|
||||
|
||||
static List<BasicBean> fromMapList(dynamic mapList) {
|
||||
List<BasicBean> list = new List(mapList.length);
|
||||
List<BasicBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
@ -149,7 +149,7 @@ class NowBean {
|
||||
}
|
||||
|
||||
static List<NowBean> fromMapList(dynamic mapList) {
|
||||
List<NowBean> list = new List(mapList.length);
|
||||
List<NowBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
@ -175,7 +175,7 @@ class UpdateBean {
|
||||
}
|
||||
|
||||
static List<UpdateBean> fromMapList(dynamic mapList) {
|
||||
List<UpdateBean> list = new List(mapList.length);
|
||||
List<UpdateBean> list = List.filled(mapList.length, null);
|
||||
for (int i = 0; i < mapList.length; i++) {
|
||||
list[i] = fromMap(mapList[i]);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ class AvatarPageLogic {
|
||||
Future getImage() async {
|
||||
final context = _model.context;
|
||||
|
||||
File image = await ImagePicker.pickImage(source: ImageSource.gallery);
|
||||
PickedFile image = await ImagePicker().getImage(source: ImageSource.gallery);
|
||||
if (image != null) {
|
||||
if (Platform.isAndroid) {
|
||||
PermissionReqUtil.getInstance().requestPermission(
|
||||
@ -64,7 +64,7 @@ class AvatarPageLogic {
|
||||
}
|
||||
}
|
||||
|
||||
void _saveAndGetAvatarFile(File file) async {
|
||||
void _saveAndGetAvatarFile(PickedFile file) async {
|
||||
_model.currentAvatarType = CurrentAvatarType.local;
|
||||
_model.currentAvatarUrl = file.path;
|
||||
_model.refresh();
|
||||
|
@ -1,5 +1,3 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:todo_list/config/api_service.dart';
|
||||
@ -72,10 +70,10 @@ class FeedbackPageLogic {
|
||||
final userName = await SharedUtil.instance.getString(Keys.currentUserName) ?? IntlLocalizations.of(context).noName;
|
||||
final suggestion = _model.feedbackContent;
|
||||
final avatarPath = await SharedUtil.instance.getString(Keys.localAvatarPath) ?? "";
|
||||
String fileName = avatarPath
|
||||
.substring(avatarPath.lastIndexOf("/") + 1, avatarPath.length)
|
||||
.replaceAll(" ", "");
|
||||
String transFormName = Uri.encodeFull(fileName).replaceAll("%", "");
|
||||
// String fileName = avatarPath
|
||||
// .substring(avatarPath.lastIndexOf("/") + 1, avatarPath.length)
|
||||
// .replaceAll(" ", "");
|
||||
// String transFormName = Uri.encodeFull(fileName).replaceAll("%", "");
|
||||
///由于写后端的时候忘记添加表情的字段,现在把它放这里面
|
||||
final connectWay = "${(_model.contactWay ?? "") + "<emoji>${_model.currentSelectSvg + 1}<emoji>"}";
|
||||
final account = await SharedUtil.instance.getString(Keys.account) ?? "default";
|
||||
@ -93,7 +91,6 @@ class FeedbackPageLogic {
|
||||
"suggestion": suggestion,
|
||||
"connectWay": connectWay,
|
||||
"userName": userName,
|
||||
"userName": userName,
|
||||
}),
|
||||
success: (bean){
|
||||
SharedUtil.instance.saveString(Keys.lastSuggestTime, DateTime.now().toIso8601String());
|
||||
|
@ -1,5 +1,3 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:todo_list/config/all_types.dart';
|
||||
import 'package:todo_list/json/theme_bean.dart';
|
||||
|
@ -41,7 +41,6 @@ class LoginPageModel extends ChangeNotifier{
|
||||
emailController.dispose();
|
||||
passwordController.dispose();
|
||||
cancelToken?.cancel();
|
||||
formKey?.currentState?.dispose();
|
||||
super.dispose();
|
||||
debugPrint("LoginPageModel销毁了");
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class EditTaskPage extends StatelessWidget {
|
||||
title: Container(
|
||||
height: 49,
|
||||
child: Form(
|
||||
autovalidate: true,
|
||||
autovalidateMode: AutovalidateMode.always,
|
||||
child: TextFormField(
|
||||
style: TextStyle(color: textColor,textBaseline: TextBaseline.alphabetic),
|
||||
textAlign: TextAlign.center,
|
||||
|
@ -10,7 +10,6 @@ import 'package:todo_list/widgets/custom_cache_provider.dart';
|
||||
import 'package:todo_list/widgets/popmenu_botton.dart';
|
||||
import 'package:todo_list/widgets/task_info_widget.dart';
|
||||
import 'package:todo_list/model/task_detail_page_model.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
|
||||
class TaskDetailPage extends StatelessWidget {
|
||||
@override
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'dart:io';
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -93,7 +93,7 @@ class FeedbackPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
child: Form(
|
||||
autovalidate: true,
|
||||
autovalidateMode: AutovalidateMode.always,
|
||||
child: TextFormField(
|
||||
expands: true,
|
||||
maxLines: null,
|
||||
|
@ -1,5 +1,3 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
@ -63,7 +63,7 @@ class ThemeUtil {
|
||||
color: bgColor,
|
||||
elevation: 0.0,
|
||||
textTheme: TextTheme(
|
||||
title: TextStyle(color: iconColor, fontSize: 20),
|
||||
subtitle1: TextStyle(color: iconColor, fontSize: 20),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class _CustomIconWidgetState extends State<CustomIconWidget> {
|
||||
margin: EdgeInsets.all(10),
|
||||
width: 260,
|
||||
child: Form(
|
||||
autovalidate: true,
|
||||
autovalidateMode: AutovalidateMode.always,
|
||||
child: TextFormField(
|
||||
initialValue: widget.iconName ?? null,
|
||||
validator: (text){
|
||||
|
@ -30,7 +30,7 @@ class EditDialog extends StatelessWidget {
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.0))),
|
||||
title: Text(title ?? ""),
|
||||
content: Form(
|
||||
autovalidate: true,
|
||||
autovalidateMode: AutovalidateMode.always,
|
||||
child: TextFormField(
|
||||
style: TextStyle(textBaseline: TextBaseline.alphabetic),
|
||||
initialValue: initialValue ?? "",
|
||||
|
@ -23,7 +23,8 @@ dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
#intl语言包
|
||||
intl_translation: ^0.17.5
|
||||
intl: ^0.17.0
|
||||
|
||||
|
||||
|
||||
#网络请求
|
||||
@ -32,8 +33,6 @@ dev_dependencies:
|
||||
shared_preferences: ^0.5.6+2
|
||||
#状态管理
|
||||
provider: ^4.0.1
|
||||
#单元测试
|
||||
test: ^1.6.0
|
||||
#滑动控件
|
||||
carousel_slider: ^1.3.0
|
||||
#环形列表
|
||||
@ -61,7 +60,7 @@ dev_dependencies:
|
||||
#网页
|
||||
flutter_webview_plugin: ^0.3.5
|
||||
#上拉加载
|
||||
pull_to_refresh: ^1.5.0
|
||||
pull_to_refresh: ^1.6.5
|
||||
#看图片
|
||||
photo_view: ^0.4.2
|
||||
#url,可以用来打开应用商店
|
||||
|
@ -1,4 +1,4 @@
|
||||
import 'package:test/test.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
//升级测试
|
||||
void main(){
|
||||
|
@ -1,4 +1,4 @@
|
||||
import 'package:test/test.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'dart:math';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import 'package:test/test.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:todo_list/utils/my_encrypt_util.dart';
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:test/test.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:todo_list/utils/icon_utils.dart';
|
||||
|
||||
void main() {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:test/test.dart';
|
||||
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main(){
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import 'package:test/test.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:test/test.dart';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
|
||||
void main(){
|
||||
test("\n测试随机数字\n", (){
|
||||
|
Reference in New Issue
Block a user