social_media_widgets 1.0.0+2

  • Readme
  • Changelog
  • Example
  • Installing
  • 76

Social Media Widgets - package #

A new flutter package for collection of common popular social media widgets

Currently available widgets #

  • Snapchat screen dismiss - By swiping down
  • Instagram story swipe

Adding basic Snapchat screen dismiss #

Navigator.push(
  context,
  MaterialPageRoute(
    builder: (context) => SnapchatDismiss(
      child: Screen('Screen', Colors.redAccent),
    ),
  ),
);

Here we are navigating to another screen and applying the snapchat screen dismiss

Adding basic Snapchat screen dismiss with previous screen as background #

Navigator.push(
  context,
  PageRouteBuilder(
    opaque: false,
    pageBuilder: (_, __, ___) =>
        SnapchatDismiss(child: Screen('Screen', Colors.redAccent),)
  ),
);

Here we are navigating to another screen and applying the snapchat screen dismiss and with the previous screen as background when we dismiss

Adding basic Snapchat screen dismiss with increased dismiss height #

Navigator.push(
  context,
  PageRouteBuilder(
    opaque: false,
    pageBuilder: (_, __, ___) => SnapchatDismiss(
      dismissHeight: 250,
      child: Screen('Screen', Colors.redAccent),
    ),
  ),
);

Here we are navigating to another screen and applying the snapchat screen dismiss and this will require more drag than default to dismiss screen

Basic Instagram Story Swipe #

Navigator.push(
  context,
  MaterialPageRoute(
    builder: (context) => InstagramStorySwipe(
      children: <Widget>[
        Screen('Screen 1', Colors.lightBlueAccent),
        Screen('Screen 2', Colors.redAccent),
        Screen('Screen 3', Colors.greenAccent),
      ],
    ),
  ),
);

Instagram Story Swipe with initial page specified #

Navigator.push(
  context,
  MaterialPageRoute(
    builder: (context) => InstagramStorySwipe(
      initialPage: 1,
      children: <Widget>[
        Screen('Screen 1', Colors.lightBlueAccent),
        Screen('Screen 2', Colors.redAccent),
        Screen('Screen 3', Colors.greenAccent),
      ],
    ),
  ),
);

Instagram Story Swipe and snapchat dismiss combined #

Navigator.push(
  context,
  PageRouteBuilder(
    pageBuilder: (_, __, ___) => SnapchatDismiss(
      child: InstagramStorySwipe(
        initialPage: 1,
        children: <Widget>[
          Screen('Screen 1', Colors.lightBlueAccent),
          Screen('Screen 2', Colors.redAccent),
          Screen('Screen 3', Colors.greenAccent),
        ],
      ),
    ),
  ),
);

1.0.0 - 3 June 2020 #

  • Snapchat screen dismiss
  • Instagram story swipe

1.0.0+1 - 3 June 2020 #

  • Readme screenshots fixed

1.0.0+2 - 3 June 2020 #

  • Readme screenshots fix

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:social_media_widgets/instagram_story_swipe.dart';
import 'package:social_media_widgets/snapchat_dismissible.dart';

import 'screen.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Container(
        margin: EdgeInsets.symmetric(horizontal: 30),
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              RaisedButton(
                onPressed: _onSnapchatDismissibleWithBlackButtonPressed,
                child: Text('Basic Snapchat dismissible'),
              ),
              SizedBox(height: 16),
              RaisedButton(
                onPressed: _onSnapchatDismissibleWithPreviousScreenPressed,
                child: Text(
                  'Snapchat dismissible with previous screen as background',
                  textAlign: TextAlign.center,
                ),
              ),
              SizedBox(height: 16),
              RaisedButton(
                onPressed: _onSnapchatDismissibleWithCustomHeightPressed,
                child: Text(
                  'Snapchat dismissible with increased custom height',
                  textAlign: TextAlign.center,
                ),
              ),
              SizedBox(height: 16),
              RaisedButton(
                onPressed: _onInstagramStorySwipeClicked,
                child: Text(
                  'Instagram story swipe',
                  textAlign: TextAlign.center,
                ),
              ),
              SizedBox(height: 16),
              RaisedButton(
                onPressed:
                    _onInstagramStorySwipeWithInitialPageSpecifiedClicked,
                child: Text(
                  'Instagram story swipe with initial page as screen 2',
                  textAlign: TextAlign.center,
                ),
              ),
              SizedBox(height: 16),
              RaisedButton(
                onPressed: _onInstagramAndStorySwipeCombined,
                child: Text(
                  'Instagram story swipe and snapchat dismiss combined',
                  textAlign: TextAlign.center,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }

  _onSnapchatDismissibleWithBlackButtonPressed() {
    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => SnapchatDismiss(
          child: Screen('Screen', Colors.redAccent),
        ),
      ),
    );
  }

  _onSnapchatDismissibleWithPreviousScreenPressed() {
    Navigator.push(
      context,
      PageRouteBuilder(
        opaque: false,
        pageBuilder: (_, __, ___) =>
            SnapchatDismiss(child: Screen('Screen', Colors.redAccent)),
      ),
    );
  }

  _onSnapchatDismissibleWithCustomHeightPressed() {
    Navigator.push(
      context,
      PageRouteBuilder(
        opaque: false,
        pageBuilder: (_, __, ___) => SnapchatDismiss(
          dismissHeight: 250,
          child: Screen('Screen', Colors.redAccent),
        ),
      ),
    );
  }

  _onInstagramStorySwipeClicked() {
    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => InstagramStorySwipe(
          children: <Widget>[
            Screen('Screen 1', Colors.lightBlueAccent),
            Screen('Screen 2', Colors.redAccent),
            Screen('Screen 3', Colors.greenAccent),
          ],
        ),
      ),
    );
  }

  _onInstagramStorySwipeWithInitialPageSpecifiedClicked() {
    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => InstagramStorySwipe(
          initialPage: 1,
          children: <Widget>[
            Screen('Screen 1', Colors.lightBlueAccent),
            Screen('Screen 2', Colors.redAccent),
            Screen('Screen 3', Colors.greenAccent),
          ],
        ),
      ),
    );
  }

  _onInstagramAndStorySwipeCombined() {
    Navigator.push(
      context,
      PageRouteBuilder(
        pageBuilder: (_, __, ___) => SnapchatDismiss(
          child: InstagramStorySwipe(
            initialPage: 1,
            children: <Widget>[
              Screen('Screen 1', Colors.lightBlueAccent),
              Screen('Screen 2', Colors.redAccent),
              Screen('Screen 3', Colors.greenAccent),
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  social_media_widgets: ^1.0.0+2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:social_media_widgets/instagram_story_swipe.dart';
import 'package:social_media_widgets/snapchat_dismissible.dart';
import 'package:social_media_widgets/socialmediawidgets.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
52
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Jul 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • social_media_widgets that is a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test