flutter_file_meta_data 0.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 59

flutter_file_meta_data #

A Flutter plugin that enables you to get fileMetadata on iOS and Android

This Plugin is available only on Android

Usage #

To get Any File metadata :


import 'package:flutter_file_meta_data/flutter_file_meta_data.dart';

List metadata = await FlutterFileMetaData.getFileMetaData("filePath");

print(metadata); // Will print a list of metaData of that file 

//Output Definition 

metadata = [ Title, Artist, 8bit AlbumCover, Album Title, Track Number, Duration, Genre, Bitrate, Year ]

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

0.0.1 #

Using MediaMetadataRetriever on Android to get the metaData

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:flutter_file_meta_data/flutter_file_meta_data.dart';
import 'package:simple_permissions/simple_permissions.dart';

void main() async{
  WidgetsFlutterBinding.ensureInitialized();
  await SimplePermissions.requestPermission(Permission.ReadExternalStorage);
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String platformVersion;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      //Input a file from your device
     //List metadata = await FlutterFileMetaData.getFileMetaData("");//print(metadata);
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_platformVersion\n'),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_file_meta_data: ^0.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_file_meta_data/flutter_file_meta_data.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
30
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
59
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform Linux

Because:

  • package:flutter_file_meta_data/flutter_file_meta_data.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform Web

Because:

  • package:flutter_file_meta_data/flutter_file_meta_data.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform Windows

Because:

  • package:flutter_file_meta_data/flutter_file_meta_data.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform macOS

Because:

  • package:flutter_file_meta_data/flutter_file_meta_data.dart that declares support for platforms: Android, iOS

Package not compatible with SDK dart

Because:

  • flutter_file_meta_data that is a package requiring null.

Health suggestions

Format lib/flutter_file_meta_data.dart.

Run flutter format to format lib/flutter_file_meta_data.dart.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Running dartdoc failed with the following output: NoSuchMethodError: The getter 'attributes' was called on null. Receiver: null Tried calling: attributes

#0      DartdocCustomizer._addPubPackageLink (package:pub_dev/dartdoc/customization.dart:168:17)
#1      DartdocCustomizer.customizeHtml (package:pub_dev/dartdoc/customization.dart:61:7)
#2      DartdocCustomizer.customizeFile (package:pub_dev/dartdoc/customization.dart:35:31)
<asynchronous suspension>
#3      DartdocCustomizer.customizeDir (package:pub_dev/dartdoc/customization.dart:26:25)
<asynchronous suspension>
#4      DartdocJobProcessor.process (package:pub_dev/dartdoc/dartdoc_runner.dart:211:14)
<asynchronous suspension>
#5      JobProcessor.run (package:pub_dev/job/job.dart:69:28)
<asynchronous suspension>
#6      JobMaintenance.run (package:pub_dev/job/job.dart:119:18)
#7      _workerMain.<anonymous closure> (package:pub_dev/service/entrypoint/dartdoc.dart:111:26)
#8      StackZoneSpecification._registerUnaryCallback.<anonymous closure>.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:26)
#9      StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#10     StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:14)
#11     _rootRunUnary (dart:async/zone.dart:1192:38)
#12     _CustomZone.runUnary (dart:async/zone.dart:1085:19)
#13     _FutureListener.handleValue (dart:async/future_impl.dart:141:18)
#14     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:682:45)
#15     Future._propagateToListeners (dart:async/future_impl.dart:711:32)
#16     Future._completeWithValue (dart:async/future_impl.dart:526:5)
#17     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:36:15)
#18     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:298:13)
#19     DartdocJobProcessor.generateDocsForSdk (package:pub_dev/dartdoc/dartdoc_runner.dart)
#20     StackZoneSpecification._registerUnaryCallback.<anonymous closure>.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:26)
#21     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#22     StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:14)
#23     _rootRunUnary (dart:async/zone.dart:1192:38)
#24     _CustomZone.runUnary (dart:async/zone.dart:1085:19)
#25     _FutureListener.handleValue (dart:async/future_impl.dart:141:18)
#26     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:682:45)
#27     Future._propagateToListeners (dart:async/future_impl.dart:711:32)
#28     Future._completeWithValue (dart:async/future_impl.dart:526:5)
#29     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:556:7)
#30     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#31     StackZoneSpecification._registerCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:119:48)
#32     _rootRun (dart:async/zone.dart:1184:13)
#33     _CustomZone.run (dart:async/zone.dart:1077:19)
#34     _CustomZone.runGuarded (dart:async/zone.dart:979:7)
#35     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1019:23)
#36     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#37     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#38     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#39     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

Homepage URL isn't helpful. (-10 points)

Update the homepage field from pubspec.yaml: link to a website about the package or use the source repository URL.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test