我已经决定取消一些插件,我认为它们是不必要的颤振开发,以使安卓工作室更轻。
PLease为颤振开发提供了有用和无用的插件列表.
顺便问一下,我想知道下面提到的插件是否有用?
1. kotlin插件对颤振有用吗?2. 2.Markdown支持插件3.2.Markdown导航插件4. 4.Gauge 5.Android APK支持6.APK link助手7.Android NDK支持8. 8.Covergae 9.EditorConfig 10. 10.Google云工具为android studio 12.118n提供支持java 13.Groovy 14.Intellij配置脚本15.Intelliang 16.java字节代码反编译器17.java流调试器18.JUnit 19.Kotlin 20.Mercurial‘21属性支持22.Settings 23 23.smali支持24.Sub版本25任务管理测试记录器27.TestNG-J
发布于 2019-09-17 02:30:38
将html文件放入web服务器并以字符串形式加载这些html文件。
代码段
_loadHtmlFromAssets() async {
String url = 'http://test.com/Android/sample.html';
Response response = await get(url);
// sample info available in response
String fileText = response.body;
_controller.loadUrl( Uri.dataFromString(
fileText,
mimeType: 'text/html',
encoding: Encoding.getByName('utf-8')
).toString());
}全码
import 'package:flutter/material.dart';
import 'dart:convert';
import 'package:flutter/services.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:http/http.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
),
home: HelpScreen(),
);
}
}
class HelpScreen extends StatefulWidget {
@override
HelpScreenState createState() {
return HelpScreenState();
}
}
class HelpScreenState extends State<HelpScreen> {
WebViewController _controller;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Help')),
body: SingleChildScrollView(
child: Column(
children: <Widget>[
Container(
height: 300,
child: WebView(
initialUrl: '',
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
_controller = webViewController;
},
),
),
IconButton(
icon: const Icon(
Icons.thumb_up,
semanticLabel: 'Thumbs up',
),
onPressed: () {
_loadHtmlFromAssets();
},
),
],
),
),
);
}
_loadHtmlFromAssets() async {
//String fileText = await rootBundle.loadString('assets/help.html');
String url = 'http://test.com/Android/sample.html';
Response response = await get(url);
// sample info available in response
String fileText = response.body;
_controller.loadUrl( Uri.dataFromString(
fileText,
mimeType: 'text/html',
encoding: Encoding.getByName('utf-8')
).toString());
}
}演示

https://stackoverflow.com/questions/57957348
复制相似问题