simple_utils_flutter 0.0.3 copy "simple_utils_flutter: ^0.0.3" to clipboard
simple_utils_flutter: ^0.0.3 copied to clipboard

A package to simplify your coding. Using Shared preferences, Firestore Database, File and image picker made easy by simplifying them. Now You can use these methods my adding a single line.

example/lib/main.dart

import 'dart:io';

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Simple Utils Flutter',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  File? imageFile;

  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    return Scaffold(
      appBar: AppBar(
        title: const Text('Example'),
      ),
      body: SizedBox(
        width: size.width,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            if (imageFile != null)
              SizedBox(
                width: size.width * .8,
                height: size.width * .8,
                child: Image.file(
                  imageFile!,
                  fit: BoxFit.cover,
                ),
              ),
            const SizedBox(
              height: 20,
            ),
            ElevatedButton(
                onPressed: () async {
                  await FilePickerUtils()
                      .pickCroppedImage(
                          context: context,
                          color: Colors.blue,
                          name: "Example",
                          title: "Pick image")
                      .then((value) {
                    imageFile = value;
                    setState(() {});
                  });
                },
                child: const Text("Pick image"))
          ],
        ),
      ),
    );
  }
}
4
likes
130
pub points
1%
popularity

Publisher

unverified uploader

A package to simplify your coding. Using Shared preferences, Firestore Database, File and image picker made easy by simplifying them. Now You can use these methods my adding a single line.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

cloud_firestore, file_picker, firebase_storage, flutter, image_cropper, image_picker, shared_preferences

More

Packages that depend on simple_utils_flutter