mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 04:37:37 +02:00
feat: overall UI rework in Settings View (#53)
This commit is contained in:
@ -32,7 +32,7 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
@ -47,7 +47,7 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.name,
|
||||
maxLines: 2,
|
||||
|
@ -24,7 +24,7 @@ class _ContributorsCardState extends State<ContributorsCard> {
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0, horizontal: 4.0),
|
||||
child: Text(
|
||||
|
@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/models/patched_application.dart';
|
||||
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
||||
@ -22,7 +22,7 @@ class AvailableUpdatesCard extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Icon(
|
||||
Icons.update_disabled,
|
||||
size: 40,
|
||||
|
@ -1,10 +1,9 @@
|
||||
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';
|
||||
|
||||
class DashboardChip extends StatelessWidget {
|
||||
final String label;
|
||||
final Widget label;
|
||||
final bool isSelected;
|
||||
final Function(bool)? onSelected;
|
||||
|
||||
@ -19,7 +18,7 @@ class DashboardChip extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return RawChip(
|
||||
showCheckmark: false,
|
||||
label: I18nText(label),
|
||||
label: label,
|
||||
selected: isSelected,
|
||||
labelStyle: GoogleFonts.inter(
|
||||
color: isSelected
|
||||
|
@ -23,7 +23,7 @@ class InstalledAppsCard extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Icon(
|
||||
Icons.file_download_off,
|
||||
size: 40,
|
||||
|
@ -32,12 +32,12 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
I18nText(
|
||||
'latestCommitCard.patcherLabel',
|
||||
child: Text(
|
||||
@ -67,7 +67,7 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
I18nText(
|
||||
'latestCommitCard.managerLabel',
|
||||
child: Text(
|
||||
|
@ -1,16 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||
import 'package:revanced_manager/theme.dart';
|
||||
|
||||
class CustomMaterialButton extends StatelessWidget {
|
||||
final String text;
|
||||
final Widget label;
|
||||
final bool isFilled;
|
||||
final bool isExpanded;
|
||||
final Function()? onPressed;
|
||||
|
||||
const CustomMaterialButton({
|
||||
Key? key,
|
||||
required this.text,
|
||||
required this.label,
|
||||
this.isFilled = true,
|
||||
this.isExpanded = false,
|
||||
required this.onPressed,
|
||||
@ -62,7 +61,7 @@ class CustomMaterialButton extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
onPressed: onPressed,
|
||||
child: I18nText(text),
|
||||
child: label,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ class AppSelectorCard extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
I18nText(
|
||||
locator<PatcherViewModel>().selectedApp == null
|
||||
? 'appSelectorCard.widgetTitle'
|
||||
@ -50,7 +50,7 @@ class AppSelectorCard extends StatelessWidget {
|
||||
),
|
||||
)
|
||||
: Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 16.0,
|
||||
child: ClipOval(
|
||||
|
@ -27,7 +27,7 @@ class PatchSelectorCard extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
I18nText(
|
||||
locator<PatcherViewModel>().selectedPatches.isEmpty
|
||||
? 'patchSelectorCard.widgetTitle'
|
||||
|
@ -48,17 +48,17 @@ class _PatchItemState extends State<PatchItem> {
|
||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 12),
|
||||
margin: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Text(
|
||||
widget.simpleName,
|
||||
style: GoogleFonts.inter(
|
||||
@ -98,7 +98,7 @@ class _PatchItemState extends State<PatchItem> {
|
||||
),
|
||||
widget.isUnsupported
|
||||
? Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: TextButton.icon(
|
||||
|
@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
@ -15,7 +15,7 @@ class MagiskButton extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
GestureDetector(
|
||||
onTap: onPressed,
|
||||
child: CircleAvatar(
|
||||
|
@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:revanced_manager/constants.dart';
|
||||
import 'package:revanced_manager/theme.dart';
|
||||
import 'package:revanced_manager/utils/about_info.dart';
|
||||
@ -16,10 +16,10 @@ class _AboutWidgetState extends State<AboutWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
I18nText(
|
||||
'settingsView.aboutLabel',
|
||||
child: Text('', style: kSettingItemTextStyle),
|
||||
@ -54,7 +54,7 @@ class _AboutWidgetState extends State<AboutWidget> {
|
||||
},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Text('Version: ${snapshot.data!['version']}',
|
||||
style: kSettingItemSubtitleTextStyle),
|
||||
Text('Build: ${snapshot.data!['buildNumber']}',
|
@ -20,12 +20,12 @@ class CustomSwitch extends StatelessWidget {
|
||||
height: 25,
|
||||
width: 50,
|
||||
child: Stack(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
AnimatedContainer(
|
||||
height: 25,
|
||||
width: 50,
|
||||
curve: Curves.ease,
|
||||
duration: const Duration(milliseconds: 500),
|
||||
duration: const Duration(milliseconds: 400),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(25.0),
|
||||
@ -35,7 +35,7 @@ class CustomSwitch extends StatelessWidget {
|
||||
),
|
||||
AnimatedAlign(
|
||||
curve: Curves.ease,
|
||||
duration: const Duration(milliseconds: 500),
|
||||
duration: const Duration(milliseconds: 400),
|
||||
alignment: !value ? Alignment.centerLeft : Alignment.centerRight,
|
||||
child: Container(
|
||||
height: 20,
|
||||
|
@ -1,15 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||
import 'package:revanced_manager/constants.dart';
|
||||
import 'package:revanced_manager/ui/widgets/settingsView/custom_switch.dart';
|
||||
|
||||
class SettingsSwitchItem extends StatelessWidget {
|
||||
final String title;
|
||||
final String subtitle;
|
||||
class CustomSwitchTile extends StatelessWidget {
|
||||
final Widget title;
|
||||
final Widget subtitle;
|
||||
final bool value;
|
||||
final Function(bool) onTap;
|
||||
|
||||
const SettingsSwitchItem({
|
||||
const CustomSwitchTile({
|
||||
Key? key,
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
@ -20,14 +18,9 @@ class SettingsSwitchItem extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
title: I18nText(
|
||||
title,
|
||||
child: Text(
|
||||
'',
|
||||
style: kSettingItemTextStyle,
|
||||
),
|
||||
),
|
||||
subtitle: I18nText(subtitle),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
trailing: CustomSwitch(
|
||||
value: value,
|
||||
onChanged: onTap,
|
@ -1,10 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:revanced_manager/theme.dart';
|
||||
|
||||
class CustomTextField extends StatelessWidget {
|
||||
final TextEditingController inputController;
|
||||
final String label;
|
||||
final Widget label;
|
||||
final String hint;
|
||||
final Function(String)? onChanged;
|
||||
|
||||
@ -18,40 +17,42 @@ class CustomTextField extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const errorColor = Color(0xffEF4444);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
children: <Widget>[
|
||||
const SizedBox(height: 8),
|
||||
TextField(
|
||||
controller: inputController,
|
||||
onChanged: onChanged,
|
||||
keyboardType: TextInputType.text,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: isDark ? Colors.grey[300] : Colors.black,
|
||||
color: Theme.of(context).textTheme.headline5!.color,
|
||||
),
|
||||
cursorColor: Theme.of(context).textTheme.headline5!.color,
|
||||
decoration: InputDecoration(
|
||||
label: I18nText(label),
|
||||
labelStyle:
|
||||
TextStyle(color: isDark ? Colors.grey[300] : Colors.black),
|
||||
label: label,
|
||||
labelStyle: TextStyle(
|
||||
color: isDark ? Colors.grey[300] : Colors.black,
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Theme.of(context).colorScheme.primary,
|
||||
hintText: hint,
|
||||
hintStyle: TextStyle(color: Colors.grey.withOpacity(.75)),
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(vertical: 0.0, horizontal: 20.0),
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.grey.withOpacity(.75),
|
||||
),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
vertical: 0.0,
|
||||
horizontal: 20.0,
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).colorScheme.tertiary,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
gapPadding: 4.0,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
@ -59,18 +60,21 @@ class CustomTextField extends StatelessWidget {
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
errorBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide(color: errorColor, width: 1.0),
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Color(0xffEF4444),
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).colorScheme.tertiary,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
38
lib/ui/widgets/settingsView/settings_section.dart
Normal file
38
lib/ui/widgets/settingsView/settings_section.dart
Normal file
@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
|
||||
class SettingsSection extends StatelessWidget {
|
||||
final String title;
|
||||
final List<Widget> children;
|
||||
|
||||
const SettingsSection({
|
||||
Key? key,
|
||||
required this.title,
|
||||
required this.children,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: 16.0, bottom: 10.0),
|
||||
child: I18nText(
|
||||
title,
|
||||
child: Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: children,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
39
lib/ui/widgets/settingsView/settings_tile_dialog.dart
Normal file
39
lib/ui/widgets/settingsView/settings_tile_dialog.dart
Normal file
@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:revanced_manager/constants.dart';
|
||||
|
||||
class SettingsTileDialog extends StatelessWidget {
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final List<Widget> children;
|
||||
|
||||
const SettingsTileDialog({
|
||||
Key? key,
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
required this.children,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: I18nText(
|
||||
title,
|
||||
child: Text(
|
||||
'',
|
||||
style: kSettingItemTextStyle,
|
||||
),
|
||||
),
|
||||
subtitle: I18nText(subtitle),
|
||||
onTap: () => showDialog(
|
||||
context: context,
|
||||
builder: (context) => SimpleDialog(
|
||||
title: I18nText(title),
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
children: children,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,11 +1,13 @@
|
||||
import 'package:expandable/expandable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:revanced_manager/constants.dart';
|
||||
import 'package:revanced_manager/theme.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class SocialMediaCards extends StatelessWidget {
|
||||
const SocialMediaCards({Key? key}) : super(key: key);
|
||||
class SocialMediaWidget extends StatelessWidget {
|
||||
const SocialMediaWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -13,30 +15,39 @@ class SocialMediaCards extends StatelessWidget {
|
||||
theme: ExpandableThemeData(
|
||||
hasIcon: true,
|
||||
iconColor: Theme.of(context).iconTheme.color,
|
||||
animationDuration: const Duration(milliseconds: 450),
|
||||
iconPadding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||
animationDuration: const Duration(milliseconds: 400),
|
||||
),
|
||||
header: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: I18nText(
|
||||
'socialMediaCards.widgetTitle',
|
||||
'socialMediaCard.widgetTitle',
|
||||
child: Text('', style: kSettingItemTextStyle),
|
||||
),
|
||||
subtitle: I18nText(
|
||||
'socialMediaCard.widgetSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
color: isDark ? Colors.grey[400] : Colors.grey[600],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
expanded: Card(
|
||||
color: Theme.of(context).backgroundColor,
|
||||
color: isDark
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).navigationBarTheme.backgroundColor!,
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0),
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
'assets/images/github.png',
|
||||
height: 24,
|
||||
width: 24,
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.github,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
),
|
||||
),
|
||||
@ -48,29 +59,25 @@ class SocialMediaCards extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0),
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Icon(
|
||||
Icons.discord,
|
||||
padding: const EdgeInsets.all(8.0).copyWith(left: 5),
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.discord,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
),
|
||||
),
|
||||
title: const Text('Discord'),
|
||||
subtitle: const Text('discord.gg/revanced'),
|
||||
onTap: () => launchUrl(
|
||||
Uri.parse('https://discord.gg/3E2pTWR4Yd'),
|
||||
Uri.parse('https://discord.gg/rF2YcEjcrT'),
|
||||
mode: LaunchMode.externalApplication,
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0),
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Icon(
|
||||
Icons.telegram,
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.telegram,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
),
|
||||
),
|
||||
@ -82,12 +89,10 @@ class SocialMediaCards extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0),
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Icon(
|
||||
Icons.reddit,
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.reddit,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
),
|
||||
),
|
||||
@ -99,48 +104,39 @@ class SocialMediaCards extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0),
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
'assets/images/twitter.png',
|
||||
height: 24,
|
||||
width: 24,
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.twitter,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
),
|
||||
),
|
||||
title: const Text('Twitter'),
|
||||
subtitle: const Text('@revancedapp'),
|
||||
onTap: () => launchUrl(
|
||||
Uri.parse('https://twitter.com/@revancedapp'),
|
||||
Uri.parse('https://twitter.com/revancedapp'),
|
||||
mode: LaunchMode.externalApplication,
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0),
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
'assets/images/youtube.png',
|
||||
height: 24,
|
||||
width: 24,
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.youtube,
|
||||
color: Theme.of(context).iconTheme.color,
|
||||
),
|
||||
),
|
||||
title: const Text('YouTube'),
|
||||
subtitle: const Text('youtube.com/revanced'),
|
||||
onTap: () => launchUrl(
|
||||
Uri.parse(
|
||||
'https://www.youtube.com/channel/UCLktAUh5Gza9zAJBStwxNdw'),
|
||||
Uri.parse('https://youtube.com/revanced'),
|
||||
mode: LaunchMode.externalApplication,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
collapsed: const Text(''),
|
||||
collapsed: Container(),
|
||||
);
|
||||
}
|
||||
}
|
80
lib/ui/widgets/settingsView/sources_widget.dart
Normal file
80
lib/ui/widgets/settingsView/sources_widget.dart
Normal file
@ -0,0 +1,80 @@
|
||||
import 'package:expandable/expandable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||
import 'package:revanced_manager/constants.dart';
|
||||
import 'package:revanced_manager/theme.dart';
|
||||
import 'package:revanced_manager/ui/widgets/settingsView/custom_text_field.dart';
|
||||
|
||||
class SourcesWidget extends StatelessWidget {
|
||||
final String title;
|
||||
final TextEditingController organizationController;
|
||||
final TextEditingController patchesSourceController;
|
||||
final TextEditingController integrationsSourceController;
|
||||
|
||||
const SourcesWidget({
|
||||
Key? key,
|
||||
required this.title,
|
||||
required this.organizationController,
|
||||
required this.patchesSourceController,
|
||||
required this.integrationsSourceController,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ExpandablePanel(
|
||||
theme: ExpandableThemeData(
|
||||
hasIcon: true,
|
||||
iconColor: Theme.of(context).iconTheme.color,
|
||||
iconPadding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||
animationDuration: const Duration(milliseconds: 400),
|
||||
),
|
||||
header: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: I18nText(
|
||||
'sourcesCard.widgetTitle',
|
||||
child: Text('', style: kSettingItemTextStyle),
|
||||
),
|
||||
subtitle: I18nText(
|
||||
'sourcesCard.widgetSubtitle',
|
||||
child: Text(
|
||||
'',
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
color: isDark ? Colors.grey[400] : Colors.grey[600],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
expanded: Card(
|
||||
color: isDark
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).navigationBarTheme.backgroundColor!,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
CustomTextField(
|
||||
inputController: organizationController,
|
||||
label: I18nText('sourcesCard.organizationLabel'),
|
||||
hint: ghOrg,
|
||||
onChanged: (value) => ghOrg = value,
|
||||
),
|
||||
CustomTextField(
|
||||
inputController: patchesSourceController,
|
||||
label: I18nText('sourcesCard.patchesSourceLabel'),
|
||||
hint: patchesRepo,
|
||||
onChanged: (value) => patchesRepo = value,
|
||||
),
|
||||
CustomTextField(
|
||||
inputController: integrationsSourceController,
|
||||
label: I18nText('sourcesCard.integrationsSourceLabel'),
|
||||
hint: integrationsRepo,
|
||||
onChanged: (value) => integrationsRepo = value,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
collapsed: Container(),
|
||||
);
|
||||
}
|
||||
}
|
@ -41,7 +41,7 @@ class ApplicationItem extends StatelessWidget {
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 12.0),
|
||||
child: Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 60,
|
||||
child: Image.memory(
|
||||
@ -55,7 +55,7 @@ class ApplicationItem extends StatelessWidget {
|
||||
width: MediaQuery.of(context).size.width - 250,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Text(
|
||||
name,
|
||||
style: GoogleFonts.roboto(
|
||||
@ -93,7 +93,7 @@ class ApplicationItem extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
I18nText(
|
||||
'applicationItem.changelogLabel',
|
||||
child: Text(
|
||||
|
39
lib/ui/widgets/shared/custom_sliver_app_bar.dart
Normal file
39
lib/ui/widgets/shared/custom_sliver_app_bar.dart
Normal file
@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:revanced_manager/theme.dart';
|
||||
|
||||
class CustomSliverAppBar extends StatelessWidget {
|
||||
final Widget title;
|
||||
final PreferredSizeWidget? bottom;
|
||||
|
||||
const CustomSliverAppBar({
|
||||
Key? key,
|
||||
required this.title,
|
||||
this.bottom,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SliverAppBar(
|
||||
pinned: true,
|
||||
snap: false,
|
||||
floating: false,
|
||||
expandedHeight: 100.0,
|
||||
automaticallyImplyLeading: false,
|
||||
backgroundColor: MaterialStateColor.resolveWith(
|
||||
(states) => states.contains(MaterialState.scrolledUnder)
|
||||
? isDark
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).navigationBarTheme.backgroundColor!
|
||||
: Theme.of(context).scaffoldBackgroundColor,
|
||||
),
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
titlePadding: const EdgeInsets.symmetric(
|
||||
vertical: 23.0,
|
||||
horizontal: 20.0,
|
||||
),
|
||||
title: title,
|
||||
),
|
||||
bottom: bottom,
|
||||
);
|
||||
}
|
||||
}
|
@ -44,7 +44,7 @@ class _SearchBarState extends State<SearchBar> {
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: TextFormField(
|
||||
onChanged: widget.onQueryChanged,
|
||||
|
Reference in New Issue
Block a user