mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Start Flutter update
This commit is contained in:
		@@ -94,7 +94,7 @@ Future<BytesFile> showPickFileDialog({
 | 
			
		||||
  assert(allowedMimeTypes != null);
 | 
			
		||||
 | 
			
		||||
  // Get the list of allowed extension
 | 
			
		||||
  final allowedExtensions = List<String>();
 | 
			
		||||
  final allowedExtensions = <String>[];
 | 
			
		||||
  for (var mime in allowedExtensions) {
 | 
			
		||||
    final ext = extensionFromMime(mime);
 | 
			
		||||
    if (ext != mime) allowedExtensions.add(ext);
 | 
			
		||||
 
 | 
			
		||||
@@ -79,7 +79,7 @@ class _ConversationRouteState extends SafeState<ConversationRoute> {
 | 
			
		||||
      return buildErrorCard(
 | 
			
		||||
        tr("Could not get conversation information!"),
 | 
			
		||||
        actions: <Widget>[
 | 
			
		||||
          FlatButton(
 | 
			
		||||
          TextButton(
 | 
			
		||||
            onPressed: _loadConversation,
 | 
			
		||||
            child: Text(
 | 
			
		||||
              tr("Try again").toUpperCase(),
 | 
			
		||||
 
 | 
			
		||||
@@ -146,14 +146,14 @@ class _ResetPasswordBodyState extends SafeState<_ResetPasswordBody> {
 | 
			
		||||
        children: <Widget>[
 | 
			
		||||
          Text(tr("Here are your options to reset your account:")),
 | 
			
		||||
          _Spacer(),
 | 
			
		||||
          OutlineButton.icon(
 | 
			
		||||
          OutlinedButton.icon(
 | 
			
		||||
            onPressed: _openSendEmailDialog,
 | 
			
		||||
            icon: Icon(Icons.email),
 | 
			
		||||
            label: Text(tr("Send us an email to ask for help")),
 | 
			
		||||
          ),
 | 
			
		||||
          _Spacer(visible: _hasSecurityQuestions),
 | 
			
		||||
          _hasSecurityQuestions
 | 
			
		||||
              ? OutlineButton.icon(
 | 
			
		||||
              ? OutlinedButton.icon(
 | 
			
		||||
                  onPressed: _loadSecurityQuestions,
 | 
			
		||||
                  icon: Icon(Icons.help_outline),
 | 
			
		||||
                  label: Text(tr("Answer your security questions")),
 | 
			
		||||
@@ -199,7 +199,7 @@ class _ResetPasswordBodyState extends SafeState<_ResetPasswordBody> {
 | 
			
		||||
        ..add(_Spacer())
 | 
			
		||||
        ..addAll(List.generate(_questions.length, _buildSecurityQuestionField))
 | 
			
		||||
        ..add(_Spacer())
 | 
			
		||||
        ..add(OutlineButton(
 | 
			
		||||
        ..add(OutlinedButton(
 | 
			
		||||
          onPressed: _canSubmitAnswers ? _submitSecurityAnswers : null,
 | 
			
		||||
          child: Text(tr("Submit")),
 | 
			
		||||
        )),
 | 
			
		||||
 
 | 
			
		||||
@@ -201,7 +201,6 @@ class _UpdateConversationScreen extends State<UpdateConversationScreen> {
 | 
			
		||||
        subtitle: _admins.contains(user.id) ? tr("Admin") : tr("Member"),
 | 
			
		||||
        trailing: _canAddMembers
 | 
			
		||||
            ? PopupMenuButton<_MembersMenuChoices>(
 | 
			
		||||
                captureInheritedThemes: false,
 | 
			
		||||
                onSelected: (choice) => _membersMenuItemSelected(user, choice),
 | 
			
		||||
                itemBuilder: (c) => <PopupMenuEntry<_MembersMenuChoices>>[
 | 
			
		||||
                  PopupMenuItem(
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,3 @@
 | 
			
		||||
 | 
			
		||||
import 'package:comunic/enums/post_kind.dart';
 | 
			
		||||
import 'package:comunic/enums/post_target.dart';
 | 
			
		||||
import 'package:comunic/enums/post_visibility_level.dart';
 | 
			
		||||
@@ -12,7 +11,7 @@ import 'package:comunic/utils/files_utils.dart';
 | 
			
		||||
import 'package:comunic/utils/intl_utils.dart';
 | 
			
		||||
import 'package:comunic/utils/post_utils.dart';
 | 
			
		||||
import 'package:comunic/utils/ui_utils.dart';
 | 
			
		||||
import 'package:file_picker_cross/file_picker_cross.dart';
 | 
			
		||||
import 'package:file_picker/file_picker.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:image_picker/image_picker.dart';
 | 
			
		||||
 | 
			
		||||
@@ -278,15 +277,18 @@ class _PostCreateFormWidgetState extends State<PostCreateFormWidget> {
 | 
			
		||||
  /// Pick a PDF for the new post
 | 
			
		||||
  Future<void> _pickPDFForPost() async {
 | 
			
		||||
    try {
 | 
			
		||||
      final picker = await FilePickerCross.importFromStorage(
 | 
			
		||||
        type: FileTypeCross.custom,
 | 
			
		||||
        fileExtension: "pdf",
 | 
			
		||||
      final file = await FilePicker.platform.pickFiles(
 | 
			
		||||
        type: FileType.custom,
 | 
			
		||||
        allowedExtensions: ["pdf"],
 | 
			
		||||
        withData: true,
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
      if (file == null || file.files.isEmpty) return;
 | 
			
		||||
 | 
			
		||||
      _resetPostSelection();
 | 
			
		||||
 | 
			
		||||
      setState(() {
 | 
			
		||||
        this._postPDF = picker.toUint8List();
 | 
			
		||||
        this._postPDF = file.files.first.bytes;
 | 
			
		||||
      });
 | 
			
		||||
    } catch (e, stack) {
 | 
			
		||||
      print("Pick PDF error: $e\n$stack");
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,8 @@ import 'package:flutter/material.dart';
 | 
			
		||||
/// @author Pierre HUBERT
 | 
			
		||||
 | 
			
		||||
abstract class SafeState<T extends StatefulWidget> extends State<T> {
 | 
			
		||||
  final _subscriptions = List<StreamSubscription>();
 | 
			
		||||
  final _timers = List<Timer>();
 | 
			
		||||
  final _subscriptions = <StreamSubscription>[];
 | 
			
		||||
  final _timers = <Timer>[];
 | 
			
		||||
 | 
			
		||||
  bool _unmounted = false;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -123,7 +123,7 @@ class _UserPageTabletState extends State<UserPageTablet> {
 | 
			
		||||
              // Friends list of the user
 | 
			
		||||
              _userInfo.isFriendsListPublic
 | 
			
		||||
                  ? Expanded(
 | 
			
		||||
                      child: OutlineButton.icon(
 | 
			
		||||
                      child: OutlinedButton.icon(
 | 
			
		||||
                        onPressed: () => MainController.of(context)
 | 
			
		||||
                            .openUserFriendsList(_userInfo.id),
 | 
			
		||||
                        icon: Icon(Icons.group),
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@ class TextRichContentWidget extends StatelessWidget {
 | 
			
		||||
  static List<TextSpan> _parse(String text, TextStyle style) {
 | 
			
		||||
    if (style == null) style = TextStyle();
 | 
			
		||||
 | 
			
		||||
    List<TextSpan> list = List();
 | 
			
		||||
    List<TextSpan> list = [];
 | 
			
		||||
    String currString = "";
 | 
			
		||||
 | 
			
		||||
    text.split("\n").forEach((f) {
 | 
			
		||||
 
 | 
			
		||||
@@ -55,7 +55,7 @@ class TextWidget extends StatelessWidget {
 | 
			
		||||
  List<InlineSpan> _parseLinks(
 | 
			
		||||
      BuildContext context, String text, TextStyle style) {
 | 
			
		||||
    var buff = StringBuffer();
 | 
			
		||||
    final list = new List<InlineSpan>();
 | 
			
		||||
    final list = <InlineSpan>[];
 | 
			
		||||
 | 
			
		||||
    // Change word function
 | 
			
		||||
    final changeWordType = () {
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@ class _UserWritingInConvNotifierState
 | 
			
		||||
    extends SafeState<UserWritingInConvNotifier> {
 | 
			
		||||
  final _usersInfo = UsersList();
 | 
			
		||||
 | 
			
		||||
  final _list = List();
 | 
			
		||||
  final _list = [];
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void initState() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user