Skip to content

Commit

Permalink
feat: 优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
azhon committed Sep 13, 2023
1 parent 041fac1 commit ae1790c
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/generated/assets/todo_flutter_assets.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
///This file is automatically generated, your modifications will be lost.
///This file is automatically generated by the [FlutterResource], your modifications will be lost.
class TodoFlutterAssets {
static const icEmpty = 'packages/todo_flutter/assets/images/ic_empty.png';
static const icError = 'packages/todo_flutter/assets/images/ic_error.png';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/net/base_request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ abstract class BaseRequest<T> with Paging {

///获取异常信息
String _parseError(e) {
if (e is DioError) {
if (e is DioException) {
return e.message ?? '';
}
return e.toString();
Expand Down
18 changes: 9 additions & 9 deletions lib/src/net/dio_engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ class DioEngine extends BaseNetEngine {
///[port]代理端口
@override
void setProxy(String ip, int port) {
final IOHttpClientAdapter adapter = IOHttpClientAdapter()
..onHttpClientCreate = (HttpClient client) {
client
..findProxy = (uri) {
return 'PROXY $ip:$port';
}
..badCertificateCallback = (cert, host, port) => true;
_dio.httpClientAdapter = IOHttpClientAdapter(
createHttpClient: () {
final client = HttpClient();
client.findProxy = (uri) {
return 'PROXY $ip:$port';
};
client.badCertificateCallback = (cert, host, port) => true;
return client;
};
_dio.httpClientAdapter = adapter;
},
);
}

///添加拦截器
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ui/common_input_area.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class _CommonInputAreaState extends BaseState<CommonInputArea> {
},
),
),
)
),
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ui/dialog/base_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ mixin BaseDialog implements UIWidget {
confirmColor,
cancelText,
cancelColor,
)
),
],
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/ui/widget/bloc_load_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class BlocLoadWidget extends BaseStatelessWidget {
bloc: loadBloc,
builder: (BuildContext context, LoadState state) {
if (state is LoadingState) {
return SizedBox.expand(
return const SizedBox.expand(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
children: [
CircularProgressWidget(),
],
),
Expand Down
1 change: 0 additions & 1 deletion lib/src/ui/widget/loading_dialog_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:flutter/material.dart';
import 'package:todo_flutter/src/base/base_stateless_widget.dart';
import 'package:todo_flutter/src/ui/common_text.dart';
import 'package:todo_flutter/src/ui/dialog/loading_dialog.dart';
import 'package:todo_flutter/src/ui/widget/circular_progress_widget.dart';

class LoadingDialogWidget extends BaseStatelessWidget {
final String? msg;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/util/time_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TimeUtil {
return DateTime.now();
}

static String HHmmss(int timestamp) {
static String hhmmss(int timestamp) {
return formatTime(timestamp, format: 'HH:mm:ss');
}

Expand Down

0 comments on commit ae1790c

Please sign in to comment.