fix: add animations and fix some UI incoherences

This commit is contained in:
Alberto Ponces
2022-09-01 01:25:19 +01:00
parent 596d4f0def
commit a580375078
16 changed files with 153 additions and 122 deletions

View File

@ -40,7 +40,7 @@ class _ContributorsCardState extends State<ContributorsCard> {
padding: const EdgeInsets.all(4.0),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.tertiary,
borderRadius: BorderRadius.circular(8.0),
borderRadius: BorderRadius.circular(12),
),
height: widget.height,
child: GridView.builder(

View File

@ -34,7 +34,7 @@ class DashboardChip extends StatelessWidget {
isDark ? Theme.of(context).colorScheme.background : Colors.white,
selectedColor: const Color.fromRGBO(118, 155, 209, 0.42),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
borderRadius: BorderRadius.circular(12),
side: BorderSide(
width: 1,
color: isDark

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager/theme.dart';
import 'package:revanced_manager/ui/widgets/shared/patch_text_button.dart';
// ignore: must_be_immutable
class PatchItem extends StatefulWidget {
@ -87,7 +87,7 @@ class _PatchItemState extends State<PatchItem> {
scale: 1.2,
child: Checkbox(
value: widget.isSelected,
activeColor: Colors.blueGrey[500],
activeColor: Theme.of(context).colorScheme.secondary,
onChanged: (newValue) {
setState(() => widget.isSelected = newValue!);
widget.onChanged(widget.isSelected);
@ -117,9 +117,7 @@ class _PatchItemState extends State<PatchItem> {
),
),
backgroundColor: MaterialStateProperty.all(
isDark
? Theme.of(context).colorScheme.background
: Colors.white,
Colors.transparent,
),
foregroundColor: MaterialStateProperty.all(
Theme.of(context).colorScheme.secondary,
@ -137,10 +135,12 @@ class _PatchItemState extends State<PatchItem> {
}
Future<void> _showUnsupportedWarningDialog() {
return showDialog(
return showGeneralDialog(
context: context,
builder: (context) {
return AlertDialog(
pageBuilder: (ctx, a1, a2) => Container(),
transitionBuilder: (ctx, a1, a2, child) => Transform.scale(
scale: Curves.easeInOut.transform(a1.value),
child: AlertDialog(
title: I18nText('patchItem.alertDialogTitle'),
content: I18nText(
'patchItem.alertDialogText',
@ -151,13 +151,17 @@ class _PatchItemState extends State<PatchItem> {
},
),
actions: [
TextButton(
child: I18nText('okButton'),
PatchTextButton(
text: FlutterI18n.translate(context, 'okButton'),
onPressed: () => Navigator.of(context).pop(),
backgroundColor: Theme.of(context).colorScheme.secondary,
borderColor: Theme.of(context).colorScheme.secondary,
)
],
);
},
backgroundColor: Theme.of(context).colorScheme.surface,
),
),
transitionDuration: const Duration(milliseconds: 400),
);
}
}

View File

@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_i18n/widgets/I18nText.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager/theme.dart';
class MagiskButton extends StatelessWidget {
final Function() onPressed;
@ -20,14 +19,12 @@ class MagiskButton extends StatelessWidget {
onTap: onPressed,
child: CircleAvatar(
radius: 32,
backgroundColor: isDark
? Theme.of(context).colorScheme.secondary
: const Color(0xffCBDFFC),
backgroundColor: Theme.of(context).colorScheme.secondary,
child: SvgPicture.asset(
'assets/images/magisk.svg',
color: isDark ? Colors.white70 : Colors.grey[900],
height: 50,
width: 50,
color: Theme.of(context).colorScheme.surface,
height: 40,
width: 40,
),
),
),

View File

@ -36,9 +36,7 @@ class ApplicationItem extends StatelessWidget {
header: Container(
height: 60,
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(
Radius.circular(16),
),
borderRadius: BorderRadius.circular(12),
color: Theme.of(context).colorScheme.primary,
),
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 12.0),

View File

@ -49,6 +49,7 @@ class _SearchBarState extends State<SearchBar> {
child: TextFormField(
onChanged: widget.onQueryChanged,
controller: _textController,
cursorColor: Theme.of(context).textTheme.headline5!.color,
decoration: InputDecoration(
fillColor: widget.fillColor,
filled: true,
@ -58,9 +59,10 @@ class _SearchBarState extends State<SearchBar> {
color: widget.hintTextColor,
fontWeight: FontWeight.w400,
),
prefixIcon: const Icon(
prefixIcon: Icon(
Icons.search,
size: 24.0,
color: Theme.of(context).iconTheme.color,
),
suffixIcon: _textController.text.isNotEmpty
? IconButton(
@ -88,12 +90,12 @@ class _SearchBarState extends State<SearchBar> {
)
: null,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
),
style: GoogleFonts.poppins(
color: Colors.white,
color: Theme.of(context).textTheme.headline5!.color,
fontWeight: FontWeight.w400,
fontSize: 16,
),