flutter_native_oss_licenses 1.0.0 copy "flutter_native_oss_licenses: ^1.0.0" to clipboard
flutter_native_oss_licenses: ^1.0.0 copied to clipboard

Collects Flutter/Dart and native dependency licenses in one list: Android Gradle, CocoaPods, and remote SwiftPM, with all Flutter platforms supported.

example/lib/main.dart

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

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  registerNativeLicenses();
  runApp(const ExampleApp());
}

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Native OSS licenses example',
      theme: ThemeData(colorSchemeSeed: Colors.indigo),
      home: const LicenseSummaryPage(),
    );
  }
}

class LicenseSummaryPage extends StatefulWidget {
  const LicenseSummaryPage({super.key});

  @override
  State<LicenseSummaryPage> createState() => _LicenseSummaryPageState();
}

class _LicenseSummaryPageState extends State<LicenseSummaryPage> {
  late final Future<List<MergedLicenseEntry>> _licenses = loadMergedLicenses();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Merged OSS licenses')),
      body: FutureBuilder<List<MergedLicenseEntry>>(
        future: _licenses,
        builder: (context, snapshot) {
          if (snapshot.hasError) {
            return Center(
              child: Text('Could not load licenses: ${snapshot.error}'),
            );
          }
          if (!snapshot.hasData) {
            return const Center(child: CircularProgressIndicator());
          }
          return Center(
            child: Text('${snapshot.data!.length} grouped license records'),
          );
        },
      ),
      floatingActionButton: FloatingActionButton.extended(
        onPressed: () => showLicensePage(
          context: context,
          applicationName: 'Native OSS licenses example',
        ),
        icon: const Icon(Icons.description_outlined),
        label: const Text('Flutter license page'),
      ),
    );
  }
}
1
likes
160
points
70
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Collects Flutter/Dart and native dependency licenses in one list: Android Gradle, CocoaPods, and remote SwiftPM, with all Flutter platforms supported.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#license #oss #open-source #compliance #legal

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface

More

Packages that depend on flutter_native_oss_licenses

Packages that implement flutter_native_oss_licenses