Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch image #229

Merged
merged 19 commits into from
Aug 12, 2023
Merged

Fetch image #229

merged 19 commits into from
Aug 12, 2023

Conversation

gguijarro-c-chwy
Copy link
Contributor

No description provided.

@gguijarro-c-chwy
Copy link
Contributor Author

gguijarro-c-chwy commented Aug 3, 2023

@n13 I need ur help here. I spent way too long already trying to figure out this Image stuff for the Daos.
Im about to just add the images to our firebase and be done with it.

children: [
Text(dao.settingsDaoTitle, style: context.hyphaTextTheme.smallTitles),
Text(
'dao.hypha.earth/${dao.settingsDaoUrl}',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this field was called short URL or something

class IPFSManager {
final apiKey = 'apiKey';
final apiKeySecret = 'apiKeySecret';
final serverUlr = 'https://ipfs.infura.io:5001';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok... guess we need secret - let's load it from firebase?! At least it won't be in the code then..

}

Future getImage(String imageToken) async {
final response = await ipfsClient.read(dir: imageToken);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@n13 this doesnt work. it fail. can you take a look when you get some time pls.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm

@n13
Copy link
Collaborator

n13 commented Aug 11, 2023

Ok so this item is in limbo because the IPFS access isn't working?

Or is it working now with our .env file?

@gguijarro-c-chwy

@n13
Copy link
Collaborator

n13 commented Aug 12, 2023

Current status: Not working.

IPFS access isn't working yet

@n13
Copy link
Collaborator

n13 commented Aug 12, 2023

Some examples of IPFS images

flutter: ║                 memberof: [
flutter: ║                    {
flutter: ║                         docId: "29983",
flutter: ║                         details_daoName_n: "hypha",
flutter: ║                         settings: [
flutter: ║                            {
flutter: ║                                 settings_daoTitle_s: "Hypha DAO",
flutter: ║                                 settings_isHypha_i: 1,
flutter: ║                                 "QmV3KmaoqCCXuCDvHzYWS9Jg3RfjrDTQSXK1e7453qfSRS:svg"
flutter: ║                                 settings_daoUrl_s: "hypha"
flutter: ║                            }
flutter: ║                         ]
flutter: ║                    },
flutter: ║                    {
flutter: ║                         docId: "31631",
flutter: ║                         details_daoName_n: "lightleaders",
flutter: ║                         settings: [
flutter: ║                            {
flutter: ║                                 settings_daoTitle_s: "The Lightleaders",
flutter: ║                                 settings_isHypha_i: null,
flutter: ║                                 "QmUyxopcxMLMPmo4UWDrE5d4P3yka4AwWJH4MASxpcWeEy:png"
flutter: ║                                 settings_daoUrl_s: "thelightleaders"
flutter: ║                            }
flutter: ║                         ]
flutter: ║                    },
flutter: ║                    {
flutter: ║                         docId: "31991",
flutter: ║                         details_daoName_n: "demoxdaox",
flutter: ║                         settings: [
flutter: ║                            {
flutter: ║                                 settings_daoTitle_s: "Demo DAO",
flutter: ║                                 settings_isHypha_i: null,
flutter: ║                                 "QmNMv449YPqbWVncve9eyNZfgi2RKwujCDmeUfBhjyX9j4:jpeg"
flutter: ║                                 settings_daoUrl_s: "demoxdaox"
flutter: ║                            }
flutter: ║                         ]
flutter: ║                    },
flutter: ║                    {
flutter: ║                         docId: "43454",
flutter: ║                         details_daoName_n: "theflow",
flutter: ║                         settings: [
flutter: ║                            {
flutter: ║                                 settings_daoTitle_s: "THE FLOW",
flutter: ║                                 settings_isHypha_i: null,
flutter: ║                                 "QmbyW3yY7jTjUi6XCkSy5GMsPDtonXBQ6e5nTFj3Dh6P9z:jpeg"
flutter: ║                                 settings_daoUrl_s: "the-flow"
flutter: ║                            }
flutter: ║                         ]
flutter: ║                    }
flutter: ║                 ],

@n13
Copy link
Collaborator

n13 commented Aug 12, 2023

@n13
Copy link
Collaborator

n13 commented Aug 12, 2023

https://ipfs.io/ipfs/QmV3KmaoqCCXuCDvHzYWS9Jg3RfjrDTQSXK1e7453qfSRS

this also works... in the browser.. it's an svg

@n13
Copy link
Collaborator

n13 commented Aug 12, 2023

Ok all done @gguijarro-c-chwy - it's working so I am leaving it with you to put the files in the right places and so on... I made a new image widget IPFSImage for showing the URLs.

Note that the Hypha SVG has an error but that's because our library doesn't support some attributes, and won't - we need to fix the SVG and in any case using SVGs there isn't going to work well, it should be bitmaps.

Reference Here: dnfield/flutter_svg#105

image

@n13
Copy link
Collaborator

n13 commented Aug 12, 2023

The linter complains there's no .env file... a conundrum...

@gguijarro-c-chwy gguijarro-c-chwy merged commit 077b969 into main Aug 12, 2023
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants