12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- // @dart=2.9
- import 'dart:io';
- import 'package:expandable/expandable.dart';
- import 'package:flutter/material.dart';
- import 'package:photos/core/configuration.dart';
- import 'package:photos/core/constants.dart';
- import 'package:photos/ui/common/web_page.dart';
- import 'package:photos/ui/settings/common_settings.dart';
- import 'package:photos/ui/settings/settings_section_title.dart';
- import 'package:photos/ui/settings/settings_text_item.dart';
- import 'package:photos/utils/email_util.dart';
- class SupportSectionWidget extends StatelessWidget {
- const SupportSectionWidget({Key key}) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return ExpandablePanel(
- header: const SettingsSectionTitle("Support"),
- collapsed: Container(),
- expanded: _getSectionOptions(context),
- theme: getExpandableTheme(context),
- );
- }
- Widget _getSectionOptions(BuildContext context) {
- final String bugsEmail =
- Platform.isAndroid ? "android-bugs@ente.io" : "ios-bugs@ente.io";
- return Column(
- children: [
- GestureDetector(
- behavior: HitTestBehavior.translucent,
- onTap: () async {
- await sendEmail(context, to: supportEmail);
- },
- child:
- const SettingsTextItem(text: "Email", icon: Icons.navigate_next),
- ),
- sectionOptionDivider,
- GestureDetector(
- behavior: HitTestBehavior.translucent,
- onTap: () {
- Navigator.of(context).push(
- MaterialPageRoute(
- builder: (BuildContext context) {
- final endpoint = Configuration.instance.getHttpEndpoint() +
- "/users/roadmap";
- final isLoggedIn = Configuration.instance.getToken() != null;
- final url = isLoggedIn
- ? endpoint + "?token=" + Configuration.instance.getToken()
- : roadmapURL;
- return WebPage("Roadmap", url);
- },
- ),
- );
- },
- child: const SettingsTextItem(
- text: "Roadmap",
- icon: Icons.navigate_next,
- ),
- ),
- sectionOptionDivider,
- GestureDetector(
- behavior: HitTestBehavior.translucent,
- onTap: () async {
- await sendLogs(context, "Report bug", bugsEmail);
- },
- onDoubleTap: () async {
- final zipFilePath = await getZippedLogsFile(context);
- await shareLogs(context, bugsEmail, zipFilePath);
- },
- child: const SettingsTextItem(
- text: "Report bug 🐞",
- icon: Icons.navigate_next,
- ),
- ),
- ],
- );
- }
- }
|