MCSI-9 About and instruction tab #27
@ -8,6 +8,10 @@ abstract class Constants {
|
|||||||
static const eulaFileContent =
|
static const eulaFileContent =
|
||||||
'#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).\neula=true';
|
'#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).\neula=true';
|
||||||
static const eulaUrl = 'https://account.mojang.com/documents/minecraft_eula';
|
static const eulaUrl = 'https://account.mojang.com/documents/minecraft_eula';
|
||||||
|
static const tutorialVideoUrl = 'https://www.youtube.com/watch?v=yNis5vcueQY';
|
||||||
|
static const sourceCodeUrl = 'https://git.squidspirit.com/squid/minecraft-server-installer';
|
||||||
|
static const bugReportUrl = 'https://github.com/an920107/minecraft-server-installer/issues/new';
|
||||||
|
static const authorEmail = 'squid@squidspirit.com';
|
||||||
|
|
||||||
static final startScriptFileName = Platform.isWindows ? 'start.bat' : 'start.sh';
|
static final startScriptFileName = Platform.isWindows ? 'start.bat' : 'start.sh';
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import 'package:gap/gap.dart';
|
|||||||
import 'package:minecraft_server_installer/main/constants.dart';
|
import 'package:minecraft_server_installer/main/constants.dart';
|
||||||
import 'package:minecraft_server_installer/main/framework/ui/strings.dart';
|
import 'package:minecraft_server_installer/main/framework/ui/strings.dart';
|
||||||
import 'package:package_info_plus/package_info_plus.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
class AboutTab extends StatelessWidget {
|
class AboutTab extends StatelessWidget {
|
||||||
const AboutTab({super.key});
|
const AboutTab({super.key});
|
||||||
@ -67,13 +68,29 @@ class AboutTab extends StatelessWidget {
|
|||||||
const Gap(32),
|
const Gap(32),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
_actionButton(text: Strings.buttonTutorialVideo, svgAssetName: 'assets/svg/youtube.svg'),
|
_actionButton(
|
||||||
|
onPressed: () => launchUrl(Uri.parse(Constants.tutorialVideoUrl)),
|
||||||
|
text: Strings.buttonTutorialVideo,
|
||||||
|
svgAssetName: 'assets/svg/youtube.svg',
|
||||||
|
),
|
||||||
const Gap(12),
|
const Gap(12),
|
||||||
_actionButton(text: Strings.buttonBugReport, svgAssetName: 'assets/svg/bug.svg'),
|
_actionButton(
|
||||||
|
onPressed: () => launchUrl(Uri.parse(Constants.bugReportUrl)),
|
||||||
|
text: Strings.buttonBugReport,
|
||||||
|
svgAssetName: 'assets/svg/bug.svg',
|
||||||
|
),
|
||||||
const Gap(12),
|
const Gap(12),
|
||||||
_actionButton(text: Strings.buttonContactAuthor, svgAssetName: 'assets/svg/send.svg'),
|
_actionButton(
|
||||||
|
onPressed: () => launchUrl(Uri.parse('mailto:${Constants.authorEmail}')),
|
||||||
|
text: Strings.buttonContactAuthor,
|
||||||
|
svgAssetName: 'assets/svg/send.svg',
|
||||||
|
),
|
||||||
const Gap(12),
|
const Gap(12),
|
||||||
_actionButton(text: Strings.buttonSourceCode, svgAssetName: 'assets/svg/github.svg'),
|
_actionButton(
|
||||||
|
onPressed: () => launchUrl(Uri.parse(Constants.sourceCodeUrl)),
|
||||||
|
text: Strings.buttonSourceCode,
|
||||||
|
svgAssetName: 'assets/svg/github.svg',
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
@ -88,6 +105,7 @@ class AboutTab extends StatelessWidget {
|
|||||||
Widget _actionButton({
|
Widget _actionButton({
|
||||||
required String text,
|
required String text,
|
||||||
required String svgAssetName,
|
required String svgAssetName,
|
||||||
|
required void Function()? onPressed,
|
||||||
}) =>
|
}) =>
|
||||||
Builder(
|
Builder(
|
||||||
builder: (context) => Expanded(
|
builder: (context) => Expanded(
|
||||||
@ -100,7 +118,7 @@ class AboutTab extends StatelessWidget {
|
|||||||
border: Border.all(color: Colors.blueGrey.shade50, width: 2),
|
border: Border.all(color: Colors.blueGrey.shade50, width: 2),
|
||||||
),
|
),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {},
|
onTap: onPressed,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 32, horizontal: 16),
|
padding: const EdgeInsets.symmetric(vertical: 32, horizontal: 16),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user