publish --dry-run

This commit is contained in:
v7lin 2022-03-29 11:05:26 +08:00
parent dea2af9918
commit dc6b767895

View File

@ -136,21 +136,21 @@ class _HomeState extends State<Home> {
ListTile( ListTile(
title: const Text('网页分享'), title: const Text('网页分享'),
onTap: () async { onTap: () async {
final File file = await DefaultCacheManager().getSingleFile( // final File file = await DefaultCacheManager().getSingleFile(
'https://www.baidu.com/img/bd_logo1.png?where=super'); // 'https://www.baidu.com/img/bd_logo1.png?where=super');
final image.Image thumbnail = // final image.Image thumbnail =
image.decodeImage(file.readAsBytesSync())!; // image.decodeImage(file.readAsBytesSync())!;
Uint8List thumbData = thumbnail.getBytes(); // Uint8List thumbData = thumbnail.getBytes();
if (thumbData.length > 32 * 1024) { // if (thumbData.length > 32 * 1024) {
thumbData = Uint8List.fromList(image.encodeJpg(thumbnail, // thumbData = Uint8List.fromList(image.encodeJpg(thumbnail,
quality: 100 * 32 * 1024 ~/ thumbData.length)); // quality: 100 * 32 * 1024 ~/ thumbData.length));
} // }
await Weibo.instance.shareWebpage( // await Weibo.instance.shareWebpage(
title: 'title', // title: 'title',
description: 'share webpage', // description: 'share webpage',
thumbData: thumbData.buffer.asUint8List(), // thumbData: thumbData.buffer.asUint8List(),
webpageUrl: 'https://www.baidu.com', // webpageUrl: 'https://www.baidu.com',
); // );
}, },
), ),
], ],