v0.0.9
widget_screenshot
위젯용 스크린샷, ListView와 같은 긴 스크린샷을 지원하며, 배경색, 형식(png, jpeg), 품질(0~100)을 지원하고, 헤더, 푸터 또는 워터마크와 같은 추가 이미지를 병합할 수 있습니다
21좋아요 6430일 다운로드130Pub 점수
AndroidiOS
위젯용 스크린샷, ListView와 같은 긴 스크린샷 지원
{"sdk":"flutter"}^2.0.2{"sdk":"flutter"}^2.0.0아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Widget截屏,支持长截图,如:ListView
Screenshot for widget,support long screenshot like ListView,
dependencies:
widget_screenshot:x.y.z
// 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),
)
WidgetShotRenderRepaintBoundary repaintBoundary =
_shotKey.currentContext!.findRenderObject() as WidgetShotRenderRepaintBoundary;
//
var resultImage = await repaintBoundary.screenshot(scrollController: _scrollController,pixelRatio: 1);