How to install and use firebase_remote_config with Flutter 3.10.5 - including code sample!

A popular Flutter package with 451 likes that support Flutter version 3.10.5 and above. Last version of the package was published on Aug 01, 2023.

Installing firebase_remote_config

You can either add the package directly using the flutter command line.

$ flutter pub add firebase_remote_config

Or add the dependency directly to your pubspec.yaml file.
dependencies:
  firebase_remote_config: ^4.2.4

In either case, make sure to refresh your packages by running the following command:

$ flutter pub get

Using firebase_remote_config

Once you have installed the package, you can use it in your Flutter application by importing it.
import 'package:firebase_remote_config/firebase_remote_config.dart';

How to use firebase_remote_config with a code example/sample


// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_remote_config_example/home_page.dart';
import 'package:flutter/material.dart';

import 'firebase_options.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );
  runApp(const RemoteConfigApp());
}

class RemoteConfigApp extends StatelessWidget {
  const RemoteConfigApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Remote Config Example',
      home: const HomePage(),
      theme: ThemeData(
        useMaterial3: true,
        primarySwatch: Colors.blue,
      ),
    );
  }
}