dateapp/lib/widgets/dialogs/community.dart

92 lines
3.0 KiB
Dart
Raw Normal View History

2024-03-03 18:04:45 +07:00
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_svg/flutter_svg.dart';
const discordSVG = "assets/app_icons/external/Discord.svg";
const matrixSVG = "assets/app_icons/external/Matrix.svg";
const telegramSVG = "assets/app_icons/external/Telegram.svg";
2024-03-03 18:04:45 +07:00
Future<void> communityDialogBuilder(BuildContext context) {
return showDialog<void>(
context: context,
builder: (BuildContext context) {
return SimpleDialog(
title: const Text('Join our community!'),
children: <Widget>[
SimpleDialogOption(
onPressed: () async {
await launchUrl(Uri.parse('https://discord.gg/WDxuJRsBPp'),
mode: LaunchMode.externalApplication);
},
child: Row(
children: <Widget>[
Expanded(
child: SvgPicture.asset(
discordSVG,
semanticsLabel: 'Discord Logo',
colorFilter:
const ColorFilter.mode(Colors.white, BlendMode.srcIn),
width: 50,
height: 50,
),
),
const Expanded(
child: Text('Discord', textAlign: TextAlign.center),
),
2024-03-03 18:04:45 +07:00
],
),
),
SimpleDialogOption(
onPressed: () async {
await launchUrl(
2024-03-04 09:09:57 +07:00
Uri.parse(
'https://matrix.to/#/#datecalc:matrix.winscloud.net'),
mode: LaunchMode.externalApplication);
},
child: Row(
children: <Widget>[
Expanded(
child: SvgPicture.asset(
matrixSVG,
semanticsLabel: 'Matrix Logo',
colorFilter:
const ColorFilter.mode(Colors.white, BlendMode.srcIn),
width: 50,
height: 50,
),
),
const Expanded(
child: Text('Matrix', textAlign: TextAlign.center),
),
],
2024-03-03 18:04:45 +07:00
),
),
SimpleDialogOption(
onPressed: () async {
await launchUrl(Uri.parse('https://t.me/datecalc'),
mode: LaunchMode.externalApplication);
2024-03-03 18:04:45 +07:00
},
child: Row(
children: <Widget>[
Expanded(
child: SvgPicture.asset(
telegramSVG,
semanticsLabel: 'Telegram Logo',
colorFilter:
const ColorFilter.mode(Colors.white, BlendMode.srcIn),
width: 50,
height: 50,
),
),
const Expanded(
child: Text('Telegram', textAlign: TextAlign.center),
),
],
),
2024-03-03 18:04:45 +07:00
),
],
);
},
);
}