chore: license the project under AGPL-3.0
- 添加官方 AGPL-3.0 全文 - LICENSE 作为 asset 打包,注册进 Flutter 许可清单 - 关于页「开源许可」改为打开许可页 - README 补充简介、开发命令与许可说明
This commit is contained in:
1 parent
22715f7247
commit
1a48833914
6 files changed
+727
-17
No files matched your search
@@ -1,13 +1,26 @@
|
||||
import 'package:flutter/cupertino.dart' show CupertinoPageTransitionsBuilder;
|
||||
import 'package:flutter/foundation.dart'
|
||||
show LicenseEntryWithLineBreaks, LicenseRegistry;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart' show rootBundle;
|
||||
|
||||
import 'app_info.dart';
|
||||
import 'app_shell.dart';
|
||||
|
||||
void main() {
|
||||
_registerAppLicense();
|
||||
runApp(const KiriMemoApp());
|
||||
}
|
||||
|
||||
/// 把 LICENSE(AGPL-3.0)注册进 Flutter 的许可清单,
|
||||
/// 这样「关于 → 开源许可」里会和应用依赖的许可显示在一起。
|
||||
void _registerAppLicense() {
|
||||
LicenseRegistry.addLicense(() async* {
|
||||
final String text = await rootBundle.loadString('LICENSE');
|
||||
yield LicenseEntryWithLineBreaks(<String>[appName], text);
|
||||
});
|
||||
}
|
||||
|
||||
class KiriMemoApp extends StatelessWidget {
|
||||
const KiriMemoApp({super.key});
|
||||
|
||||
|
||||
@@ -63,16 +63,15 @@ class AboutPage extends StatelessWidget {
|
||||
color: colors.onSurfaceVariant,
|
||||
),
|
||||
title: const Text('开源许可'),
|
||||
subtitle: const Text('MIT License'),
|
||||
subtitle: const Text('GNU AGPL v3.0'),
|
||||
trailing: Icon(
|
||||
Icons.chevron_right_rounded,
|
||||
color: colors.onSurfaceVariant,
|
||||
),
|
||||
onTap: () => ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('许可文本尚未接入'),
|
||||
behavior: SnackBarBehavior.floating,
|
||||
),
|
||||
onTap: () => showLicensePage(
|
||||
context: context,
|
||||
applicationName: appName,
|
||||
applicationVersion: appVersion,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user