hh_android_webview 1.0.0
hh_android_webview: ^1.0.0 copied to clipboard
自定义Android原生插件库
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:hh_android_webview/hh_android.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('AI Assistant'),
),
body: Center(
child: Column(
children: [
ElevatedButton(
onPressed: () {
hhAndroid.openAssistantSheet("http://172.16.130.108:3002/");
},
child: Text("Open Assistant"),
),
ElevatedButton(
onPressed: () {
hhAndroid.openUrl("http://172.16.130.108:3002/#/settings", {'id': 123});
},
child: Text("Open Settings"),
)
],
),
),
),
);
}
}