FLUTTER ECOSYSTEM

AWarmHug/widget_screenshot

위젯용 스크린샷, ListView와 같은 긴 스크린샷 지원

widget_screenshot 프로젝트 이미지
Stars
3
Forks
8
최근 푸시(UTC)
2023. 11. 10.
프로젝트 상태
활성
bingo GitHub avatar
GITHUB User

bingo ↗

我们不是代码的搬运工,而是代码的学习者。

언어DartKotlinSwiftRubyObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 4 개
  • flutter{"sdk":"flutter"}
  • plugin_platform_interface^2.0.2
  • flutter_test개발 의존성{"sdk":"flutter"}
  • flutter_lints개발 의존성^2.0.0

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

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
// 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);

Display

https://raw.githubusercontent.com/AWarmHug/widget_screenshot/main/display/shot.webp shoting-> https://raw.githubusercontent.com/AWarmHug/widget_screenshot/main/display/shoting.gif result-> https://raw.githubusercontent.com/AWarmHug/widget_screenshot/main/display/shoted.webp