Skip to content

Commit

Permalink
Better code
Browse files Browse the repository at this point in the history
  • Loading branch information
mengyanshou committed Nov 30, 2023
1 parent 8b81af7 commit d47f2b3
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 33 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.2.7
- 尝试修复布局异常,高分辨率异常的问题

## 2.2.6
- 修复域名过期,无法登录和资源无法加载的问题

Expand Down
19 changes: 1 addition & 18 deletions lib/app/controller/chat_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,22 +214,6 @@ class ChatController extends GetxController with WidgetsBindingObserver {
sendMessage(dirPartMessage);
// Log.i(dirPartMessage);
});
// await for(FileSystemEntity element in dir.list(recursive: true)){

// }
// List<FileSystemEntity> list = await dir.list(recursive: true).toList();
// // TODO
// // 这儿还不敢随便改,等后面分配时间优化
// // 不await list,不然在文件特别多的时候,会等待很久

// // TODO 改Model
// info = MessageInfoFactory.fromJson({
// 'stat': 'complete',
// // 'size':element.s
// 'msgType': 'dirPart',
// 'partOf': dirName,
// });
// socket.send(info.toString());
}

/// 发送文件夹
Expand Down Expand Up @@ -458,6 +442,7 @@ class ChatController extends GetxController with WidgetsBindingObserver {
// 同步之前发送过的消息
for (Map<String, dynamic> data in messageCache) {
try {
// ignore: unused_local_variable
Response res = await httpInstance!.post(
'$urlPrefix:${joinMessage.messagePort}',
data: data,
Expand Down Expand Up @@ -620,8 +605,6 @@ class ChatController extends GetxController with WidgetsBindingObserver {
case AppLifecycleState.resumed:
// 刷新本地ip列表
refreshLocalAddress();
// TODO
// initChat();
break;
default:
}
Expand Down
1 change: 1 addition & 0 deletions lib/app/controller/file_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class FileController extends GetxController with WidgetsBindingObserver {
if (!dir.existsSync()) {
try {
dir.createSync(recursive: true);
// ignore: empty_catches
} catch (e) {}
}
}
Expand Down
1 change: 0 additions & 1 deletion lib/app/controller/setting_controller.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'dart:io';
import 'dart:math';

import 'package:flutter/material.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/app/controller/utils/file_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Future<List<String?>> getFilesPathsForAndroid(bool useSystemPicker) async {
if (!useSystemPicker) {
filePaths = (await file_manager.FileSelector.pick(
Get.context!,
))!;
));
} else {
FilePickerResult? result = await FilePicker.platform.pickFiles(
allowCompression: false,
Expand Down
5 changes: 0 additions & 5 deletions lib/global/global.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:clipboard_watcher/clipboard_watcher.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:dio/adapter.dart';
import 'package:dio/dio.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:global_repository/global_repository.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return AnnotatedRegion<SystemUiOverlayStyle>(
value: OverlayStyle.dark,
value: OverlayStyle.light,
child: Scaffold(
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
Expand Down
1 change: 0 additions & 1 deletion lib/modules/home/nav.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class Nav extends StatefulWidget {
class _NavState extends State<Nav> {
@override
Widget build(BuildContext context) {
print('$this build');
Widget center = Stack(
alignment: Alignment.center,
children: [
Expand Down
3 changes: 0 additions & 3 deletions lib/modules/share_chat_window.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import 'dart:math';
import 'dart:ui';
import 'package:desktop_drop/desktop_drop.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart' hide Response;
import 'package:global_repository/global_repository.dart';
import 'package:path/path.dart' as p;
import 'package:responsive_framework/responsive_framework.dart';
import 'package:speed_share/app/controller/chat_controller.dart';
import 'package:speed_share/app/controller/device_controller.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/themes/default_theme_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class DefaultThemeData {
static ThemeData light({
Color? primary,
}) {
final lightThemeData = ThemeData.light().copyWith();
final lightThemeData = ThemeData.light(useMaterial3: false).copyWith();
ColorScheme colorScheme = lightColorScheme.copyWith();
return lightThemeData.copyWith(
primaryColor: colorScheme.primary,
Expand Down
2 changes: 0 additions & 2 deletions lib/utils/http/http.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
library http;

import 'dart:convert';
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:signale/signale.dart';
part 'src/exception.dart';
part 'src/dio_utils.dart';
part 'src/interceptors.dart';
Expand Down

0 comments on commit d47f2b3

Please sign in to comment.