Skip to content
pubscout

global_configuration

2.0.0, released 3 years ago by an unverified publisher

A singleton-based config manager that loads JSON from assets, files, URLs or maps and exposes values via getters.

WASM-ready
$ flutter pub add global_configuration
Source repository

What it does

It merges configuration files into a single map and makes them available throughout a Flutter app. You can load from assets, file paths, URLs, or Dart maps, and override values at runtime.

AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a simple, non-reactive configuration store for small to medium apps.
  • You want to load configuration from multiple sources (assets, files, URLs) without extra dependencies.
  • You prefer a straightforward API over complex state management solutions.

Skip it when

  • You require reactive updates to UI when configuration changes.
  • You need strong type safety or compile-time validation of config keys.
  • You are building a large-scale app that already uses a dedicated state management library.

Strengths

  • Easy to set up and use with minimal boilerplate.
  • Supports multiple loading sources (assets, path, URL, map).
  • Provides updateValue and clear methods for runtime overrides.
  • MIT license and small dependency footprint.

Weaknesses

  • No reactive or stream-based updates – UI must be rebuilt manually.
  • Configuration values are untyped (Map<String, dynamic>).
  • Limited error handling documentation for load failures.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1

Add dependency in pubspec and call GlobalConfiguration().loadFromAsset or other load method before runApp.

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

void main() async {
  await GlobalConfiguration().loadFromAsset('app_settings');
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Text(GlobalConfiguration().getString('key1')),
        ),
      ),
    );
  }
}