widget_screenshot

Creator: coderz1093

Last updated:

0 purchases

widget_screenshot Image
widget_screenshot Images
Add to Cart

Description:

widget screenshot

widget_screenshot #
Widget截屏,支持长截图,如:ListView
Screenshot for widget,support long screenshot like ListView,
Support #

backgroundColor
format (png, jpeg)
quality (0~100)
extraImage (like header, footer or watermark)

Usage #
dependencies:
widget_screenshot:x.y.z
copied to clipboard
// Like RepaintBoundary
WidgetShot(
key: _shotKey,
child: ListView.separated(
controller: _scrollController,
itemBuilder: (context, index) {
return Container(
color: Color.fromARGB(
Random().nextInt(255), Random().nextInt(255), Random().nextInt(255), Random().nextInt(255)),
height: 160,
child: Center(
child: Text(
"测试文案测试文案测试文案测试文案 ${index}",
style: const TextStyle(fontSize: 32),
),
),
);
},
separatorBuilder: (context, index) {
return const Divider(
height: 1,
color: Colors.grey,
);
},
itemCount: 30),
)
copied to clipboard
WidgetShotRenderRepaintBoundary repaintBoundary =
_shotKey.currentContext!.findRenderObject() as WidgetShotRenderRepaintBoundary;
//
var resultImage = await repaintBoundary.screenshot(scrollController: _scrollController,pixelRatio: 1);
copied to clipboard
Display #


shoting->

result->

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.