mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 12:47:37 +02:00
feat: dpi responsive layout (#361)
This commit is contained in:
@ -70,7 +70,7 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
||||
},
|
||||
),
|
||||
),
|
||||
Row(
|
||||
Wrap(
|
||||
children: [
|
||||
I18nText(
|
||||
'suggested',
|
||||
@ -84,16 +84,14 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Flexible(
|
||||
child: Text(
|
||||
widget.patchesCount == 1
|
||||
? '• ${widget.patchesCount} patch'
|
||||
: '• ${widget.patchesCount} patches',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
Text(
|
||||
widget.patchesCount == 1
|
||||
? '• ${widget.patchesCount} patch'
|
||||
: '• ${widget.patchesCount} patches',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -64,7 +64,7 @@ class _NotInstalledAppItem extends State<NotInstalledAppItem> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
Wrap(
|
||||
children: [
|
||||
I18nText(
|
||||
'suggested',
|
||||
@ -78,16 +78,14 @@ class _NotInstalledAppItem extends State<NotInstalledAppItem> {
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Flexible(
|
||||
child: Text(
|
||||
widget.patchesCount == 1
|
||||
? '• ${widget.patchesCount} patch'
|
||||
: '• ${widget.patchesCount} patches',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
Text(
|
||||
widget.patchesCount == 1
|
||||
? '• ${widget.patchesCount} patch'
|
||||
: '• ${widget.patchesCount} patches',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -30,30 +30,28 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
const Row(
|
||||
children: <Widget>[
|
||||
Text('ReVanced Manager'),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
FutureBuilder<String?>(
|
||||
future: model.getLatestManagerReleaseTime(),
|
||||
builder: (context, snapshot) =>
|
||||
snapshot.hasData && snapshot.data!.isNotEmpty
|
||||
? I18nText(
|
||||
'latestCommitCard.timeagoLabel',
|
||||
translationParams: {'time': snapshot.data!},
|
||||
)
|
||||
: I18nText('latestCommitCard.loadingLabel'),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
const Text('ReVanced Manager'),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
FutureBuilder<String?>(
|
||||
future: model.getLatestManagerReleaseTime(),
|
||||
builder: (context, snapshot) => snapshot.hasData &&
|
||||
snapshot.data!.isNotEmpty
|
||||
? I18nText(
|
||||
'latestCommitCard.timeagoLabel',
|
||||
translationParams: {'time': snapshot.data!},
|
||||
)
|
||||
: I18nText('latestCommitCard.loadingLabel'),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
FutureBuilder<bool>(
|
||||
future: model.hasManagerUpdates(),
|
||||
@ -82,35 +80,33 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
const Row(
|
||||
children: <Widget>[
|
||||
Text('ReVanced Patches'),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
FutureBuilder<String?>(
|
||||
future: model.getLatestPatchesReleaseTime(),
|
||||
builder: (context, snapshot) => Text(
|
||||
snapshot.hasData && snapshot.data!.isNotEmpty
|
||||
? FlutterI18n.translate(
|
||||
context,
|
||||
'latestCommitCard.timeagoLabel',
|
||||
translationParams: {'time': snapshot.data!},
|
||||
)
|
||||
: FlutterI18n.translate(
|
||||
context,
|
||||
'latestCommitCard.loadingLabel',
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
const Text('ReVanced Patches'),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
FutureBuilder<String?>(
|
||||
future: model.getLatestPatchesReleaseTime(),
|
||||
builder: (context, snapshot) => Text(
|
||||
snapshot.hasData && snapshot.data!.isNotEmpty
|
||||
? FlutterI18n.translate(
|
||||
context,
|
||||
'latestCommitCard.timeagoLabel',
|
||||
translationParams: {'time': snapshot.data!},
|
||||
)
|
||||
: FlutterI18n.translate(
|
||||
context,
|
||||
'latestCommitCard.loadingLabel',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
FutureBuilder<bool>(
|
||||
future: locator<HomeViewModel>().hasPatchesUpdates(),
|
||||
|
@ -49,9 +49,11 @@ class AppSelectorCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
locator<PatcherViewModel>().getAppSelectionString(),
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
Flexible(
|
||||
child: Text(
|
||||
locator<PatcherViewModel>().getAppSelectionString(),
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -70,49 +70,66 @@ class _ApplicationItemState extends State<ApplicationItem>
|
||||
animationDuration: Duration(milliseconds: 450),
|
||||
),
|
||||
header: Row(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 40,
|
||||
child: Image.memory(widget.icon, height: 40, width: 40),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 15.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.name.length > 12
|
||||
? '${widget.name.substring(0, 12)}...'
|
||||
: widget.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 40,
|
||||
child: Image.memory(widget.icon, height: 40, width: 40),
|
||||
),
|
||||
const SizedBox(width: 19),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.name,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
format(widget.patchDate),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Text(format(widget.patchDate)),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
RotationTransition(
|
||||
turns:
|
||||
Tween(begin: 0.0, end: 0.50).animate(_animationController),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Icon(Icons.arrow_drop_down),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
CustomMaterialButton(
|
||||
label: widget.isUpdatableApp
|
||||
? I18nText('applicationItem.patchButton')
|
||||
: I18nText('applicationItem.infoButton'),
|
||||
onPressed: widget.onPressed,
|
||||
Row(
|
||||
children: [
|
||||
RotationTransition(
|
||||
turns: Tween(begin: 0.0, end: 0.50)
|
||||
.animate(_animationController),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Icon(Icons.arrow_drop_down),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
CustomMaterialButton(
|
||||
label: widget.isUpdatableApp
|
||||
? I18nText('applicationItem.patchButton')
|
||||
: I18nText('applicationItem.infoButton'),
|
||||
onPressed: widget.onPressed,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
Reference in New Issue
Block a user