import 'dart:io';
import 'package:flutter/material.dart';
import 'lib/core/utils/app_icon_generator.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  print('Generating ApskelPOS app icon...');

  try {
    final iconData = await AppIconGenerator.generateAppIcon();

    // Ensure the assets/logo directory exists
    final logoDir = Directory('assets/logo');
    if (!await logoDir.exists()) {
      await logoDir.create(recursive: true);
    }

    // Write the generated icon to file
    final iconFile = File('assets/logo/logo_app_icon.png');
    await iconFile.writeAsBytes(iconData);

    print(
        '✅ App icon generated successfully at: assets/logo/logo_app_icon.png');
    print('📱 The icon features:');
    print('   - White background for visibility');
    print('   - Blue circular background');
    print('   - Gift box with "e" inside');
    print('   - "ENAKLO" and "POS" text');
    print('   - 1024x1024 resolution for high quality');
  } catch (e) {
    print('❌ Error generating app icon: $e');
  }
}
