story_creator 1.0.2 copy "story_creator: ^1.0.2" to clipboard
story_creator: ^1.0.2 copied to clipboard

A package for creating instagram like story, you can use this package to edit images and make it story ready by adding other contents over it like text.

example/lib/main.dart

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:story_creator/story_creator.dart';

void main() {
  runApp(
    new MaterialApp(
      debugShowCheckedModeBanner: false,
      home: MyApp(),
    ),
  );
}

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

class _MyAppState extends State<MyApp> {
  File? editedFile;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Story Creator Example'),
      ),
      body: Center(
        child: Stack(
          alignment: Alignment.center,
          // mainAxisAlignment: MainAxisAlignment.center,
          // crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            editedFile != null
                ? Image.file(
                    editedFile!,
                    fit: BoxFit.cover,
                  )
                : SizedBox.shrink(),
            TextButton(
              onPressed: () async {
                final picker = ImagePicker();
                await picker
                    .pickImage(source: ImageSource.gallery)
                    .then((file) async {
                  editedFile = await Navigator.of(context).push(
                    MaterialPageRoute(
                      builder: (context) => StoryCreator(
                        filePath: file!.path,
                      ),
                    ),
                  );

                  // ------- you have editedFile

                  if (editedFile != null) {
                    print('editedFile: ' + editedFile!.path);
                    setState(() {});
                  }
                });
              },
              child: Text('Pick Image'),
            ),
          ],
        ),
      ),
    );
  }
}
31
likes
130
pub points
66%
popularity

Publisher

unverified uploader

A package for creating instagram like story, you can use this package to edit images and make it story ready by adding other contents over it like text.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, flutter_colorpicker, google_fonts, path_provider

More

Packages that depend on story_creator