Skip to content

Commit

Permalink
flutter 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangtian616 committed Aug 31, 2022
1 parent ff59d6f commit f548db8
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 50 deletions.
12 changes: 6 additions & 6 deletions .metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled.

version:
revision: f1875d570e39de09040c8f79aa13cc56baab8db1
revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
channel: stable

project_type: app
Expand All @@ -13,11 +13,11 @@ project_type: app
migration:
platforms:
- platform: root
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
- platform: linux
create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
- platform: windows
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543

# User provided section

Expand Down
35 changes: 20 additions & 15 deletions lib/src/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,11 @@ import 'network/eh_cache_interceptor.dart';
import 'network/eh_cookie_manager.dart';

void main() async {
FlutterError.onError = (FlutterErrorDetails details) {
Log.error(details.exception, null, details.stack);
Log.upload(details.exception, stackTrace: details.stack);
};
await init();

runZonedGuarded(() async {
await init();
runApp(const MyApp());
_doForDesktop();
}, (Object error, StackTrace stack) {
if (error is NotUploadException) {
return;
}
Log.error(error, null, stack);
Log.upload(error, stackTrace: stack);
});
runApp(const MyApp());

_doForDesktop();
}

class MyApp extends StatelessWidget {
Expand Down Expand Up @@ -84,6 +73,21 @@ class MyApp extends StatelessWidget {
}

Future<void> init() async {
FlutterError.onError = (FlutterErrorDetails details) {
Log.error(details.exception, null, details.stack);
Log.upload(details.exception, stackTrace: details.stack);
};

PlatformDispatcher.instance.onError = (error, stack) {
if (error is NotUploadException) {
return true;
}

Log.error('PlatformDispatcher Error', error, stack);
Log.upload(error, stackTrace: stack);
return false;
};

WidgetsFlutterBinding.ensureInitialized();

if (SentryConfig.dsn.isNotEmpty && !kDebugMode) {
Expand Down Expand Up @@ -137,6 +141,7 @@ void _doForDesktop() {
if (!GetPlatform.isDesktop) {
return;
}

doWhenWindowReady(() {
appWindow.title = 'JHenTai';
appWindow.show();
Expand Down
45 changes: 26 additions & 19 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.8.2"
version: "2.9.0"
audio_session:
dependency: transitive
description:
Expand Down Expand Up @@ -205,7 +205,7 @@ packages:
source: hosted
version: "8.3.3"
cached_network_image:
dependency: "direct main"
dependency: "direct overridden"
description:
name: cached_network_image
url: "https://pub.flutter-io.cn"
Expand All @@ -231,7 +231,7 @@ packages:
name: characters
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
version: "1.2.1"
charcode:
dependency: transitive
description:
Expand Down Expand Up @@ -273,7 +273,7 @@ packages:
name: clock
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.1.1"
code_builder:
dependency: transitive
description:
Expand Down Expand Up @@ -429,7 +429,7 @@ packages:
name: fake_async
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
version: "1.3.1"
ffi:
dependency: transitive
description:
Expand Down Expand Up @@ -621,12 +621,12 @@ packages:
source: hosted
version: "0.7.2"
fwfh_text_style:
dependency: transitive
dependency: "direct overridden"
description:
name: fwfh_text_style
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.7.3+2"
version: "2.22.08+1"
fwfh_url_launcher:
dependency: transitive
description:
Expand All @@ -635,7 +635,7 @@ packages:
source: hosted
version: "0.6.1+3"
fwfh_webview:
dependency: "direct main"
dependency: "direct overridden"
description:
name: fwfh_webview
url: "https://pub.flutter-io.cn"
Expand Down Expand Up @@ -669,6 +669,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.0"
grouped_list:
dependency: "direct main"
description:
name: grouped_list
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.1.2"
hashcodes:
dependency: transitive
description:
Expand Down Expand Up @@ -815,21 +822,21 @@ packages:
name: matcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.11"
version: "0.12.12"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.4"
version: "0.1.5"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.7.0"
version: "1.8.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -913,7 +920,7 @@ packages:
name: path
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.1"
version: "1.8.2"
path_drawing:
dependency: transitive
description:
Expand Down Expand Up @@ -1235,7 +1242,7 @@ packages:
name: source_span
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.2"
version: "1.9.0"
sqflite:
dependency: transitive
description:
Expand Down Expand Up @@ -1298,7 +1305,7 @@ packages:
name: string_scanner
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
version: "1.1.1"
syncfusion_flutter_charts:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1326,28 +1333,28 @@ packages:
name: term_glyph
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
version: "1.2.1"
test:
dependency: "direct dev"
description:
name: test
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.21.1"
version: "1.21.4"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.9"
version: "0.4.12"
test_core:
dependency: transitive
description:
name: test_core
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.13"
version: "0.4.16"
throttling:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1475,7 +1482,7 @@ packages:
source: hosted
version: "2.0.10"
visibility_detector:
dependency: "direct main"
dependency: "direct overridden"
description:
name: visibility_detector
url: "https://pub.flutter-io.cn"
Expand Down
9 changes: 6 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ dependencies:
clipboard: ^0.1.3
scrollable_positioned_list: ^0.3.2
flutter_list_view: ^1.1.18
fwfh_webview: ^0.6.2+3 # todo: remove
executor: ^2.2.2
retry: ^3.1.0
path: ^1.8.0
Expand All @@ -43,8 +42,6 @@ dependencies:
path_provider: ^2.0.9
flutter_slidable: ^2.0.0
flutter_widget_from_html: ^0.8.5
cached_network_image: ^3.2.1 # todo: remove
visibility_detector: ^0.3.3 # todo: remove
url_launcher: ^6.1.5
like_button: ^2.0.4
webview_flutter: ^3.0.4
Expand All @@ -68,12 +65,18 @@ dependencies:
receive_sharing_intent: ^1.4.5
bitsdojo_window: ^0.1.2
permission_handler: 9.2.0
grouped_list: ^5.1.2

dependency_overrides:
dio:
git:
url: https://gitee.com/jiangtian616/dio
path: dio
visibility_detector: ^0.3.3
cached_network_image: ^3.2.1
fwfh_webview: ^0.6.2+3
fwfh_text_style: ^2.22.8+1


dev_dependencies:
flutter_test:
Expand Down
2 changes: 1 addition & 1 deletion windows.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version=$(head -n 5 pubspec.yaml | tail -n 1 | cut -d ' ' -f 2)

flutter build windows -t lib/src/main.dart \
flutter build windows --build-name=JHenTai --build-number=${version} -t lib/src/main.dart \
&& cp -r build/windows/runner/Release/ ~/Desktop/JHenTai_${version}_windows/ \
&& cd ~/Desktop \
&& zip -ro JHenTai_${version}_windows.zip JHenTai_${version}_windows \
Expand Down
22 changes: 22 additions & 0 deletions windows/runner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
cmake_minimum_required(VERSION 3.14)
project(runner LANGUAGES CXX)

# Define the application target. To change its name, change BINARY_NAME in the
# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
# work.
#
# Any new source files that you add to the application should be added here.
add_executable(${BINARY_NAME} WIN32
"flutter_window.cpp"
"main.cpp"
Expand All @@ -10,8 +15,25 @@ add_executable(${BINARY_NAME} WIN32
"Runner.rc"
"runner.exe.manifest"
)

# Apply the standard set of build settings. This can be removed for applications
# that need different build settings.
apply_standard_settings(${BINARY_NAME})

# Add preprocessor definitions for the build version.
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")

# Disable Windows macros that collide with C++ standard library functions.
target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")

# Add dependency libraries and include directories. Add any application-specific
# dependencies here.
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")

# Run the Flutter tool portions of the build. This must not be removed.
add_dependencies(${BINARY_NAME} flutter_assemble)
12 changes: 6 additions & 6 deletions windows/runner/Runner.rc
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ IDI_APP_ICON ICON "resources\\app_icon.ico"
// Version
//

#ifdef FLUTTER_BUILD_NUMBER
#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)
#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD
#else
#define VERSION_AS_NUMBER 3,3,0
#define VERSION_AS_NUMBER 1,0,0,0
#endif

#ifdef FLUTTER_BUILD_NAME
#define VERSION_AS_STRING #FLUTTER_BUILD_NAME
#if defined(FLUTTER_VERSION)
#define VERSION_AS_STRING FLUTTER_VERSION
#else
#define VERSION_AS_STRING "3.3.0"
#define VERSION_AS_STRING "1.0.0"
#endif

VS_VERSION_INFO VERSIONINFO
Expand Down

0 comments on commit f548db8

Please sign in to comment.