添加图像到flutter分支sdk包



是否有办法从目录路径或从资产文件夹添加图像到分支sdk flutter包生成的链接,而不是网络图像链接?

buo = BranchUniversalObject(
canonicalIdentifier: 'flutter/branch',
//parameter canonicalUrl
//If your content lives both on the web and in the app, make sure you set its canonical URL
// (i.e. the URL of this piece of content on the web) when building any BUO.
// By doing so, we’ll attribute clicks on the links that you generate back to their original web page,
// even if the user goes to the app instead of your website! This will help your SEO efforts.
canonicalUrl: 'https://flutter.dev',
title: 'Flutter Branch Plugin',
imageUrl:
'https://flutter.dev/assets/flutter-lockup-4cb0ee072ab312e59784d9fbf4fb7ad42688a7fdaea1270ccf6bbf4f34b7e03f.svg',
contentDescription: 'Flutter Branch Description',
/*
contentMetadata: BranchContentMetaData()
..addCustomMetadata('custom_string', 'abc')
..addCustomMetadata('custom_number', 12345)
..addCustomMetadata('custom_bool', true)
..addCustomMetadata('custom_list_number', [1, 2, 3, 4, 5])
..addCustomMetadata('custom_list_string', ['a', 'b', 'c']),
*/
contentMetadata: metadata,
keywords: ['Plugin', 'Branch', 'Flutter'],
publiclyIndex: true,
locallyIndex: true,
expirationDateInMilliSec:
DateTime.now().add(Duration(days: 365)).millisecondsSinceEpoch);

示例:

孩子:图像(图片:AssetImage(资产/logo.png '),),//在.dart文件中//然后

资产:

  • /logo.png资产//在pubspec。yaml文件

你也可以点击这个链接:https://docs.flutter.dev/development/ui/assets-and-images

相关内容

  • 没有找到相关文章

最新更新