about: removed license sort menu
This commit is contained in:
parent
c080de2f9a
commit
0227325781
3 changed files with 16 additions and 62 deletions
|
@ -290,12 +290,6 @@
|
||||||
"@aboutLicenses": {},
|
"@aboutLicenses": {},
|
||||||
"aboutLicensesBanner": "This app uses the following open-source packages and libraries.",
|
"aboutLicensesBanner": "This app uses the following open-source packages and libraries.",
|
||||||
"@aboutLicensesBanner": {},
|
"@aboutLicensesBanner": {},
|
||||||
"aboutLicensesSortTooltip": "Sort",
|
|
||||||
"@aboutLicensesSortTooltip": {},
|
|
||||||
"aboutLicensesSortByName": "Sort by name",
|
|
||||||
"@aboutLicensesSortByName": {},
|
|
||||||
"aboutLicensesSortByLicense": "Sort by license",
|
|
||||||
"@aboutLicensesSortByLicense": {},
|
|
||||||
"aboutLicensesAndroidLibraries": "Android Libraries",
|
"aboutLicensesAndroidLibraries": "Android Libraries",
|
||||||
"@aboutLicensesAndroidLibraries": {},
|
"@aboutLicensesAndroidLibraries": {},
|
||||||
"aboutLicensesFlutterPlugins": "Flutter Plugins",
|
"aboutLicensesFlutterPlugins": "Flutter Plugins",
|
||||||
|
|
|
@ -132,9 +132,6 @@
|
||||||
"aboutCreditsWorldAtlas2": "의 TopoJSON 파일(ISC 라이선스)을 이용합니다.",
|
"aboutCreditsWorldAtlas2": "의 TopoJSON 파일(ISC 라이선스)을 이용합니다.",
|
||||||
"aboutLicenses": "오픈 소스 라이선스",
|
"aboutLicenses": "오픈 소스 라이선스",
|
||||||
"aboutLicensesBanner": "이 앱은 다음의 오픈 소스 패키지와 라이브러리를 이용합니다.",
|
"aboutLicensesBanner": "이 앱은 다음의 오픈 소스 패키지와 라이브러리를 이용합니다.",
|
||||||
"aboutLicensesSortTooltip": "정렬",
|
|
||||||
"aboutLicensesSortByName": "이름순 정렬",
|
|
||||||
"aboutLicensesSortByLicense": "라이선스순 정렬",
|
|
||||||
"aboutLicensesAndroidLibraries": "안드로이드 라이브러리",
|
"aboutLicensesAndroidLibraries": "안드로이드 라이브러리",
|
||||||
"aboutLicensesFlutterPlugins": "플러터 플러그인",
|
"aboutLicensesFlutterPlugins": "플러터 플러그인",
|
||||||
"aboutLicensesFlutterPackages": "플러터 패키지",
|
"aboutLicensesFlutterPackages": "플러터 패키지",
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import 'package:aves/ref/brand_colors.dart';
|
import 'package:aves/ref/brand_colors.dart';
|
||||||
import 'package:aves/theme/icons.dart';
|
|
||||||
import 'package:aves/utils/constants.dart';
|
import 'package:aves/utils/constants.dart';
|
||||||
import 'package:aves/widgets/common/basic/link_chip.dart';
|
import 'package:aves/widgets/common/basic/link_chip.dart';
|
||||||
import 'package:aves/widgets/common/basic/menu_row.dart';
|
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
import 'package:aves/widgets/common/identity/aves_expansion_tile.dart';
|
import 'package:aves/widgets/common/identity/aves_expansion_tile.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
|
@ -15,7 +13,6 @@ class Licenses extends StatefulWidget {
|
||||||
|
|
||||||
class _LicensesState extends State<Licenses> {
|
class _LicensesState extends State<Licenses> {
|
||||||
final ValueNotifier<String> _expandedNotifier = ValueNotifier(null);
|
final ValueNotifier<String> _expandedNotifier = ValueNotifier(null);
|
||||||
LicenseSort _sort = LicenseSort.name;
|
|
||||||
List<Dependency> _platform, _flutterPlugins, _flutterPackages, _dartPackages;
|
List<Dependency> _platform, _flutterPlugins, _flutterPackages, _dartPackages;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -29,17 +26,7 @@ class _LicensesState extends State<Licenses> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _sortPackages() {
|
void _sortPackages() {
|
||||||
int compare(Dependency a, Dependency b) {
|
int compare(Dependency a, Dependency b) => compareAsciiUpperCase(a.name, b.name);
|
||||||
switch (_sort) {
|
|
||||||
case LicenseSort.license:
|
|
||||||
final c = compareAsciiUpperCase(a.license, b.license);
|
|
||||||
return c != 0 ? c : compareAsciiUpperCase(a.name, b.name);
|
|
||||||
case LicenseSort.name:
|
|
||||||
default:
|
|
||||||
return compareAsciiUpperCase(a.name, b.name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_platform.sort(compare);
|
_platform.sort(compare);
|
||||||
_flutterPlugins.sort(compare);
|
_flutterPlugins.sort(compare);
|
||||||
_flutterPackages.sort(compare);
|
_flutterPackages.sort(compare);
|
||||||
|
@ -103,44 +90,22 @@ class _LicensesState extends State<Licenses> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildHeader() {
|
Widget _buildHeader() {
|
||||||
return Column(
|
return Padding(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||||
children: [
|
child: Column(
|
||||||
Padding(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
padding: EdgeInsetsDirectional.only(start: 8),
|
children: [
|
||||||
child: Row(
|
ConstrainedBox(
|
||||||
children: [
|
constraints: BoxConstraints(minHeight: 48),
|
||||||
Expanded(
|
child: Align(
|
||||||
child: Text(context.l10n.aboutLicenses, style: Constants.titleTextStyle),
|
alignment: AlignmentDirectional.centerStart,
|
||||||
),
|
child: Text(context.l10n.aboutLicenses, style: Constants.titleTextStyle),
|
||||||
PopupMenuButton<LicenseSort>(
|
),
|
||||||
itemBuilder: (context) => [
|
|
||||||
PopupMenuItem(
|
|
||||||
value: LicenseSort.name,
|
|
||||||
child: MenuRow(text: context.l10n.aboutLicensesSortByName, checked: _sort == LicenseSort.name),
|
|
||||||
),
|
|
||||||
PopupMenuItem(
|
|
||||||
value: LicenseSort.license,
|
|
||||||
child: MenuRow(text: context.l10n.aboutLicensesSortByLicense, checked: _sort == LicenseSort.license),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
onSelected: (newSort) {
|
|
||||||
_sort = newSort;
|
|
||||||
_sortPackages();
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
tooltip: context.l10n.aboutLicensesSortTooltip,
|
|
||||||
icon: Icon(AIcons.sort),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
SizedBox(height: 8),
|
||||||
SizedBox(height: 8),
|
Text(context.l10n.aboutLicensesBanner),
|
||||||
Padding(
|
],
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
),
|
||||||
child: Text(context.l10n.aboutLicensesBanner),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -179,5 +144,3 @@ class LicenseRow extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum LicenseSort { license, name }
|
|
||||||
|
|
Loading…
Reference in a new issue