I have Provider on top of MyApp, and the webview is still opening with a blank screen. No errors, no suggestions it just opening with a blank screen and not loading. If i put a web address in the url is working fine but i want to have this dynamic.
runApp(
Provider<Events>.value(
value: Events(),
child: MyApp(),
),
);
class Events {
final String imagePath, site;
Events({
this.imagePath, this.site
});
final events = [
castel,
lake,
];
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import '../model/events.dart';
import './flutter_web.dart';
class Site extends StatelessWidget {
@override
Widget build(BuildContext context) {
final events = Provider.of<Events>(context);
return Container(
padding: const EdgeInsets.all(4.0),
child: Container(
child: IconButton(
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => FlutterWeb(events.site),
),
),
icon: Icon(
FontAwesomeIcons.internetExplorer,
size: 30.0,
color: Colors.lightBlue,
),
),
),
);
}
}
return WebView(
initialUrl: events.site,
)
