Appinio Flutter Packages

repository·main·Indexed 42 days ago

https://github.com/appiniogmbh/flutter_packages

A collection of specialized Flutter packages by Appinio, featuring UI components like appinio_animated_toggle_tab for animated tab switchers, and functional utilities such as appinio_social_share for sharing text, images, and videos across platforms including Facebook, Instagram, WhatsApp, TikTok, and Telegram.

Tokens
16.5K
Snippets
33
Records
55
Agent score
42%

What's inside Appinio Flutter Packages

  1. Overview of appinio_video_player

    main

    The appinio_video_player package is a wrapper around the official Flutter video_player package. It extends the base functionality by providing a fully customizable control bar, fullscreen mode, and adjustable video settings.

    Key features include:

    • Volume control via swiping on the right side of the screen.
    • Mute/Unmute functionality.
    • Web-specific features like hiding Picture-in-Picture mode.
    • Network video caching.
    • Seeking (forward/backward) and playback speed adjustment.
    • Video quality switching (via additional video sources).
    • Thumbnail/Poster support.
    • Customizable UI elements like a fluid progress bar.
    • Controls to prevent seeking or prevent the video from playing more than once.
  2. Overview of Appinio Flutter packages

    main
    This repository contains a collection of Flutter packages maintained and used by Appinio. These packages provide specialized UI components and functional utilities for Flutter applications, such as timers, onboarding sliders, video players, and social sharing capabilities.
  3. How WidgetZoom works

    main

    The WidgetZoom package provides a way to enable zooming capabilities on images or other widgets. It supports two primary interaction modes:

    1. Embedded Zoom: Users can use pinch-to-zoom gestures directly on the widget within its original context.
    2. Fullscreen Mode: A simple tap on the widget opens it in a fullscreen view. In fullscreen, users can pan around, double-tap to zoom in/out, and swipe down to dismiss the view.

    To ensure smooth transitions between the embedded view and the fullscreen view, the package utilizes Flutter's Hero animation system via the heroAnimationTag parameter.

    WidgetZoom(
        heroAnimationTag: 'tag',
        zoomWidget: Image.network('https://example.com/image.jpg'),
    )
  4. Install flutter_timer_countdown

    main

    To use flutter_timer_countdown in your Flutter project, add it to your pubspec.yaml or use the Flutter CLI.

    Option 1: Manual addition Add the following to your pubspec.yaml:

    flutter_timer_countdown: ...

    Option 2: CLI Run this command in your project's root directory:

    flutter pub add flutter_timer_countdown

    Then, import the package in your Dart files:

    import 'package:flutter_timer_countdown/flutter_timer_countdown.dart';
    flutter pub add flutter_timer_countdown
  5. Configure iOS (Info.plist and AppDelegate)

    main

    1. Update Info.plist

    Set deployment target to iOS 11. Add the following keys to Info.plist:

    <dict>
      <key>CFBundleURLTypes</key>
      <array>
        <dict>
          <key>CFBundleURLSchemes</key>
          <array>
            <string>fb[your_facebook_app_id]</string>
          </array>
        </dict>
      </array>
      
      <key>LSApplicationQueriesSchemes</key>
      <array>
        <string>instagram</string>
        <string>fb</string>
        <string>fbauth2</string>
        <string>fbshareextension</string>
        <string>fbapi</string>
        <string>facebook-reels</string>
        <string>facebook-stories</string>
        <string>fb-messenger-share-api</string>
        <string>fb-messenger</string>
        <string>tg</string>
        <string>whatsapp</string>
        <string>twitter</string>
      </array>
      
      <key>NSPhotoLibraryUsageDescription</key>
      <string>$(PRODUCT_NAME) needs permission to access photos and videos on your device</string>
      <key>NSMicrophoneUsageDescription</key>
      <string>$(PRODUCT_NAME) does not require access to the microphone.</string>
      <key>NSCameraUsageDescription</key>
      <string>$(PRODUCT_NAME) requires access to the camera.</string>
      <key>NSAppleMusicUsageDescription</key>
      <string>$(PRODUCT_NAME) requires permission to play music</string>
      
      <key>FacebookAppID</key>
      <string>[your_facebook_app_id]</string>
      <key>FacebookClientToken</key>
      <string>[your_facebook_client_token]</string>
      <key>FacebookDisplayName</key>
      <string>[your_facebook_app_display_name]</string>
    </dict>

    2. Update AppDelegate.swift

    Add the Facebook SDK initialization to your AppDelegate.swift:

    import FBSDKCoreKit
    
    // Inside the application function
    FBSDKCoreKit.ApplicationDelegate.shared.application(
            application,
            didFinishLaunchingWithOptions: launchOptions
    )
  6. Implement OnBoardingSlider

    main

    The OnBoardingSlider widget provides a parallax page slider. You can place it inside a Scaffold or CupertinoApp. It requires a list of background widgets, the total number of pages, the animation speed, and a list of widgets for the page bodies.

    import 'package:flutter_onboarding_slider/flutter_onboarding_slider.dart';
    
    class OnBoarding extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return CupertinoApp(
          home: OnBoardingSlider(
            headerBackgroundColor: Colors.white,
            finishButtonText: 'Register',
            finishButtonStyle: FinishButtonStyle(
              backgroundColor: Colors.black,
            ),
            skipTextButton: Text('Skip'),
            trailing: Text('Login'),
            background: [
              Image.asset('assets/slide_1.png'),
              Image.asset('assets/slide_2.png'),
            ],
            totalPage: 2,
            speed: 1.8,
            pageBodies: [
              Container(
                padding: EdgeInsets.symmetric(horizontal: 40),
                child: Column(
                  children: <Widget>[
                    SizedBox(height: 480),
                    Text('Description Text 1'),
                  ],
                ),
              ),
              Container(
                padding: EdgeInsets.symmetric(horizontal: 40),
                child: Column(
                  children: <Widget>[
                    SizedBox(height: 480),
                    Text('Description Text 2'),
                  ],
                ),
              ),
            ],
          ),
        );
      }
    }
  7. How to set up appinio_video_player

    main

    To use the custom video player, follow these steps:

    1. Initialize the base controller: Create a VideoPlayerController (from the official video_player package) and define your video source (e.g., VideoPlayerController.network(url)).
    2. Initialize the custom controller: Create a CustomVideoPlayerController. Pass the context and the videoPlayerController you created in step 1 to this constructor. This controller allows you to manually control fullscreen mode and control bar visibility.
    3. Render the player: Pass the CustomVideoPlayerController to a CustomVideoPlayer widget.
    4. Cleanup: Ensure you call _customVideoPlayerController.dispose() in your widget's dispose() method to release resources.
    @override
    void initState() {
      super.initState();
      // 1. Create base controller
      videoPlayerController = VideoPlayerController.network(videoUrl)
        ..initialize().then((value) => setState(() {}));
    
      // 2. Create custom controller
      _customVideoPlayerController = CustomVideoPlayerController(
        context: context,
        videoPlayerController: videoPlayerController,
      );
    }
    
    @override
    void dispose() {
      // 4. Dispose custom controller
      _customVideoPlayerController.dispose();
      super.dispose();
    }
    
    @override
    Widget build(BuildContext context) {
      return CustomVideoPlayer(
        customVideoPlayerController: _customVideoPlayerController
      );
    }
  8. Install appinio_swiper

    main

    To use the appinio_swiper package in your Flutter project, you can either add it manually to your pubspec.yaml or use the Flutter CLI.

    Option 1: Using Flutter CLI Run the following command in your project's root directory:

    flutter pub add appinio_swiper

    Option 2: Manual Installation Add the dependency to your pubspec.yaml:

    appinio_swiper: ...

    After installation, import the library in your Dart files:

    import 'package:appinio_swiper/appinio_swiper.dart';
    flutter pub add appinio_swiper
  9. Customize iOS launch screen assets

    main

    To change the launch screen image for the iOS version of the example app, you can either replace the image files directly in the LaunchImage.imageset directory or use Xcode for a visual approach.

    Method 1: Direct File Replacement

    Replace the existing image files within the packages/flutter_onboarding_slider/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/ directory with your own assets.

    Method 2: Using Xcode

    1. Open the iOS workspace using the command:
      open ios/Runner.xcworkspace
    2. In the Xcode Project Navigator, navigate to Runner/Assets.xcassets.
    3. Drag and drop your desired images into the asset catalog to replace the existing launch images.
    open ios/Runner.xcworkspace