revanced-manager/lib/ui/widgets/settingsView/social_media_widget.dart

96 lines
3.3 KiB
Dart
Raw Normal View History

import 'package:expandable/expandable.dart';
2022-08-23 18:35:43 +02:00
import 'package:flutter/material.dart';
import 'package:flutter_i18n/flutter_i18n.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:revanced_manager/ui/widgets/settingsView/social_media_item.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_icon.dart';
2022-08-23 18:35:43 +02:00
class SocialMediaWidget extends StatelessWidget {
const SocialMediaWidget({
Key? key,
this.padding,
}) : super(key: key);
final EdgeInsetsGeometry? padding;
2022-08-23 18:35:43 +02:00
@override
Widget build(BuildContext context) {
return ExpandablePanel(
theme: ExpandableThemeData(
hasIcon: true,
iconColor: Theme.of(context).iconTheme.color,
iconPadding: const EdgeInsets.symmetric(vertical: 16.0)
.add(padding ?? EdgeInsets.zero)
.resolve(Directionality.of(context)),
animationDuration: const Duration(milliseconds: 400),
),
header: ListTile(
contentPadding: padding ?? EdgeInsets.zero,
title: I18nText(
'socialMediaCard.widgetTitle',
child: const Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
subtitle: I18nText('socialMediaCard.widgetSubtitle'),
),
expanded: Padding(
padding: padding ?? EdgeInsets.zero,
2023-05-14 12:45:35 +02:00
child: const CustomCard(
child: Column(
2023-05-14 12:45:35 +02:00
children: <Widget>[
SocialMediaItem(
icon: Icon(CustomIcon.revancedIcon),
title: Text('Website'),
subtitle: Text('revanced.app'),
url: 'https://revanced.app',
),
SocialMediaItem(
icon: FaIcon(FontAwesomeIcons.github),
title: Text('GitHub'),
subtitle: Text('github.com/revanced'),
url: 'https://github.com/revanced',
),
SocialMediaItem(
icon: FaIcon(FontAwesomeIcons.discord),
title: Text('Discord'),
subtitle: Text('discord.gg/revanced'),
url: 'https://discord.gg/rF2YcEjcrT',
),
SocialMediaItem(
icon: FaIcon(FontAwesomeIcons.telegram),
title: Text('Telegram'),
subtitle: Text('t.me/app_revanced'),
url: 'https://t.me/app_revanced',
),
SocialMediaItem(
icon: FaIcon(FontAwesomeIcons.reddit),
title: Text('Reddit'),
subtitle: Text('r/revancedapp'),
url: 'https://reddit.com/r/revancedapp',
),
SocialMediaItem(
2023-10-21 10:32:13 +02:00
icon: FaIcon(FontAwesomeIcons.xTwitter),
title: Text('X'),
subtitle: Text('@revancedapp'),
2023-10-21 10:32:13 +02:00
url: 'https://x.com/revancedapp',
),
SocialMediaItem(
icon: FaIcon(FontAwesomeIcons.youtube),
title: Text('YouTube'),
2023-09-21 01:16:55 +02:00
subtitle: Text('youtube.com/@revanced'),
url: 'https://youtube.com/@revanced',
),
],
),
),
2022-08-23 18:35:43 +02:00
),
collapsed: const SizedBox(),
2022-08-23 18:35:43 +02:00
);
}
}