flutter_ipfs 0.0.2 copy "flutter_ipfs: ^0.0.2" to clipboard
flutter_ipfs: ^0.0.2 copied to clipboard

A Flutter package that helps you to upload image, video or file to IPFS in a single click.

example/example.dart

// ignore_for_file: deprecated_member_use

import 'package:flutter/material.dart';
import 'package:flutter_ipfs/src/service/file_picker.dart';
import 'package:flutter_ipfs/src/service/image_picker.dart';
import 'package:flutter_ipfs/src/service/video_picker.dart';

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        backgroundColor: Colors.white,
        elevation: 1,
        centerTitle: true,
        title: const Text(
          'Flutter Ipfs',
          style: TextStyle(
            letterSpacing: 1.2,
            color: Colors.black,
            fontSize: 19,
            fontWeight: FontWeight.w600,
          ),
        ),
      ),
      body: Container(
        padding: const EdgeInsets.symmetric(horizontal: 25),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Center(
              child: RaisedButton(
                onPressed: () => ImagePickerService.pickImage(context),
                color: Colors.black,
                textColor: Colors.white,
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(25),
                ),
                child: const SizedBox(
                  height: 50,
                  child: Center(
                    child: Text(
                      'Upload Image',
                      style: TextStyle(fontSize: 18, fontFamily: 'Brand-Bold'),
                    ),
                  ),
                ),
              ),
            ),
            const SizedBox(height: 20),
            Center(
              child: RaisedButton(
                onPressed: () => VideoPickerService.pickVideo(context),
                color: Colors.black,
                textColor: Colors.white,
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(25),
                ),
                child: const SizedBox(
                  height: 50,
                  child: Center(
                    child: Text(
                      'Upload Video',
                      style: TextStyle(fontSize: 18, fontFamily: 'Brand-Bold'),
                    ),
                  ),
                ),
              ),
            ),
            const SizedBox(height: 20),
            Center(
              child: RaisedButton(
                onPressed: () => FilePickerService.pickFile(context),
                color: Colors.black,
                textColor: Colors.white,
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(25),
                ),
                child: const SizedBox(
                  height: 50,
                  child: Center(
                    child: Text(
                      'Upload File',
                      style: TextStyle(fontSize: 18, fontFamily: 'Brand-Bold'),
                    ),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
11
likes
100
pub points
71%
popularity

Publisher

unverified uploader

A Flutter package that helps you to upload image, video or file to IPFS in a single click.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

file_picker, flutter, fluttertoast, http, image_picker

More

Packages that depend on flutter_ipfs