import 'package:flutter/material.dart';
import 'package:palette_generator/palette_generator.dart';
import 'package:http/http.dart' as http;
Future<PaletteGenerator> generatePaletteFromImageUrl(String imageUrl) async {
final response = await http.get(Uri.parse(imageUrl));
final bytes = response.bodyBytes;
final image = await decodeImageFromList(bytes);
return PaletteGenerator.fromImage(image);
}
版权属于:
narakuyang
作品采用:
《
署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
》许可协议授权
评论