refactor: split desktop & mobile

This commit is contained in:
Kingtous 2022-05-24 23:33:00 +08:00
parent bd1895b0f6
commit a81e2f9859
19 changed files with 43 additions and 43 deletions

View File

@ -1,16 +1,16 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/pages/desktop_home_page.dart';
import 'package:flutter_hbb/desktop/pages/desktop_home_page.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:provider/provider.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_core/firebase_core.dart';
import 'common.dart';
import 'models/model.dart';
import 'pages/home_page.dart';
import 'pages/server_page.dart';
import 'pages/settings_page.dart';
import 'mobile/pages/home_page.dart';
import 'mobile/pages/server_page.dart';
import 'mobile/pages/settings_page.dart';
Future<Null> main() async {
WidgetsFlutterBinding.ensureInitialized();

View File

@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_hbb/common.dart';
import 'package:flutter_hbb/models/chat_model.dart';
import 'package:provider/provider.dart';
import '../models/model.dart';
import '../../models/model.dart';
import 'home_page.dart';
ChatPage chatPage = ChatPage();

View File

@ -1,10 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_hbb/pages/file_manager_page.dart';
import 'package:flutter_hbb/mobile/pages/file_manager_page.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'dart:async';
import '../common.dart';
import '../models/model.dart';
import '../../common.dart';
import '../../models/model.dart';
import 'home_page.dart';
import 'remote_page.dart';
import 'settings_page.dart';

View File

@ -7,8 +7,8 @@ import 'package:flutter_breadcrumb/flutter_breadcrumb.dart';
import 'package:wakelock/wakelock.dart';
import 'package:toggle_switch/toggle_switch.dart';
import '../common.dart';
import '../models/model.dart';
import '../../common.dart';
import '../../models/model.dart';
import '../widgets/dialog.dart';
class FileManagerPage extends StatefulWidget {

View File

@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_hbb/pages/chat_page.dart';
import 'package:flutter_hbb/pages/server_page.dart';
import 'package:flutter_hbb/pages/settings_page.dart';
import '../common.dart';
import 'package:flutter_hbb/mobile/pages/chat_page.dart';
import 'package:flutter_hbb/mobile/pages/server_page.dart';
import 'package:flutter_hbb/mobile/pages/settings_page.dart';
import '../../common.dart';
import '../widgets/overlay.dart';
import 'connection_page.dart';

View File

@ -1,16 +1,16 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/models/chat_model.dart';
import 'package:flutter_hbb/widgets/gesture_help.dart';
import 'package:flutter_hbb/mobile/widgets/gesture_help.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:provider/provider.dart';
import 'package:flutter/services.dart';
import 'dart:ui' as ui;
import 'dart:async';
import 'package:wakelock/wakelock.dart';
import '../common.dart';
import '../../common.dart';
import '../widgets/gestures.dart';
import '../models/model.dart';
import '../../models/model.dart';
import '../widgets/dialog.dart';
import '../widgets/overlay.dart';

View File

@ -6,8 +6,8 @@ import 'package:zxing2/qrcode.dart';
import 'dart:io';
import 'dart:async';
import 'dart:convert';
import '../common.dart';
import '../models/model.dart';
import '../../common.dart';
import '../../models/model.dart';
class ScanPage extends StatefulWidget {
@override

View File

@ -1,13 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter_hbb/models/model.dart';
import 'package:flutter_hbb/widgets/dialog.dart';
import 'package:flutter_hbb/mobile/widgets/dialog.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:provider/provider.dart';
import '../common.dart';
import '../models/server_model.dart';
import '../../common.dart';
import '../../models/server_model.dart';
import 'home_page.dart';
import '../models/model.dart';
import '../../models/model.dart';
class ServerPage extends StatelessWidget implements PageShape {
@override

View File

@ -4,9 +4,9 @@ import 'package:url_launcher/url_launcher.dart';
import 'package:provider/provider.dart';
import 'dart:convert';
import 'package:http/http.dart' as http;
import '../common.dart';
import '../../common.dart';
import '../widgets/dialog.dart';
import '../models/model.dart';
import '../../models/model.dart';
import 'home_page.dart';
import 'scan_page.dart';

View File

@ -2,8 +2,8 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import '../common.dart';
import '../models/model.dart';
import '../../common.dart';
import '../../models/model.dart';
void clientClose() {
msgBox('', 'Close', 'Are you sure to close the connection?');

View File

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_hbb/common.dart';
import 'package:toggle_switch/toggle_switch.dart';
import '../models/model.dart';
import '../../models/model.dart';
class GestureIcons {
static const String _family = 'gestureicons';

View File

@ -2,7 +2,7 @@ import 'package:draggable_float_widget/draggable_float_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/common.dart';
import '../models/model.dart';
import '../../models/model.dart';
import '../pages/chat_page.dart';
OverlayEntry? chatIconOverlayEntry;

View File

@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:dash_chat/dash_chat.dart';
import 'package:flutter/material.dart';
import '../widgets/overlay.dart';
import '../../mobile/widgets/overlay.dart';
import 'model.dart';
class MessageBody {

View File

@ -1,8 +1,8 @@
import 'dart:async';
import 'dart:convert';
import 'package:flutter_hbb/common.dart';
import 'package:flutter_hbb/pages/file_manager_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/mobile/pages/file_manager_page.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:path/path.dart' as Path;

View File

@ -12,8 +12,8 @@ import 'package:flutter/material.dart';
import 'package:tuple/tuple.dart';
import 'dart:async';
import '../common.dart';
import '../widgets/dialog.dart';
import '../widgets/overlay.dart';
import '../mobile/widgets/dialog.dart';
import '../mobile/widgets/overlay.dart';
import 'native_model.dart' if (dart.library.html) 'web_model.dart';
typedef HandleMsgBox = void Function(Map<String, dynamic> evt, String id);

View File

@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:wakelock/wakelock.dart';
import '../common.dart';
import '../pages/server_page.dart';
import '../mobile/pages/server_page.dart';
import 'model.dart';
const loginDialogTag = "LOGIN";

View File

@ -262,14 +262,14 @@ packages:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
version: "4.0.1"
image:
dependency: "direct main"
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.3"
version: "3.2.0"
image_picker:
dependency: "direct main"
description:
@ -297,7 +297,7 @@ packages:
name: image_picker_ios
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.5+2"
version: "0.8.5+5"
image_picker_platform_interface:
dependency: transitive
description:
@ -423,7 +423,7 @@ packages:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "4.4.0"
version: "5.0.0"
platform:
dependency: transitive
description:
@ -603,7 +603,7 @@ packages:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.3.1"
url_launcher:
dependency: "direct main"
description:
@ -624,7 +624,7 @@ packages:
name: url_launcher_ios
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.16"
version: "6.0.17"
url_launcher_linux:
dependency: transitive
description:
@ -715,7 +715,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.2"
version: "2.6.1"
xdg_directories:
dependency: transitive
description:
@ -729,7 +729,7 @@ packages:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "5.3.1"
version: "6.0.1"
yaml:
dependency: transitive
description:
@ -745,5 +745,5 @@ packages:
source: hosted
version: "0.1.0"
sdks:
dart: ">=2.17.0-0 <3.0.0"
dart: ">=2.17.0 <3.0.0"
flutter: ">=2.10.0"