Skip to content

Instantly share code, notes, and snippets.

@PiotrWpl
Created April 5, 2019 07:31
Show Gist options
  • Save PiotrWpl/c556f2bc7b403c64eebbc5a467df08d9 to your computer and use it in GitHub Desktop.
Save PiotrWpl/c556f2bc7b403c64eebbc5a467df08d9 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
void main() => runApp(MaterialApp(home: CrashingWebViewExample()));
class CrashingWebViewExample extends StatelessWidget {
@override
Widget build(BuildContext context) {
final double maxHeight = MediaQuery.of(context).size.height;
print("maxHeight: $maxHeight");
return SingleChildScrollView(
child: Column(
children: <Widget>[
Container(
padding: const EdgeInsets.all(20),
color: Colors.redAccent,
child: const Text("My Red TextWidget")
),
Container(
height: maxHeight,
child: WebView(
initialUrl: 'https://en.wikipedia.org/wiki/Cephalopod_size',
),
),
Container(
padding: const EdgeInsets.all(20),
color: Colors.blue,
child: const Text("My Blue TextWidget")
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment