Skip to content

Commit

Permalink
Merge branch 'main' into fix/ImageDataKey
Browse files Browse the repository at this point in the history
  • Loading branch information
siguangli authored Aug 17, 2023
2 parents 0717b19 + c88fbb6 commit 5ca2ec0
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 125 deletions.
4 changes: 4 additions & 0 deletions framework/voltron/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## 0.0.32

- fix navigation bar color error after modal show

## 0.0.32

- fix crash on debug mode

## 0.0.31
Expand Down
13 changes: 8 additions & 5 deletions framework/voltron/example/lib/base_voltron_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class CustomExceptionHandler extends VoltronExceptionHandlerAdapter {
void handleJsException(JsError exception) {
LogUtils.e('Voltron3Page', exception.toString());
var currentRootContext = key.currentContext;

/// 只有开发模式下把js异常抛出来
if (currentRootContext == null || !isDebugMode) return;
showDialog(
Expand Down Expand Up @@ -94,13 +95,15 @@ class CustomExceptionHandler extends VoltronExceptionHandlerAdapter {
}

class BaseVoltronPage extends StatefulWidget {
final String title;
final bool isHome;
final bool debugMode;
final String coreBundle;
final String indexBundle;
final String remoteServerUrl;

BaseVoltronPage({
this.title = '',
this.isHome = false,
this.debugMode = false,
this.coreBundle = '',
Expand Down Expand Up @@ -229,6 +232,11 @@ class _BaseVoltronPageState extends State<BaseVoltronPage> {
Widget child;
if (engineStatus == PageStatus.success) {
child = Scaffold(
appBar: AppBar(
title: Text(
widget.title,
),
),
body: VoltronWidget(
loader: _jsLoader,
loadingBuilder: _debugMode ? null : (context) => Container(),
Expand All @@ -241,11 +249,6 @@ class _BaseVoltronPageState extends State<BaseVoltronPage> {
} else {
child = Container();
}
child = SafeArea(
key: dialogRootKey,
bottom: false,
child: child,
);
return WillPopScope(
onWillPop: () async {
return !(_jsLoader.back(() {
Expand Down
12 changes: 9 additions & 3 deletions framework/voltron/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ void main() {
// debugPrintRebuildDirtyWidgets = true; // 记录每帧重建的 widget
// debugProfilePaintsEnabled = true;
if (Platform.isAndroid) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light.copyWith(
statusBarColor: Colors.black,
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
systemNavigationBarColor: Color(0XFFE5E5E5),
));
}
runApp(MyApp());
}

class _MyWidgetInspector with WidgetInspectorService {
static void init() {
WidgetInspectorService.instance = _MyWidgetInspector();
Expand Down Expand Up @@ -93,7 +94,9 @@ class _MyHomePageState extends State<MyHomePage> {
return Scaffold(
backgroundColor: const Color(0XFFE5E5E5),
appBar: AppBar(
title: const Text('Demo'),
title: const Text(
'Demo',
),
),
body: Center(
child: Column(
Expand Down Expand Up @@ -168,6 +171,7 @@ class _MyHomePageState extends State<MyHomePage> {
context,
MaterialPageRoute(
builder: (context) => BaseVoltronPage(
title: 'Vue 2.0',
coreBundle: "assets/jsbundle/vue2/vendor.android.js",
indexBundle: "assets/jsbundle/vue2/index.android.js",
),
Expand All @@ -183,6 +187,7 @@ class _MyHomePageState extends State<MyHomePage> {
context,
MaterialPageRoute(
builder: (context) => BaseVoltronPage(
title: 'Vue 3.0',
coreBundle: "assets/jsbundle/vue3/vendor.android.js",
indexBundle: "assets/jsbundle/vue3/index.android.js",
),
Expand All @@ -198,6 +203,7 @@ class _MyHomePageState extends State<MyHomePage> {
context,
MaterialPageRoute(
builder: (context) => BaseVoltronPage(
title: 'React',
coreBundle: "assets/jsbundle/react/vendor.android.js",
indexBundle: "assets/jsbundle/react/index.android.js",
),
Expand Down
100 changes: 0 additions & 100 deletions framework/voltron/example/lib/voltron_demo_page.dart

This file was deleted.

4 changes: 2 additions & 2 deletions framework/voltron/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

name: voltron
description: A flutter plugin project to render hippy page.
version: 0.0.32
version: 0.0.33
homepage: https://hippyjs.org
repository: https://github.com/Tencent/Hippy

Expand Down Expand Up @@ -60,7 +60,7 @@ dependencies:
connectivity_plus: ^3.0.6
uuid: ^3.0.6
ffi: ^2.0.0
voltron_renderer: 0.0.21
voltron_renderer: 0.0.23
voltron_vfs: 0.0.6
voltron_ffi: 0.0.5

Expand Down
4 changes: 4 additions & 0 deletions renderer/voltron/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.23

- fix navigation bar color error after modal show

## 0.0.22

- fix crash on debug mode
Expand Down
35 changes: 21 additions & 14 deletions renderer/voltron/lib/viewmodel/modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,22 +188,29 @@ class ModalRenderViewModel extends GroupViewModel implements InstanceLifecycleEv
} else {
content = SafeArea(child: child);
}
content = Scaffold(
backgroundColor: const Color(0x01ffffff),
resizeToAvoidBottomInset: true,
body: WillPopScope(
onWillPop: () async {
onRequestClose();
return false;
},
child: content,
),
);
if (statusBarTextDarkColor) {
content = AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle(
statusBarIconBrightness: Brightness.dark,
statusBarBrightness: Brightness.light,
),
child: content,
);
}
return Material(
type: MaterialType.transparency,
child: Scaffold(
backgroundColor: const Color(0x01ffffff),
resizeToAvoidBottomInset: true,
body: AnnotatedRegion<SystemUiOverlayStyle>(
value: statusBarTextDarkColor ? SystemUiOverlayStyle.dark : SystemUiOverlayStyle.light,
child: WillPopScope(
onWillPop: () async {
onRequestClose();
return false;
},
child: content,
),
),
),
child: content,
);
}

Expand Down
2 changes: 1 addition & 1 deletion renderer/voltron/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

name: voltron_renderer
description: voltron renderer
version: 0.0.22
version: 0.0.23
homepage: https://hippyjs.org
repository: https://github.com/Tencent/Hippy

Expand Down

0 comments on commit 5ca2ec0

Please sign in to comment.