Monday, 5 August 2019

Simple folding cell widget implemented in Flutter

Simple FoldingCell widget

Simple folding cell widget implemented in Flutter. Its a widget so add it to any container widget as a child.

Installation

Add dependency in pubspec.yaml:
dependencies:
  folding_cell: "^0.1.2"
YAML
Import in your project:
import 'package:folding_cell/folding_cell.dart';
Dart

Basic usage

class FoldingCellSimpleDemo extends StatelessWidget {
  final _foldingCellKey = GlobalKey<SimpleFoldingCellState>();

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Color(0xFF2e282a),
      alignment: Alignment.topCenter,
      child: SimpleFoldingCell(
          key: _foldingCellKey,
          frontWidget: _buildFrontWidget(),
          innerTopWidget: _buildInnerTopWidget(),
          innerBottomWidget: _buildInnerBottomWidget(),
          cellSize: Size(MediaQuery.of(context).size.width, 125),
          padding: EdgeInsets.all(15),
          animationDuration: Duration(milliseconds: 300),
          borderRadius: 10,
          onOpen: () => print('cell opened'),
          onClose: () => print('cell closed')),
    );
  }

  Widget _buildFrontWidget() {
    return Container(
        color: Color(0xFFffcd3c),
        alignment: Alignment.center,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text("CARD",
                style: TextStyle(
                    color: Color(0xFF2e282a),
                    fontFamily: 'OpenSans',
                    fontSize: 20.0,
                    fontWeight: FontWeight.w800)),
            FlatButton(
              onPressed: () => _foldingCellKey?.currentState?.toggleFold(),
              child: Text(
                "Open",
              ),
              textColor: Colors.white,
              color: Colors.indigoAccent,
              splashColor: Colors.white.withOpacity(0.5),
            )
          ],
        ));
  }

  Widget _buildInnerTopWidget() {
    return Container(
        color: Color(0xFFff9234),
        alignment: Alignment.center,
        child: Text("TITLE",
            style: TextStyle(
                color: Color(0xFF2e282a),
                fontFamily: 'OpenSans',
                fontSize: 20.0,
                fontWeight: FontWeight.w800)));
  }

  Widget _buildInnerBottomWidget() {
    return Container(
      color: Color(0xFFecf2f9),
      alignment: Alignment.bottomCenter,
      child: Padding(
        padding: EdgeInsets.only(bottom: 10),
        child: FlatButton(
          onPressed: () => _foldingCellKey?.currentState?.toggleFold(),
          child: Text(
            "Close",
          ),
          textColor: Colors.white,
          color: Colors.indigoAccent,
          splashColor: Colors.white.withOpacity(0.5),
        ),
      ),
    );
  }
}
Dart

Examples

example project contains these two demos

Demo 1 - FoldingCell inside Container



Demo 2 - FoldingCell inside ListView




Bugs/Requests

Reporting issues and requests for new features are always welcome.

GitHub

Flutter FoldingCell widget — Read More
Latest commit to the master branch on 3-6-2019
Download as zip

A UI experiment to create an awesome list for flutter apps

ListView with items that can be scrolled infinitely in both directions


Flutter Infinite ListView

Flutter Infinite ListView - ListView with items that can be scrolled infinitely in both directions. Maintainer: @slightfoot

Quick Usage

Replace your existing ListView with InfiniteListView. Builder pattern must be used because of its infinite nature.

Example



Bugs/Requests

If you encounter any problems feel free to open an issue. If you feel the library is
missing a feature, please raise a ticket on Github and I'll look into it.
Pull Request are also welcome.

GitHub

Flutter Infinite ListView - ListView with items that can be scrolled infinitely in both directions. Maintainer: @slightfoot — Read More
Latest commit to the master branch on 6-27-2019
Download as zip

Facebook Audience Network plugin for Flutter applications



facebook_audience_network

Facebook Audience Network plugin for Flutter applications.
Note: Currently only Android platform is supported.















Getting Started

1. Initialization:

For testing purposes you need to obtain the hashed ID of your testing device. To obtain the hashed ID:
  1. Call FacebookAudienceNetwork.init() during app initialization.
  2. Place the FacebookBannerAd widget in your app.
  3. Run the app.
