Skip to content

Commit

Permalink
migrate webview impl to use updated library
Browse files Browse the repository at this point in the history
  • Loading branch information
crc-32 committed May 28, 2024
1 parent c275e02 commit 6b6d2eb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class DeviceTransport @Inject constructor(
}
btDevice?.type == BluetoothDevice.DEVICE_TYPE_LE -> { // LE only device
BlueLEDriver(
context,
protocolHandler
context = context,
protocolHandler = protocolHandler
) {
flutterPreferences.shouldActivateWorkaround(it)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.rebble.cobble.bridges.common
import io.rebble.cobble.BuildConfig
import io.rebble.cobble.bluetooth.scan.BleScanner
import io.rebble.cobble.bluetooth.scan.ClassicScanner
import io.rebble.cobble.bluetooth.toPigeon
import io.rebble.cobble.bridges.FlutterBridge
import io.rebble.cobble.bridges.ui.BridgeLifecycleController
import io.rebble.cobble.pigeons.Pigeons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private inline fun <T> SharedPreferences.flow(

val listener = SharedPreferences
.OnSharedPreferenceChangeListener { sharedPreferences: SharedPreferences,
changedKey: String ->
changedKey: String? ->

if (changedKey == key) {
trySend(mapper(sharedPreferences, key)).isSuccess
Expand Down
14 changes: 9 additions & 5 deletions lib/ui/home/tabs/store_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ class StoreTab extends StatefulWidget implements CobbleScreen {
}

class _StoreTabState extends State<StoreTab> {
late WebViewController controller;
@override
void initState() {
super.initState();
controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..loadRequest(Uri.parse('https://store-beta.rebble.io/?native=true&platform=android'));
}
@override
Widget build(BuildContext context) {
return CobbleScaffold.tab(
child: WebView(
initialUrl:
"https://store-beta.rebble.io/?native=true&platform=android",
javascriptMode: JavascriptMode.unrestricted,
),
child: WebViewWidget(controller: controller),
);
}
}

0 comments on commit 6b6d2eb

Please sign in to comment.