build: Generate the list of libraries
This commit is contained in:
7
lib/data/libraries.dart
Normal file
7
lib/data/libraries.dart
Normal file
@@ -0,0 +1,7 @@
|
||||
class Library {
|
||||
final String name;
|
||||
final String license;
|
||||
final String url;
|
||||
|
||||
const Library({ required this.name, required this.license, required this.url });
|
||||
}
|
||||
@@ -2,100 +2,12 @@ import "dart:collection";
|
||||
import 'package:flutter/material.dart';
|
||||
import "package:moxxyv2/ui/constants.dart";
|
||||
import "package:moxxyv2/ui/widgets/topbar.dart";
|
||||
import "package:moxxyv2/data/libraries.dart";
|
||||
import "package:moxxyv2/data/generated/licenses.dart";
|
||||
|
||||
import "package:flutter_settings_ui/flutter_settings_ui.dart";
|
||||
import "package:url_launcher/url_launcher.dart";
|
||||
|
||||
// TODO: Maybe also include the License text
|
||||
|
||||
class Library {
|
||||
final String name;
|
||||
final String license;
|
||||
final String url;
|
||||
|
||||
const Library({ required this.name, required this.license, required this.url });
|
||||
}
|
||||
|
||||
// TODO: Maybe generate this list during build
|
||||
const List<Library> _USED_LIBRARIES = [
|
||||
Library(
|
||||
name: "flutter_settings_ui",
|
||||
license: "Apache-2.0",
|
||||
url: "https://github.com/juliansteenbakker/flutter_settings_ui"
|
||||
),
|
||||
Library(
|
||||
name: "flutter_speed_dial",
|
||||
license: "MIT",
|
||||
url: "https://github.com/darioielardi/flutter_speed_dial"
|
||||
),
|
||||
Library(
|
||||
name: "get_it",
|
||||
license: "MIT",
|
||||
url: "https://github.com/fluttercommunity/get_it"
|
||||
),
|
||||
Library(
|
||||
name: "redux",
|
||||
license: "MIT",
|
||||
url: "https://github.com/fluttercommunity/redux.dart"
|
||||
),
|
||||
Library(
|
||||
name: "flutter_redux",
|
||||
license: "MIT",
|
||||
url: "https://github.com/brianegan/flutter_redux"
|
||||
),
|
||||
Library(
|
||||
name: "badges",
|
||||
license: "Apache-2.0",
|
||||
url: "https://github.com/yadaniyil/flutter_badges"
|
||||
),
|
||||
Library(
|
||||
name: "url_launcher",
|
||||
license: "BSD-3-Clause",
|
||||
url: "https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher"
|
||||
),
|
||||
Library(
|
||||
name: "flutter_launcher_icons",
|
||||
license: "MIT",
|
||||
url: "https://github.com/fluttercommunity/flutter_launcher_icons"
|
||||
),
|
||||
Library(
|
||||
name: "flutter_lints",
|
||||
license: "BSD-3-Clause",
|
||||
url: "https://github.com/flutter/packages/tree/master/packages/flutter_lints"
|
||||
),
|
||||
Library(
|
||||
name: "floor",
|
||||
license: "Apache-2.0",
|
||||
url: "https://github.com/vitusortner/floor"
|
||||
),
|
||||
Library(
|
||||
name: "floor_generator",
|
||||
license: "Apache-2.0",
|
||||
url: "https://github.com/vitusortner/floor"
|
||||
),
|
||||
Library(
|
||||
name: "build_runner",
|
||||
license: "BSD-3-Clause",
|
||||
url: "https://github.com/dart-lang/build/tree/master/build_runner"
|
||||
),
|
||||
Library(
|
||||
name: "undraw.co",
|
||||
license: "custom license",
|
||||
url: "https://undraw.co/"
|
||||
),
|
||||
Library(
|
||||
// TODO: This is dangerous
|
||||
name: "xmpp-providers",
|
||||
license: "unknown license",
|
||||
url: "https://invent.kde.org/melvo/xmpp-providers"
|
||||
),
|
||||
Library(
|
||||
name: "qr_flutter",
|
||||
license: "BSD-3-Clause",
|
||||
url: "https://github.com/theyakka/qr.flutter"
|
||||
)
|
||||
];
|
||||
|
||||
class LicenseRow extends StatelessWidget {
|
||||
final Library library;
|
||||
|
||||
@@ -124,8 +36,8 @@ class SettingsLicensesPage extends StatelessWidget {
|
||||
return Scaffold(
|
||||
appBar: BorderlessTopbar.simple(title: "Licenses"),
|
||||
body: ListView.builder(
|
||||
itemCount: _USED_LIBRARIES.length,
|
||||
itemBuilder: (context, index) => LicenseRow(library: _USED_LIBRARIES[index])
|
||||
itemCount: usedLibraryList.length,
|
||||
itemBuilder: (context, index) => LicenseRow(library: usedLibraryList[index])
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user