Skip to content

Commit 53938c0

Browse files
committed
some adjustment
1 parent 1f55ffc commit 53938c0

File tree

11 files changed

+137
-105
lines changed

11 files changed

+137
-105
lines changed

example/.metadata

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "35c388afb57ef061d06a39b537336c87e0e3d1b1"
7+
revision: "077b4a4ce10a07b82caa6897f0c626f9c0a3ac90"
88
channel: "stable"
99

1010
project_type: app
@@ -13,26 +13,26 @@ project_type: app
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
17-
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
16+
create_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
17+
base_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
1818
- platform: android
19-
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
20-
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
19+
create_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
20+
base_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
2121
- platform: ios
22-
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
23-
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
22+
create_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
23+
base_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
2424
- platform: linux
25-
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
26-
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
25+
create_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
26+
base_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
2727
- platform: macos
28-
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
29-
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
28+
create_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
29+
base_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
3030
- platform: web
31-
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
32-
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
31+
create_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
32+
base_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
3333
- platform: windows
34-
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
35-
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
34+
create_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
35+
base_revision: 077b4a4ce10a07b82caa6897f0c626f9c0a3ac90
3636

3737
# User provided section
3838

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip

example/android/settings.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ pluginManagement {
1818

1919
plugins {
2020
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
21-
id("com.android.application") version "8.7.0" apply false
22-
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
21+
id("com.android.application") version "8.7.3" apply false
22+
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
2323
}
2424

2525
include(":app")
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
import lldb
6+
7+
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
8+
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
9+
base = frame.register["x0"].GetValueAsAddress()
10+
page_len = frame.register["x1"].GetValueAsUnsigned()
11+
12+
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
13+
# first page to see if handled it correctly. This makes diagnosing
14+
# misconfiguration (e.g. missing breakpoint) easier.
15+
data = bytearray(page_len)
16+
data[0:8] = b'IHELPED!'
17+
18+
error = lldb.SBError()
19+
frame.GetThread().GetProcess().WriteMemory(base, data, error)
20+
if not error.Success():
21+
print(f'Failed to write into {base}[+{page_len}]', error)
22+
return
23+
24+
def __lldb_init_module(debugger: lldb.SBDebugger, _):
25+
target = debugger.GetDummyTarget()
26+
# Caveat: must use BreakpointCreateByRegEx here and not
27+
# BreakpointCreateByName. For some reasons callback function does not
28+
# get carried over from dummy target for the later.
29+
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
30+
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
31+
bp.SetAutoContinue(True)
32+
print("-- LLDB integration loaded --")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
command script import --relative-to-command-file flutter_lldb_helper.py

example/lib/demo/issue235_toast.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ class MyApp extends StatelessWidget {
3434
);
3535
}
3636

