stamp_folder_widget 0.1.0
stamp_folder_widget: ^0.1.0 copied to clipboard
A reusable Flutter widget package for rendering a frosted stamp folder artwork.
stamp_folder_widget #
English | 简体中文
A reusable Flutter package for rendering a stylized stamp folder artwork with a rounded back panel, a frosted front pocket, and three configurable stamp images.
Features #
- Reusable Flutter package API
- Configurable overall size
- Configurable front pocket colors
- Configurable back panel colors
- Configurable external stamp image source, position, size, rotation, and tint
- Supports
AssetImage,NetworkImage, and otherImageProvidersources - Example app included
Installation #
dependencies:
stamp_folder_widget: ^1.0.0
For local development:
dependencies:
stamp_folder_widget:
path: ../stamp_folder_widget
Usage #
import 'package:flutter/material.dart';
import 'package:stamp_folder_widget/stamp_folder_widget.dart';
class DemoPage extends StatelessWidget {
const DemoPage({super.key});
@override
Widget build(BuildContext context) {
final stamps = StampFolderWidget.buildDefaultStamps(
imageProvider: const AssetImage('assets/example.webp'),
);
return Center(
child: StampFolderWidget(width: 760, stamps: stamps),
);
}
}
You can customize the artwork with size, panel colors, labels, and stamp layout:
import 'package:flutter/material.dart';
import 'package:stamp_folder_widget/stamp_folder_widget.dart';
class DemoPage extends StatelessWidget {
const DemoPage({super.key});
@override
Widget build(BuildContext context) {
final baseImage = const AssetImage('assets/example.webp');
final stamps = StampFolderWidget.buildDefaultStamps(
imageProvider: baseImage,
);
final customizedStamps = [
stamps[0],
stamps[1].copyWith(
leftFactor: 0.41,
tint: const Color(0x3378A66A),
),
stamps[2].copyWith(
rightFactor: 0.16,
topFactor: 0.245,
),
];
return Center(
child: StampFolderWidget(
width: 820,
title: 'STAMP',
subtitle: 'Collection',
frontPanelColors: const [
Color(0xFFF7F0E3),
Color(0xFFE8DFC7),
Color(0xFFF7F2EA),
],
backPanelColors: const [
Color(0xFFF8F2E6),
Color(0xFFF1E7D6),
Color(0xFFFBF7F0),
],
stamps: customizedStamps,
),
);
}
}
Main API #
StampFolderWidgetStampFolderStampData
Configurable Parameters #
Widget Size #
width: outer widget widthheight: outer widget heightaspectRatio: overall layout ratio when height is not fixedpadding: inner spacing around the artwork
Folder Appearance #
frontPanelColors: gradient colors for the frosted front pocketbackPanelColors: gradient colors for the rear paneltitle: main label on the front pocketsubtitle: secondary label on the front pocketlabelColor: text and leaf decoration colorshowLeafDecoration: whether to show the leaf decoration
Stamp Configuration #
Pass exactly 3 StampFolderStampData items to stamps.
Each StampFolderStampData supports:
imageProviderleftFactorrightFactortopFactorwidthFactorheightFactorrotationtintfitborderRadius
Notes #
- The widget expects exactly 3 stamp items when
stampsis provided. - If fewer than 3 panel colors are passed, the package automatically resolves them into a usable gradient set.
- The package no longer bundles a built-in stamp image. Provide your own image source from the host app.
- The example app in
example/lib/main.dartshows a complete package usage setup.
Development #
flutter analyze
flutter test