mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 04:37:37 +02:00
feat: about info card and flutter convention style
This commit is contained in:
54
lib/ui/widgets/about_info_widget.dart
Normal file
54
lib/ui/widgets/about_info_widget.dart
Normal file
@ -0,0 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||
import 'package:revanced_manager/constants.dart';
|
||||
import 'package:revanced_manager/utils/about_info.dart';
|
||||
|
||||
class AboutWidget extends StatefulWidget {
|
||||
const AboutWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AboutWidget> createState() => _AboutWidgetState();
|
||||
}
|
||||
|
||||
class _AboutWidgetState extends State<AboutWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
I18nText(
|
||||
'settingsView.aboutLabel',
|
||||
child: Text('', style: kSettingItemTextStyle),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
FutureBuilder<Map<String, dynamic>>(
|
||||
future: AboutInfo.getInfo(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Version: ${snapshot.data!['version']}',
|
||||
style: kSettingItemSubtitleTextStyle),
|
||||
Text('Build: ${snapshot.data!['buildNumber']}',
|
||||
style: kSettingItemSubtitleTextStyle),
|
||||
Text('Model: ${snapshot.data!['model']}',
|
||||
style: kSettingItemSubtitleTextStyle),
|
||||
Text('Android Version: ${snapshot.data!['androidVersion']}',
|
||||
style: kSettingItemSubtitleTextStyle),
|
||||
Text('Arch: ${snapshot.data!['arch']}',
|
||||
style: kSettingItemSubtitleTextStyle),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return Container();
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -49,7 +49,7 @@ class AppSelectorCard extends StatelessWidget {
|
||||
'appSelectorCard.widgetSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: robotoTextStyle,
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
)
|
||||
: Row(
|
||||
@ -68,7 +68,7 @@ class AppSelectorCard extends StatelessWidget {
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
_getAppSelection(),
|
||||
style: robotoTextStyle,
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -67,7 +67,7 @@ class ApplicationItem extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
format(patchDate, locale: 'en_short'),
|
||||
style: robotoTextStyle.copyWith(
|
||||
style: kRobotoTextStyle.copyWith(
|
||||
color: Theme.of(context).colorScheme.tertiary,
|
||||
),
|
||||
),
|
||||
@ -100,12 +100,12 @@ class ApplicationItem extends StatelessWidget {
|
||||
'applicationItem.changelogLabel',
|
||||
child: Text(
|
||||
'',
|
||||
style: robotoTextStyle.copyWith(fontWeight: FontWeight.w700),
|
||||
style: kRobotoTextStyle.copyWith(fontWeight: FontWeight.w700),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
changelog,
|
||||
style: robotoTextStyle,
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -60,7 +60,7 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
widget.pkgName,
|
||||
style: robotoTextStyle,
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -61,7 +61,7 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
context,
|
||||
'latestCommitCard.loadingLabel',
|
||||
),
|
||||
style: robotoTextStyle,
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -91,7 +91,7 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
context,
|
||||
'latestCommitCard.loadingLabel',
|
||||
),
|
||||
style: robotoTextStyle,
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -48,7 +48,7 @@ class PatchSelectorCard extends StatelessWidget {
|
||||
'patchSelectorCard.widgetSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: robotoTextStyle,
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
)
|
||||
: locator<PatcherViewModel>().selectedPatches.isEmpty
|
||||
@ -56,12 +56,12 @@ class PatchSelectorCard extends StatelessWidget {
|
||||
'patchSelectorCard.widgetEmptySubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: robotoTextStyle,
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
_getPatchesSelection(),
|
||||
style: robotoTextStyle,
|
||||
style: kRobotoTextStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -37,7 +37,7 @@ class PatchTextButton extends StatelessWidget {
|
||||
child: I18nText(text,
|
||||
child: Text(
|
||||
'',
|
||||
style: interTextStyle.copyWith(
|
||||
style: kInterTextStyle.copyWith(
|
||||
color: backgroundColor == Colors.transparent
|
||||
? const Color.fromRGBO(119, 146, 186, 1)
|
||||
: isDark
|
||||
|
Reference in New Issue
Block a user