picture_path_provider 0.0.1 copy "picture_path_provider: ^0.0.1" to clipboard
picture_path_provider: ^0.0.1 copied to clipboard

A flutter p;ugin to provide picture directory path

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:picture_path_provider/picture_path_provider.dart';

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

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

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

  _getPicturesPath() async{
    String path = await PicturePathProvider.getPicturesDirPath;
    if(mounted){
      setState(() {
        _picturesPath = path;
      });
    }
  }

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

  }



  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('PicturePathProvider'),
        ),
        body: Container(
          width: double.infinity,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(_picturesPath,
                style: Theme.of(context).textTheme.title,
              ),
              RaisedButton(
                onPressed: () => _getPicturesPath(),
                child: Text("Get Pictures Path"),
              ),
            ],
          )
        ),
      ),
    );
  }
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A flutter p;ugin to provide picture directory path

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on picture_path_provider