The hased id will be in printed to the logcat. Paste that onto the testingId parameter.
FacebookAudienceNetwork.init(
  testingId: "37b1da9d-b48c-4103-a393-2e095e734bd6",
);
Dart

2. Show Banner Ad:

Container(
  alignment: Alignment(0.5, 1),
  child: FacebookBannerAd(
    placementId: "YOUR_PLACEMENT_ID",
    bannerSize: BannerSize.STANDARD,
    listener: (result, value) {
      switch (result) {
        case BannerAdResult.ERROR:
          print("Error: $value");
          break;
        case BannerAdResult.LOADED:
          print("Loaded: $value");
          break;
        case BannerAdResult.CLICKED:
          print("Clicked: $value");
          break;
        case BannerAdResult.LOGGING_IMPRESSION:
          print("Logging Impression: $value");
          break;
      }
    },
  ),
)
Dart

3. Show Interstitial Ad:

FacebookInterstitialAd.loadInterstitialAd(
  placementId: "YOUR_PLACEMENT_ID",
  listener: (result, value) {
    if (result == InterstitialAdResult.LOADED)
      FacebookInterstitialAd.showInterstitialAd(delay: 5000);
  },
);
Dart

4. Show Rewarded Video Ad:

FacebookRewardedVideoAd.loadRewardedVideoAd(
  placementId: "YOUR_PLACEMENT_ID",
  listener: (result, value) {
    if(result == RewardedVideoResult.LOADED)
      FacebookRewardedVideoAd.showRewardedVideoAd();
    if(result == RewardedVideoResult.VIDEO_COMPLETE)
      print("Video completed");
  },
);
Dart

5. Show In-Stream Video Ad:

Make sure the width and height is 300 at minimum.
FacebookInStreamVideoAd(
  placementId: "YOUR_PLACEMENT_ID",
  height: 300,
  listener: (result, value) {
    if (result == InStreamVideoAdResult.VIDEO_COMPLETE) {
      setState(() {
        _videoComplete = true;
      });
    }
  },
)
Dart

6. Show Native Ad:

FacebookNativeAd(
  placementId: "YOUR_PLACEMENT_ID",
  adType: NativeAdType.NATIVE_AD,
  width: double.infinity,
  height: 300,
  backgroundColor: Colors.blue,
  titleColor: Colors.white,
  descriptionColor: Colors.white,
  buttonColor: Colors.deepPurple,
  buttonTitleColor: Colors.white,
  buttonBorderColor: Colors.white,
  listener: (result, value) {
    print("Native Ad: $result --> $value");
  },
),
Dart

7. Show Native Banner Ad:

Use NativeBannerAdSize to choose the height for Native banner ads. height property is ignored for native banner ads.
FacebookNativeAd(
  placementId: "YOUR_PLACEMENT_ID",
  adType: NativeAdType.NATIVE_BANNER_AD,
  bannerAdSize: NativeBannerAdSize.HEIGHT_100,
  width: double.infinity,
  backgroundColor: Colors.blue,
  titleColor: Colors.white,
  descriptionColor: Colors.white,
  buttonColor: Colors.deepPurple,
  buttonTitleColor: Colors.white,
  buttonBorderColor: Colors.white,
  listener: (result, value) {
    print("Native Ad: $result --> $value");
  },
),
Dart
Check out the example for complete implementation.

Future Work

Implement for iOS platform.

GitHub

Latest commit to the master branch on 6-23-2019
Download as zip

Flutter representation of a Travel App Concept i found in Uplabs


Flutter Travel App Concept

Flutter representation of a Travel App Concept i found in Uplabs. It only consists of 2 screens.












true for dark and false for light.Toggle theme

To toggle the theme, change the isDark variable in main.dart.

Requirements

  • Any Operating System (ie. MacOS X, Linux, Windows)
  • Any IDE with Flutter SDK installed (ie. IntelliJ, Android Studio, VSCode etc)
  • A little knowledge of Dart and Flutter
  • A brain to think 🤓🤓

Author(s)

Olusegun Festus Babajide

GitHub

Flutter representation of a Travel App Concept. — Read More
Latest commit to the master branch on 7-16-2019
Download as zip