37-
Future show(String msg) {
38-
return SmartDialog.showToast(
37+
Future show(String msg) async{
38+
await SmartDialog.dismiss();
39+
await SmartDialog.showToast(
3940
msg,
4041
alignment: Alignment.center,
42+
displayTime: const Duration(seconds: 2),
4143
displayType: SmartToastType.last,
42-
displayTime: const Duration(seconds: 3),
4344
);
4445
}
4546
}
Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,77 @@
1-
import 'package:flutter/material.dart';
2-
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
3-
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
4-
5-
void main() {
6-
runApp(MaterialApp(
7-
navigatorObservers: [FlutterSmartDialog.observer],
8-
builder: FlutterSmartDialog.init(),
9-
home: const MyApp(),
10-
));
11-
}
12-
13-
class MyApp extends StatelessWidget {
14-
const MyApp({super.key});
15-
16-
@override
17-
Widget build(BuildContext context) {
18-
return Scaffold(
19-
appBar: AppBar(
20-
title: const Text("Test"),
21-
),
22-
body: Center(
23-
child: Builder(builder: (ctx) {
24-
return ElevatedButton(
25-
onPressed: () => showWebDialog(ctx),
26-
child: const Text("Click"),
27-
);
28-
}),
29-
),
30-
);
31-
}
32-
33-
void showWebDialog(BuildContext context) {
34-
SmartDialog.show(
35-
clickMaskDismiss: true,
36-
alignment: Alignment.bottomCenter,
37-
builder: (context) => Container(
38-
height: 400,
39-
padding: const EdgeInsets.symmetric(horizontal: 12),
40-
child: InAppWebView(
41-
initialData: InAppWebViewInitialData(
42-
data: _buildHtmlContent(''),
43-
mimeType: 'text/html',
44-
encoding: 'utf-8',
45-
),
46-
),
47-
),
48-
);
49-
}
50-
51-
String _buildHtmlContent(String content) {
52-
return '''
53-
<!DOCTYPE html>
54-
<html>
55-
<head>
56-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
57-
<style>
58-
body {
59-
margin: 0;
60-
padding: 0;
61-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
62-
line-height: 1.5;
63-
color: #333;
64-
}
65-
img {
66-
max-width: 100%;
67-
height: auto;
68-
}
69-
</style>
70-
</head>
71-
<body>
72-
$content
73-
</body>
74-
</html>
75-
''';
76-
}
77-
}
1+
// import 'package:flutter/material.dart';
2+
// import 'package:flutter_inappwebview/flutter_inappwebview.dart';
3+
// import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
4+
//
5+
// void main() {
6+
// runApp(MaterialApp(
7+
// navigatorObservers: [FlutterSmartDialog.observer],
8+
// builder: FlutterSmartDialog.init(),
9+
// home: const MyApp(),
10+
// ));
11+
// }
12+
//
13+
// class MyApp extends StatelessWidget {
14+
// const MyApp({super.key});
15+
//
16+
// @override
17+
// Widget build(BuildContext context) {
18+
// return Scaffold(
19+
// appBar: AppBar(
20+
// title: const Text("Test"),
21+
// ),
22+
// body: Center(
23+
// child: Builder(builder: (ctx) {
24+
// return ElevatedButton(
25+
// onPressed: () => showWebDialog(ctx),
26+
// child: const Text("Click"),
27+
// );
28+
// }),
29+
// ),
30+
// );
31+
// }
32+
//
33+
// void showWebDialog(BuildContext context) {
34+
// SmartDialog.show(
35+
// clickMaskDismiss: true,
36+
// alignment: Alignment.bottomCenter,
37+
// builder: (context) => Container(
38+
// height: 400,
39+
// padding: const EdgeInsets.symmetric(horizontal: 12),
40+
// child: InAppWebView(
41+
// initialData: InAppWebViewInitialData(
42+
// data: _buildHtmlContent(''),
43+
// mimeType: 'text/html',
44+
// encoding: 'utf-8',
45+
// ),
46+
// ),
47+
// ),
48+
// );
49+
// }
50+
//
51+
// String _buildHtmlContent(String content) {
52+
// return '''
53+
// <!DOCTYPE html>
54+
// <html>
55+
// <head>
56+
// <meta name="viewport" content="width=device-width, initial-scale=1.0">
57+
// <style>
58+
// body {
59+
// margin: 0;
60+
// padding: 0;
61+
// font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
62+
// line-height: 1.5;
63+
// color: #333;
64+
// }
65+
// img {
66+
// max-width: 100%;
67+
// height: auto;
68+
// }
69+
// </style>
70+
// </head>
71+
// <body>
72+
// $content
73+
// </body>
74+
// </html>
75+
// ''';
76+
// }
77+
// }

example/macos/Flutter/GeneratedPluginRegistrant.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import FlutterMacOS
66
import Foundation
77

8-
import flutter_inappwebview_macos
98

109
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
11-
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
1210
}

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies:
3030
cupertino_icons: ^1.0.0
3131
# 用于处理widget是否可见检测 https://pub.flutter-io.cn/packages/visibility_detector
3232
visibility_detector:
33-
flutter_inappwebview: ^6.1.5
33+
# flutter_inappwebview: ^6.1.5
3434
# mac
3535
flutter_smart_dialog:
3636
path: ../

example/windows/flutter/generated_plugin_registrant.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
#include "generated_plugin_registrant.h"
88

9-
#include <flutter_inappwebview_windows/flutter_inappwebview_windows_plugin_c_api.h>
109

1110
void RegisterPlugins(flutter::PluginRegistry* registry) {
12-
FlutterInappwebviewWindowsPluginCApiRegisterWithRegistrar(
13-
registry->GetRegistrarForPlugin("FlutterInappwebviewWindowsPluginCApi"));
1411
}

0 commit comments

Comments
 (0)