flutter web on GitHub Pages not showing content
Asked Answered
A

2

6

I am trying to release my existing flutter project on the web (it already is working on iOS and android).

According to this great article: How to embed your Flutter app in WordPress

I got to the point where I copied the build/web folder to my repository and pushed to master. I ensured everything exist in the repository.

yet NOTHING APPEARS on https://username.github.io/app_folder

Just a blank page :(

Arne answered 18/10, 2020 at 16:10 Comment(0)
A
19

Found the problem in: repository_folder/app_folder/index.html

When I deleted the following line, everything worked:

<base href="/">
Arne answered 18/10, 2020 at 16:10 Comment(3)
Instead of commenting out or deleting that line of code, what is the proper way of redirecting the route?Puritanism
Hi @SawThinkarNayHtoo Did you found a proper solution to this?Mossman
@Mossman Here is a workaround. github.com/flutter/flutter/issues/69287 Same idea about deleting that line, but make changes in the .yml file of the .github folder so that you do not have to do it manually every time.Puritanism
L
0

Just change your
<base href="/"> in the index.html file to

<base href="/<your_repository_name>/">

for example my repository name is crnb then change <base href="/"> to <base href="/crnb/">

This will surely work

Lisette answered 24/4, 2022 at 9:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.