Skip to content

Instantly share code, notes, and snippets.

@VB10
Last active April 3, 2020 12:18
Show Gist options
  • Select an option

  • Save VB10/491dd6833744b7d543c2c9627034e01a to your computer and use it in GitHub Desktop.

Select an option

Save VB10/491dd6833744b7d543c2c9627034e01a to your computer and use it in GitHub Desktop.
ExpansionTile Top&Bottom Color Change
Widget customTheme(Widget child, BuildContext context) => Theme(
data: Theme.of(context).copyWith(
dividerColor: Colors.transparent,
dividerTheme: DividerThemeData(
color: Theme.of(context).colorScheme.background)),
child: child,
);
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
import 'package:webview_flutter/webview_flutter.dart';
import './pdf_web_view_view_model.dart';
import 'dart:html' as html;
class PdfWebViewView extends PdfWebViewViewModel {
// String samplePdf = "http://www.africau.edu/images/default/sample.pdf";
// final Set<JavascriptChannel> jsChannels = [
// JavascriptChannel(
// name: 'Print',
// onMessageReceived: (JavascriptMessage message) {
// print(message.message);
// }),
// ].toSet();
@override
void initState() {
super.initState();
ui.platformViewRegistry.registerViewFactory(
'hello-world-html',
(int viewId) => IFrameElement()
..width = '640'
..height = '360'
..src = 'https://www.youtube.com/embed/IyFZznAk69U'
..style.border = 'none');
}
@override
Widget build(BuildContext context) {
// Replace this with your build function
return Scaffold(
floatingActionButton: FloatingActionButton(
onPressed: () {
html.window.open('http: ///www.website.com/document.pdf', "v");
},
),
body: HtmlContainer(
child: html.DivElement(),
padding: EdgeInsets.all(8),
),
// body: Uri.dataFromString('<html><body>hello world</body></html>', mimeType: 'text/html').toString()
// ,
);
return WebviewScaffold(
url: "https://www.google.com",
// javascriptChannels: jsChannels,
supportMultipleWindows: true,
allowFileURLs: true,
ignoreSSLErrors: true,
withOverviewMode: true,
withLocalStorage: true,
withJavascript: true,
appCacheEnabled: true,
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment