0
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() => runApp(MaterialApp(home: Home(),));

class Home extends StatefulWidget{
  @override
  _HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return
      Scaffold(
        appBar: AppBar(
          title: Text('ESP32'),
          centerTitle: true,
        ),
        body: WebView(initialUrl: 'https://192.168.4.1',javascriptMode: JavascriptMode.unrestricted,),
      );
  }
}

So I have this code and I am trying to display the content from esp32 through the ip address but I keep on getting an error, net:ERR_CONNECTION_REFUSED. Looked through multiple threads but could not find the issue. Does anyone know what I'm doing wrong? It works on the IOS emulator but not the android emulator.

I tried adding :8000 and the solution from here why is flutter refusing to connect on localhost:8000 or 127.0.01:8000? but didnt work.

newbie123
  • 3
  • 1

0 Answers0