11

Important note - I want this functionality for mobile apps only, not for flutter web.

I am having some trouble saving the website inside the flutter app. I have tried using the cache method and savewebarchive method for the inappwebview. The issue with the method is that it is not saving the full content of the website. It is only saving HTML and CSS files.

I want to save the whole website with all the content like HTML, CSS, js, font files, Images and store it inside the flutter app. I have gone through a few plugins but none of them were helpful.

I am looking for the same functionality as httrack.

Any right direction would be appriciated.

ch271828n
  • 15,854
  • 5
  • 53
  • 88
raj kavadia
  • 926
  • 1
  • 10
  • 30

3 Answers3

3

Without existing Flutter plugins, one of the quickest approach is to simply use Android and iOS plugins, and write a simple Flutter wrapper around it.

For android, you may be interested in this link. For iOS, this link may be helpful. These links are just examples - you can search further on Google to find out more plugins that suit your needs. (For example, search android kotlin save whole website etc).

After the solution is found on android and ios, you can develop a Flutter plugin very easily in order to let your Flutter code call those Android/iOS snippets. Personally I suggest use Kotlin for Android, Swift for iOS, and do not forget pigeon for code generation.

By the way, if you want to draw some UI with Android/iOS code instead of Flutter code, you may also be interested in platform views.

ch271828n
  • 15,854
  • 5
  • 53
  • 88
1

Since you asked for some directions:

If you already know which websites you want to be able to view offline, you can use HTTrack to download them and bundle the files generated in your Flutter application.

If you want to be able to dynamically download websites, there is currently no Dart/Flutter package that will do the website ripping for you. You would either have to implement it yourself, or perhaps make an API that would use an already made program (HTTrack for example) and then send the files to your application.

Bruno Kinast
  • 1,068
  • 4
  • 17
-1

You can use webview_flutter and html plugin to download whole website as code, store it as a String variable then you can open it by using webview_flutter.

Zahid Tekbaş
  • 809
  • 2
  • 12
  • 27