Skip to content

Commit 24ede37

Browse files
committed
docs: update readme
1 parent 1ff8638 commit 24ede37

File tree

4 files changed

+71
-6
lines changed

4 files changed

+71
-6
lines changed

.markdownlint.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"MD013": false,
3+
"MD033": false
4+
}

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# flutter_inapp_purchase
22

3-
[![Pub Version](https://img.shields.io/pub/v/flutter_inapp_purchase.svg?style=flat-square)](https://pub.dartlang.org/packages/flutter_inapp_purchase)
4-
[![Flutter CI](https://github.com/hyochan/flutter_inapp_purchase/actions/workflows/ci.yml/badge.svg)](https://github.com/hyochan/flutter_inapp_purchase/actions/workflows/ci.yml)
5-
[![Coverage Status](https://codecov.io/gh/hyochan/flutter_inapp_purchase/branch/main/graph/badge.svg?token=WXBlKvRB2G)](https://codecov.io/gh/hyochan/flutter_inapp_purchase)
6-
![License](https://img.shields.io/badge/license-MIT-blue.svg)
3+
<p align="center">
4+
<img src="https://flutter-inapp-purchase.hyo.dev/img/logo.png" width="200" alt="flutter_inapp_purchase logo" />
5+
</p>
76

8-
A comprehensive Flutter plugin for implementing in-app purchases on iOS and Android platforms.
7+
<p align="center">
8+
<a href="https://pub.dartlang.org/packages/flutter_inapp_purchase"><img src="https://img.shields.io/pub/v/flutter_inapp_purchase.svg?style=flat-square" alt="Pub Version" /></a>
9+
<a href="https://github.com/hyochan/flutter_inapp_purchase/actions/workflows/ci.yml"><img src="https://github.com/hyochan/flutter_inapp_purchase/actions/workflows/ci.yml/badge.svg" alt="Flutter CI" /></a>
10+
<a href="https://codecov.io/gh/hyochan/flutter_inapp_purchase"><img src="https://codecov.io/gh/hyochan/flutter_inapp_purchase/branch/main/graph/badge.svg?token=WXBlKvRB2G" alt="Coverage Status" /></a>
11+
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License" />
12+
</p>
13+
14+
<p align="center">
15+
A comprehensive Flutter plugin for implementing in-app purchases on iOS and Android platforms.
16+
</p>
917

1018
## 📚 Documentation
1119

@@ -43,4 +51,4 @@ await FlutterInappPurchase.instance.requestPurchase(
4351

4452
## 📄 License
4553

46-
MIT License - see [LICENSE](LICENSE) file for details.
54+
MIT License - see [LICENSE](LICENSE) file for details.

docs/static/img/create_favicon.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env python3
2+
import struct
3+
import os
4+
5+
def create_ico_from_pngs(png_files, output_file):
6+
"""Create an ICO file from multiple PNG files."""
7+
# ICO header
8+
ico_header = struct.pack('<HHH', 0, 1, len(png_files))
9+
10+
# Directory entries and image data
11+
entries = []
12+
images = []
13+
offset = 6 + 16 * len(png_files) # Header + directory entries
14+
15+
for png_file in png_files:
16+
with open(png_file, 'rb') as f:
17+
png_data = f.read()
18+
19+
# Get size from filename (e.g., favicon-16.png -> 16)
20+
size = int(png_file.split('-')[1].split('.')[0])
21+
22+
# ICO directory entry
23+
entry = struct.pack('<BBBBHHII',
24+
size if size < 256 else 0, # Width (0 = 256)
25+
size if size < 256 else 0, # Height (0 = 256)
26+
0, # Color palette
27+
0, # Reserved
28+
1, # Color planes
29+
32, # Bits per pixel
30+
len(png_data), # Image size
31+
offset # Image offset
32+
)
33+
entries.append(entry)
34+
images.append(png_data)
35+
offset += len(png_data)
36+
37+
# Write ICO file
38+
with open(output_file, 'wb') as f:
39+
f.write(ico_header)
40+
for entry in entries:
41+
f.write(entry)
42+
for image in images:
43+
f.write(image)
44+
45+
# Create the ICO file
46+
png_files = ['favicon-16.png', 'favicon-32.png', 'favicon-48.png']
47+
create_ico_from_pngs(png_files, 'favicon.ico')
48+
print("favicon.ico created successfully!")
49+
50+
# Clean up temporary PNG files
51+
for png_file in png_files:
52+
os.remove(png_file)
53+
print("Temporary PNG files removed.")

docs/static/img/favicon.ico

1.63 KB
Binary file not shown.

0 commit comments

Comments
 (0)