remote_widget_hideable 0.0.1 copy "remote_widget_hideable: ^0.0.1" to clipboard
remote_widget_hideable: ^0.0.1 copied to clipboard

A Flutter widget to remotely show or hide UI components using Cloud Firestore real-time updates. Useful for feature flagging and review.

Remote Widget Hideable #

Pub Version License: MIT

A simple Flutter widget to show or hide UI components remotely using Cloud Firestore. Useful for feature flagging, hiding components during app review, or A/B testing.

Repository: https://github.com/kedirinesia/remote-hideable-widget-

Features #

  • Real-time Updates: Listens to Firestore document changes.
  • Null Safety: Robust error handling and default values.
  • Custom placeholders: Show a specific widget (or nothing) when hidden.

Installation #

Add dependencies to pubspec.yaml:

dependencies:
  cloud_firestore: latest_version
  remote_widget_hideable:
    path: ./ # or git path

Usage #

import 'package:flutter/material.dart';
import 'package:remote_widget_hideable/remote_widget_hideable.dart';

class MyPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: RemoteHideable(
          collection: 'app_config',
          document: 'checkout_settings',
          field: 'enable_promo_banner',
          initialValue: false, // Default while loading
          placeholder: Text('Promo is currently disabled'), // Optional
          child: Container(
            color: Colors.red,
            padding: EdgeInsets.all(20),
            child: Text(' BIG PROMO! '),
          ),
        ),
      ),
    );
  }
}

Firestore Structure #

Ensure you have a document in Firestore matching the path:

  • Collection: app_config
  • Document: checkout_settings
  • Field: enable_promo_banner (boolean)

If true, the child widget is shown. If false, it's hidden.

Configuration Example #

A .env.example file is included in the package root to help you structure your environment variables if needed:

# Firestore Remote Config Example
REMOTE_COLLECTION=app_config
REMOTE_DOCUMENT=global_settings
REMOTE_FIELD=enable_feature_x
1
likes
140
points
78
downloads

Publisher

verified publisherfulung.my.id

Weekly Downloads

A Flutter widget to remotely show or hide UI components using Cloud Firestore real-time updates. Useful for feature flagging and review.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

cloud_firestore, flutter

More

Packages that depend on remote_widget_hideable