25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

47 satır
961 B

  1. import 'package:flutter/material.dart';
  2. import "package:webview_universal/webview_universal.dart";
  3. void main(List<String> args) {
  4. runApp(const MaterialApp(
  5. home: MyApp(),
  6. ));
  7. }
  8. class MyApp extends StatefulWidget {
  9. const MyApp({super.key});
  10. @override
  11. State<MyApp> createState() => _MyAppState();
  12. }
  13. class _MyAppState extends State<MyApp> {
  14. WebViewController webViewController = WebViewController();
  15. @override
  16. void initState() {
  17. super.initState();
  18. webViewController.init(
  19. context: context,
  20. setState: setState,
  21. uri: Uri.parse("https://flutter.dev"),
  22. );
  23. }
  24. @override
  25. Widget build(BuildContext context) {
  26. return Scaffold(
  27. appBar: AppBar(
  28. leading: FloatingActionButton(
  29. onPressed: () {
  30. webViewController.goBackSync();
  31. },
  32. child: Icon(Icons.abc),
  33. ),
  34. ),
  35. body: WebView(
  36. controller: webViewController,
  37. ),
  38. );
  39. }
  40. }