import 'dart:io';

import 'package:clean/module/people_photo/photo_group.dart';
import 'package:get/get.dart';
import 'package:path_provider/path_provider.dart';
import 'package:path/path.dart' as p;
import 'package:wechat_assets_picker/wechat_assets_picker.dart';
class LocationsPhotoController extends GetxController {
  final RxList<PhotoGroup> photoGroups = <PhotoGroup>[].obs;
  @override
  onInit() {
    super.onInit();
    loadPhotosFromDirectory();
  }

  Future<void> loadPhotosFromDirectory() async {
    try {
      final List<AssetEntity>? result = await AssetPicker.pickAssets(
        Get.context!,
      );
      if (result != null && result.isNotEmpty) {
        photoGroups.add(PhotoGroup(
          title: 'photo: ${result.length}',
          imageCount: result.length,
          isSelected: false,
          images: result,
        ));
      }
    } catch (e) {
      print('Error loading photos: $e');
    }
  }

}