flutter_fb_news 2.0.0
flutter_fb_news: ^2.0.0 copied to clipboard

Flutter plugin for displaying Facebook page feed with photos and videos

flutter_fb_news #

Flutter plugin for displaying Facebook page feed with photos and videos

platform pub donate

Using #

import 'package:flutter_fb_news/flutter_fb_news.dart';

Center(
    child: FbNews(
        accesToken:"xyz",
        pageId: "123567890",
        limit: 25,
        config: FbNewsConfig(
            subtitle = "from Facebook",
            waiting: Column(
                children: [
                    CircularProgressIndicator(),
                    SizedBox(
                        height: 10,
                    )
                ],
            ),
            noDataOrError: Card(
                color: Colors.red,
                child: Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                        Text(
                            snapshot.error.toString(),
                            style: TextStyle(
                                color: Colors.white,
                            ),
                        )
                    ],
                ),
            ),
            fields: [
                FbNewsFields.header,
                FbNewsFields.attachmentsPhotos,
                FbNewsFields.attachmentsVideos,
                FbNewsFields.attachmentsVideoDirectResponseAutoplay,
                FbNewsFields.attachmentsShare,
                FbNewsFields.message,
                FbNewsFields.footer,
            ],
            borderColor: Colors.black,
            showBorder = true,
            backgroundColor: Colors.white,
            textColor: Colors.black,
            linkColor: Colors.blue,
        ),
    ),
),

Demo #

Demo

Parameters #

ParameterTypeRequiredDescription
pageIdStringyesis required to identify the Facebook page, for example (253146702201895)
accesTokenStringyesis required to authorize for the Facebook Api Docu to get the authToken https://developers.facebook.com/docs/facebook-login/access-tokens#pagetokens
limitintnoLimits the number of elements that are loaded Default: 20
configFbNewsConfignoCustomize the appearance of the posts

FbNewsConfig Params #

ParameterTypeRequiredDescription
subtitleStringnoSubtitle in the every feeditem Default: "von Facebook"
waitingWidgetnoThe waiting widget is displayed when the data is loaded
noDataOrErrorWidgetnoThe noDataOrErrorwidget is displayed if the response contains no data or an error
fieldsListnoSelect which fields to display
borderColorColornoSet the Color of the border
showBorderBooleannoToogle the display of the border
backgroundColorColornoSet the Color of the background
textColorColornoSet the Color of the text
linkColorColornoSet the Color of a link

FbNewsFieldName #

The possible fields are

  • FbNewsFields.header
  • FbNewsFields.attachmentsPhotos
  • FbNewsFields.attachmentsVideos
  • FbNewsFields.attachmentsVideoDirectResponseAutoplay
  • FbNewsFields.attachmentsShare
  • FbNewsFields.message
  • FbNewsFields.footer
5
likes
120
pub points
57%
popularity

Publisher

cedtegapps.de

Flutter plugin for displaying Facebook page feed with photos and videos

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

cached_network_image, chewie, flutter, flutter_linkify, http, url_launcher, video_player

More

Packages that depend on flutter_fb_news