dart_tags 0.4.1 copy "dart_tags: ^0.4.1" to clipboard
dart_tags: ^0.4.1 copied to clipboard

The library for work with music tags like ID3. Written on pure Dart. It can be used in flutter, web, and vm projects.

example/example.dart

import 'dart:io';

import 'package:dart_tags/dart_tags.dart';

void main(List<String> args) {
  if (args.isNotEmpty) {
    args.forEach(_proceedArg);
  } else {
    print('args please!');
  }
}

void _proceedArg(String path) {
  final fileType = FileStat.statSync(path).type;
  switch (fileType) {
    case FileSystemEntityType.directory:
      Directory(path)
          .list(recursive: true, followLinks: false)
          .listen((FileSystemEntity entity) {
        if (entity.statSync().type == FileSystemEntityType.file &&
            entity.path.endsWith('.mp3')) {
          printFileInfo(entity.path);
        }
      });
      break;
    case FileSystemEntityType.file:
      if (path.endsWith('.mp3')) {
        printFileInfo(path);
      }
      break;
    case FileSystemEntityType.notFound:
      print('file not found');
      break;
    default:
      print('sorry dude I don`t know what I must to do with that...\n');
  }
}

void printFileInfo(String fileName) {
  final file = File(fileName);
  TagProcessor().getTagsFromByteArray(file.readAsBytes()).then((l) {
    print('FILE: $fileName');
    l.forEach(print);
    print('\n');
  });
}
20
likes
140
pub points
74%
popularity

Publisher

verified publisherdart.tools

The library for work with music tags like ID3. Written on pure Dart. It can be used in flutter, web, and vm projects.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

collection, convert, utf_convert

More

Packages that depend on dart_tags