modular_release_guard

Last updated:

0 purchases

modular_release_guard Image
modular_release_guard Images
Add to Cart

Description:

modular release guard

Library that offers resources to control via Firebase Remote Config elements according to their build type.
Features #

Controls the display of widgets and can even replace them.
Protect routes from unauthorized access from Flutter Modular.
Use Groveman to logs.
Use Firebase Remote Config to get parameters.

Getting started #
This package depends on the Firebase Remote Config service. See implementation details.
This library uses parameters from Firebase Remote Config. If the parameter is false only debug mode can access, otherwise it is available in release mode.
Add to pubspec
groveman: any
firebase_remote_config: any
modular_release_guard: any
copied to clipboard
Usage #
First step #
Includes initialize all library dependencies(Groveman and RemoteConfig).
void main() async {
WidgetsFlutterBinding.ensureInitialized();
Groveman.plantTree(DebugTree(showColor: true));
await Firebase.initializeApp();

RemoteConfig remoteConfig = RemoteConfig.instance;

await remoteConfig.setConfigSettings(RemoteConfigSettings(
fetchTimeout: Duration(seconds: 10),
minimumFetchInterval: Duration(hours: 1),
));

// true para prod, false para apenas dev
remoteConfig.setDefaults(<String, dynamic>{
'clinics': false,
});

await remoteConfig.fetchAndActivate();
copied to clipboard
Second #
The following methods will be made available.
Widgets
Widget control can happen using the following methods:

...
IconButton(
onPressed: () {
Modular.to.pushNamed('/clinics');
},
icon: Icon(Icons.help))
.withReleaseControl('clinics'),
],
),

copied to clipboard
The original widget can be replaced with another one.
...
IconButton(
onPressed: () {
Modular.to.pushNamed('/clinics');
},
icon: Icon(Icons.help))
.withReleaseControl('clinics', replacement: Text('See later')),
],
),

copied to clipboard
Flutter Modular - Modules and Routes
Extensions are available to control modules and routes
ModuleRoute(
'/clinics',
module: LocalClinicsModule(),
).withReleaseControl(),
copied to clipboard
Without any parameter the default parameter in Remote Config is initial route.
ModuleRoute(
'/clinics',
module: LocalClinicsModule(),
).withReleaseControl('clinics_provided'),
copied to clipboard
Release control with parameter clinics_provided from Remote Config.
ModuleRoute(
'/clinics',
module: LocalClinicsModule(),
).withReleaseControl('clinics_provided', redirectTo: '/comingsoon'),
copied to clipboard
Provides an alternative route.
Additional information #
Designed by Kauê Martins and developed by Lucas Náiade, both from Zambiee.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.