mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 12:14:11 +00:00 
			
		
		
		
	Update application dependencies
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
			
		||||
import 'package:comunic/helpers/server_config_helper.dart';
 | 
			
		||||
import 'package:comunic/utils/intl_utils.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher_string.dart';
 | 
			
		||||
 | 
			
		||||
/// Deprecation dialog
 | 
			
		||||
///
 | 
			
		||||
@@ -22,12 +22,12 @@ class _DeprecationDialog extends StatelessWidget {
 | 
			
		||||
      actions: [
 | 
			
		||||
        MaterialButton(
 | 
			
		||||
          onPressed: () =>
 | 
			
		||||
              launch(ServerConfigurationHelper.config!.playStoreURL),
 | 
			
		||||
              launchUrlString(ServerConfigurationHelper.config!.playStoreURL),
 | 
			
		||||
          child: Text(tr("Go to the Play Store")!),
 | 
			
		||||
        ),
 | 
			
		||||
        MaterialButton(
 | 
			
		||||
          onPressed: () =>
 | 
			
		||||
              launch(ServerConfigurationHelper.config!.androidDirectDownloadURL),
 | 
			
		||||
          onPressed: () => launchUrlString(
 | 
			
		||||
              ServerConfigurationHelper.config!.androidDirectDownloadURL),
 | 
			
		||||
          child: Text(tr("Download update outside Play Store")!),
 | 
			
		||||
        ),
 | 
			
		||||
        MaterialButton(
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart';
 | 
			
		||||
import 'package:comunic/utils/intl_utils.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:photo_view/photo_view.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher_string.dart';
 | 
			
		||||
 | 
			
		||||
/// Full screen image details
 | 
			
		||||
///
 | 
			
		||||
@@ -26,7 +26,7 @@ class _FullScreenImageRouteState extends State<FullScreenImageRoute> {
 | 
			
		||||
        title: Text(tr("Image")!),
 | 
			
		||||
        actions: [
 | 
			
		||||
          IconButton(
 | 
			
		||||
              icon: Icon(Icons.launch), onPressed: () => launch(widget.url))
 | 
			
		||||
              icon: Icon(Icons.launch), onPressed: () => launchUrlString(widget.url))
 | 
			
		||||
        ],
 | 
			
		||||
      ),
 | 
			
		||||
      body: PhotoView(
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,6 @@ import '../../utils/files_utils.dart';
 | 
			
		||||
/// Return original image in case of error / if the user did not crop the image
 | 
			
		||||
Future<BytesFile> showImageCropper(BuildContext context, BytesFile source,
 | 
			
		||||
    {CropAspectRatio? aspectRatio}) async {
 | 
			
		||||
 | 
			
		||||
  File? file;
 | 
			
		||||
  File? cropped;
 | 
			
		||||
 | 
			
		||||
@@ -27,15 +26,18 @@ Future<BytesFile> showImageCropper(BuildContext context, BytesFile source,
 | 
			
		||||
    file = await generateTemporaryFile();
 | 
			
		||||
    await file.writeAsBytes(source.bytes!);
 | 
			
		||||
 | 
			
		||||
    File? cropped = await ImageCropper().cropImage(
 | 
			
		||||
    var cropped = await ImageCropper().cropImage(
 | 
			
		||||
      sourcePath: file.absolute.path,
 | 
			
		||||
      compressFormat: ImageCompressFormat.png,
 | 
			
		||||
      aspectRatio: aspectRatio,
 | 
			
		||||
      androidUiSettings: AndroidUiSettings(
 | 
			
		||||
        toolbarColor: Colors.black,
 | 
			
		||||
        toolbarTitle: tr("Crop Photo"),
 | 
			
		||||
        toolbarWidgetColor: Colors.white,
 | 
			
		||||
      ),
 | 
			
		||||
      uiSettings: [
 | 
			
		||||
        AndroidUiSettings(
 | 
			
		||||
          toolbarColor: Colors.black,
 | 
			
		||||
          toolbarTitle: tr("Crop Photo"),
 | 
			
		||||
          toolbarWidgetColor: Colors.white,
 | 
			
		||||
        ),
 | 
			
		||||
        IOSUiSettings(title: tr("Crop Photo"))
 | 
			
		||||
      ],
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    if (cropped == null) return source;
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ import 'package:comunic/utils/intl_utils.dart';
 | 
			
		||||
import 'package:comunic/utils/ui_utils.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:flutter_settings_ui/flutter_settings_ui.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher_string.dart';
 | 
			
		||||
 | 
			
		||||
/// About application settings
 | 
			
		||||
///
 | 
			
		||||
@@ -24,11 +24,11 @@ class AboutApplicationSettings extends StatelessWidget {
 | 
			
		||||
        tiles: [
 | 
			
		||||
          SettingsTile(
 | 
			
		||||
            title: tr("Privacy policy"),
 | 
			
		||||
            onPressed: (c) => launch(srvConfig!.privacyPolicyURL),
 | 
			
		||||
            onPressed: (c) => launchUrlString(srvConfig!.privacyPolicyURL),
 | 
			
		||||
          ),
 | 
			
		||||
          SettingsTile(
 | 
			
		||||
            title: tr("Terms of Use"),
 | 
			
		||||
            onPressed: (c) => launch(srvConfig!.termsURL),
 | 
			
		||||
            onPressed: (c) => launchUrlString(srvConfig!.termsURL),
 | 
			
		||||
          ),
 | 
			
		||||
          SettingsTile(
 | 
			
		||||
            title: tr("Contact us"),
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@ import 'package:comunic/models/group.dart';
 | 
			
		||||
import 'package:comunic/utils/date_utils.dart';
 | 
			
		||||
import 'package:comunic/utils/intl_utils.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher_string.dart';
 | 
			
		||||
 | 
			
		||||
/// About group section
 | 
			
		||||
///
 | 
			
		||||
@@ -29,7 +29,7 @@ class AboutGroupSection extends StatelessWidget {
 | 
			
		||||
                  leading: Icon(Icons.link),
 | 
			
		||||
                  title: Text(tr("URL")!),
 | 
			
		||||
                  subtitle: Text(group.url),
 | 
			
		||||
                  onTap: () => launch(group.url),
 | 
			
		||||
                  onTap: () => launchUrlString(group.url),
 | 
			
		||||
                )
 | 
			
		||||
              : Container(),
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ import 'package:comunic/utils/intl_utils.dart';
 | 
			
		||||
///
 | 
			
		||||
/// @author Pierre Hubert
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher_string.dart';
 | 
			
		||||
 | 
			
		||||
class AboutUserSection extends StatefulWidget {
 | 
			
		||||
  final AdvancedUserInfo user;
 | 
			
		||||
@@ -63,7 +63,7 @@ class _AboutUserSectionState extends State<AboutUserSection> {
 | 
			
		||||
                  leading: Icon(Icons.link),
 | 
			
		||||
                  title: Text(tr("Personal Website")!),
 | 
			
		||||
                  subtitle: Text(widget.user.personalWebsite),
 | 
			
		||||
                  onTap: () => launch(widget.user.personalWebsite),
 | 
			
		||||
                  onTap: () => launchUrlString(widget.user.personalWebsite),
 | 
			
		||||
                )
 | 
			
		||||
              : Container(),
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,7 @@ import 'package:comunic/utils/intl_utils.dart';
 | 
			
		||||
import 'package:comunic/utils/navigation_utils.dart';
 | 
			
		||||
import 'package:comunic/utils/ui_utils.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher_string.dart';
 | 
			
		||||
 | 
			
		||||
import '../../models/api_request.dart';
 | 
			
		||||
import '../../utils/log_utils.dart';
 | 
			
		||||
@@ -281,8 +281,8 @@ class _PostTileState extends State<PostTile> {
 | 
			
		||||
          Text(tr("YouTube movie")!)
 | 
			
		||||
        ],
 | 
			
		||||
      ),
 | 
			
		||||
      onPressed: () =>
 | 
			
		||||
          launch("https://youtube.com/watch/?v=" + widget.post.filePath!),
 | 
			
		||||
      onPressed: () => launchUrlString(
 | 
			
		||||
          "https://youtube.com/watch/?v=" + widget.post.filePath!),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -291,7 +291,7 @@ class _PostTileState extends State<PostTile> {
 | 
			
		||||
      color:
 | 
			
		||||
          darkTheme() ? darkerAccentColor : Color.fromRGBO(0xf7, 0xf7, 0xf7, 1),
 | 
			
		||||
      child: InkWell(
 | 
			
		||||
        onTap: () => launch(widget.post.linkURL!),
 | 
			
		||||
        onTap: () => launchUrlString(widget.post.linkURL!),
 | 
			
		||||
        child: Row(
 | 
			
		||||
          children: <Widget>[
 | 
			
		||||
            Padding(
 | 
			
		||||
@@ -330,7 +330,7 @@ class _PostTileState extends State<PostTile> {
 | 
			
		||||
  Widget _buildPostPDF() {
 | 
			
		||||
    return ElevatedButton.icon(
 | 
			
		||||
      onPressed: () {
 | 
			
		||||
        launch(widget.post.fileURL!);
 | 
			
		||||
        launchUrlString(widget.post.fileURL!);
 | 
			
		||||
      },
 | 
			
		||||
      icon: Icon(Icons.picture_as_pdf),
 | 
			
		||||
      label: Text(tr("PDF")!),
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ import 'package:comunic/models/server_config.dart';
 | 
			
		||||
import 'package:comunic/utils/date_utils.dart';
 | 
			
		||||
import 'package:comunic/utils/intl_utils.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher_string.dart';
 | 
			
		||||
 | 
			
		||||
bool _bannerDismissed = false;
 | 
			
		||||
 | 
			
		||||
@@ -26,7 +26,7 @@ class _BannerWidgetState extends State<BannerWidget> {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void _openLink() {
 | 
			
		||||
    launch(srvConfig!.banner!.link!);
 | 
			
		||||
    launchUrlString(srvConfig!.banner!.link!);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ import 'package:comunic/ui/routes/video_player_route.dart';
 | 
			
		||||
import 'package:comunic/ui/widgets/network_image_widget.dart';
 | 
			
		||||
import 'package:filesize/filesize.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher_string.dart';
 | 
			
		||||
 | 
			
		||||
const _AreaWidth = 150.0;
 | 
			
		||||
const _AreaHeight = 100.0;
 | 
			
		||||
@@ -124,7 +124,7 @@ class _ConversationFileWidgetState extends State<ConversationFileWidget> {
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
      default:
 | 
			
		||||
        launch(file.url!);
 | 
			
		||||
        launchUrlString(file.url!);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@ import 'package:comunic/utils/intl_utils.dart';
 | 
			
		||||
import 'package:comunic/utils/ui_utils.dart';
 | 
			
		||||
import 'package:flutter/cupertino.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher_string.dart';
 | 
			
		||||
 | 
			
		||||
import 'new_password_input_widget.dart';
 | 
			
		||||
 | 
			
		||||
@@ -229,7 +229,8 @@ class _CreateAccountWidgetState extends State<CreateAccountWidget> {
 | 
			
		||||
    widget.onCreated();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void _openTOS() => launch(ServerConfigurationHelper.config!.termsURL);
 | 
			
		||||
  void _openTOS() =>
 | 
			
		||||
      launchUrlString(ServerConfigurationHelper.config!.termsURL);
 | 
			
		||||
 | 
			
		||||
  void _showCreateAccountError() async {
 | 
			
		||||
    await showCupertinoDialog(
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
import 'package:comunic/utils/input_utils.dart';
 | 
			
		||||
import 'package:flutter/gestures.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher_string.dart';
 | 
			
		||||
 | 
			
		||||
/// Text rich content widget
 | 
			
		||||
///
 | 
			
		||||
@@ -41,7 +41,7 @@ class TextRichContentWidget extends StatelessWidget {
 | 
			
		||||
              text: s,
 | 
			
		||||
              recognizer: TapGestureRecognizer()
 | 
			
		||||
                ..onTap = () {
 | 
			
		||||
                  launch(s);
 | 
			
		||||
                  launchUrlString(s);
 | 
			
		||||
                }));
 | 
			
		||||
 | 
			
		||||
          currString = "";
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@ import 'package:comunic/models/displayed_content.dart';
 | 
			
		||||
import 'package:comunic/utils/input_utils.dart';
 | 
			
		||||
import 'package:comunic/utils/navigation_utils.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher.dart';
 | 
			
		||||
import 'package:url_launcher/url_launcher_string.dart';
 | 
			
		||||
 | 
			
		||||
/// Text widget
 | 
			
		||||
///
 | 
			
		||||
@@ -24,13 +24,14 @@ class TextWidget extends StatelessWidget {
 | 
			
		||||
    this.textAlign = TextAlign.start,
 | 
			
		||||
    this.style,
 | 
			
		||||
    this.linksColor = Colors.blueAccent,
 | 
			
		||||
  })  : super(key: key);
 | 
			
		||||
  }) : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    if (this.content.isNull || this.content.isEmpty) return Text("");
 | 
			
		||||
 | 
			
		||||
    var usedStyle = style == null ? Theme.of(context).textTheme.bodyText2 : style;
 | 
			
		||||
    var usedStyle =
 | 
			
		||||
        style == null ? Theme.of(context).textTheme.bodyText2 : style;
 | 
			
		||||
 | 
			
		||||
    var content = this.content.parsedString!;
 | 
			
		||||
 | 
			
		||||
@@ -78,7 +79,7 @@ class TextWidget extends StatelessWidget {
 | 
			
		||||
                word,
 | 
			
		||||
                style: style!.copyWith(color: linksColor),
 | 
			
		||||
              ),
 | 
			
		||||
              onTap: () => launch(word),
 | 
			
		||||
              onTap: () => launchUrlString(word),
 | 
			
		||||
            ),
 | 
			
		||||
          ),
 | 
			
		||||
        );
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user