FLUTTER ECOSYSTEM

AWarmHug/widget_screenshot

Bildschirmfoto für Widget, Unterstützung für lange Bildschirmfotos wie ListView

Projektcover von widget_screenshot
Stars
3
Forks
8
Letzter Push (UTC)
10.11.2023
Projektstatus
Aktiv
bingo GitHub avatar
GITHUB User

bingo ↗

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

SprachenDartKotlinSwiftRubyObjective-C

Technische Themen

Von diesem Repository veröffentlichte Pakete

Verwendete Abhängigkeiten

Abhängigkeiten 4 Einträge
  • flutter{"sdk":"flutter"}
  • plugin_platform_interface^2.0.2
  • flutter_testEntwicklung{"sdk":"flutter"}
  • flutter_lintsEntwicklung^2.0.0

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.

Projekt-README ein-/ausklappen

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