1

this is what I would like to doI'm new to flutter and programming for phone apps in general so bear with me. I have a list when I press something on that list(tap on an element) it will open a new screen with description of that pressed thing(element). Inside that description there is a 'link'(name of a another element that belongs to aforementioned list) when I press that 'link' I would like to go to that elements description. Is that something that is done with navigator?

I tried url_launcher that launches link on web browser(links provided with api exist on webpage). I want that to happen internally.

1 Answer 1

1

You can use webview_flutter plugin.

When press the link, pass the link to WebViewExample.

Ex:

import 'dart:io';    
import 'package:flutter/cupertino.dart';
import 'package:webview_flutter/webview_flutter.dart';

class WebViewExample extends StatefulWidget {
  final url;
  const WebViewExample(this.url, {Key? key}) : super(key: key);

  @override
  _WebViewExampleState createState() => _WebViewExampleState();
}

class _WebViewExampleState extends State<WebViewExample> {
  @override
  void initState() {
    super.initState();
    // Enable virtual display.
    if (Platform.isAndroid) WebView.platform = AndroidWebView();
  }

  @override
  Widget build(BuildContext context) {
    return WebView(
      initialUrl: widget.url,
    );
  }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.