mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
feat: expandable card for social media cards.
This commit is contained in:
parent
cb2b405b3f
commit
06b90244b4
@ -45,6 +45,9 @@
|
|||||||
"widgetSubtitle": "Select an application first.",
|
"widgetSubtitle": "Select an application first.",
|
||||||
"widgetEmptySubtitle": "No patches selected."
|
"widgetEmptySubtitle": "No patches selected."
|
||||||
},
|
},
|
||||||
|
"socialMediaCards": {
|
||||||
|
"widgetTitle": "Social Media"
|
||||||
|
},
|
||||||
"appSelectorView": {
|
"appSelectorView": {
|
||||||
"searchBarHint": "Search applications",
|
"searchBarHint": "Search applications",
|
||||||
"fabButton": "Storage",
|
"fabButton": "Storage",
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
|
import 'package:expandable/expandable.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||||
|
import 'package:revanced_manager/constants.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
class SocialMediaCards extends StatelessWidget {
|
class SocialMediaCards extends StatelessWidget {
|
||||||
@ -6,121 +9,138 @@ class SocialMediaCards extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Card(
|
return ExpandablePanel(
|
||||||
color: Theme.of(context).backgroundColor,
|
theme: ExpandableThemeData(
|
||||||
child: Column(
|
hasIcon: true,
|
||||||
children: [
|
iconColor: Theme.of(context).iconTheme.color,
|
||||||
ListTile(
|
animationDuration: const Duration(milliseconds: 450),
|
||||||
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,
|
|
||||||
color: Theme.of(context).iconTheme.color,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
title: const Text('GitHub'),
|
|
||||||
subtitle: const Text('github.com/revanced'),
|
|
||||||
onTap: () => launchUrl(
|
|
||||||
Uri.parse('https://github.com/revanced'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
contentPadding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0),
|
|
||||||
leading: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Icon(
|
|
||||||
Icons.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'),
|
|
||||||
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,
|
|
||||||
color: Theme.of(context).iconTheme.color,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
title: const Text('Telegram'),
|
|
||||||
subtitle: const Text('t.me/app_revanced'),
|
|
||||||
onTap: () => launchUrl(
|
|
||||||
Uri.parse('https://t.me/app_revanced'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
contentPadding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0),
|
|
||||||
leading: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Icon(
|
|
||||||
Icons.reddit,
|
|
||||||
color: Theme.of(context).iconTheme.color,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
title: const Text('Reddit'),
|
|
||||||
subtitle: const Text('r/revancedapp'),
|
|
||||||
onTap: () => launchUrl(
|
|
||||||
Uri.parse('https://reddit.com/r/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/twitter.png',
|
|
||||||
height: 24,
|
|
||||||
width: 24,
|
|
||||||
color: Theme.of(context).iconTheme.color,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
title: const Text('Twitter'),
|
|
||||||
subtitle: const Text('@revancedapp'),
|
|
||||||
onTap: () => launchUrl(
|
|
||||||
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,
|
|
||||||
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'),
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
header: SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: ListTile(
|
||||||
|
title: I18nText(
|
||||||
|
'socialMediaCards.widgetTitle',
|
||||||
|
child: Text('', style: kSettingItemTextStyle),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
expanded: Card(
|
||||||
|
color: Theme.of(context).backgroundColor,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
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,
|
||||||
|
color: Theme.of(context).iconTheme.color,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
title: const Text('GitHub'),
|
||||||
|
subtitle: const Text('github.com/revanced'),
|
||||||
|
onTap: () => launchUrl(
|
||||||
|
Uri.parse('https://github.com/revanced'),
|
||||||
|
mode: LaunchMode.externalApplication,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0),
|
||||||
|
leading: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Icon(
|
||||||
|
Icons.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'),
|
||||||
|
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,
|
||||||
|
color: Theme.of(context).iconTheme.color,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
title: const Text('Telegram'),
|
||||||
|
subtitle: const Text('t.me/app_revanced'),
|
||||||
|
onTap: () => launchUrl(
|
||||||
|
Uri.parse('https://t.me/app_revanced'),
|
||||||
|
mode: LaunchMode.externalApplication,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
contentPadding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 16).copyWith(top: 0),
|
||||||
|
leading: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Icon(
|
||||||
|
Icons.reddit,
|
||||||
|
color: Theme.of(context).iconTheme.color,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
title: const Text('Reddit'),
|
||||||
|
subtitle: const Text('r/revancedapp'),
|
||||||
|
onTap: () => launchUrl(
|
||||||
|
Uri.parse('https://reddit.com/r/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/twitter.png',
|
||||||
|
height: 24,
|
||||||
|
width: 24,
|
||||||
|
color: Theme.of(context).iconTheme.color,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
title: const Text('Twitter'),
|
||||||
|
subtitle: const Text('@revancedapp'),
|
||||||
|
onTap: () => launchUrl(
|
||||||
|
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,
|
||||||
|
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'),
|
||||||
|
mode: LaunchMode.externalApplication,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
collapsed: const Text(""),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user