media_utils 1.1.1 copy "media_utils: ^1.1.1" to clipboard
media_utils: ^1.1.1 copied to clipboard

An easy helper class to flutter with many support formats. It supports local and web files.

example/lib/main.dart

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


void main() {
  runApp(
     MyApp(),
  );
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Media',
      home: MainPage(),
    );
  }
}


class MainPage extends StatelessWidget {

  String _path = "https://images.pexels.com/photos/2872767/pexels-photo-2872767.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940";
  @override
  Widget build(BuildContext context) {
   
    print("rebuild");
    return Scaffold(
      floatingActionButton: FloatingActionButton(
          child: Icon(Icons.add), onPressed: () => null),
      body: SafeArea(
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
             (MediaUtils.isImage(_path))?
             Container(
               height: 50,
               width: 50,
               child: Image.network(
             _path,
             ))
             : Container()
            ],
          ),
        ),
      ),
    );
  }
}
29
likes
40
points
20
downloads

Publisher

verified publishergetx.site

Weekly Downloads

An easy helper class to flutter with many support formats. It supports local and web files.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on media_utils