Skip to content

Commit

Permalink
Remove extended_text plugin and all its uses
Browse files Browse the repository at this point in the history
We noe use the regular ellipsis at the end
  • Loading branch information
J-Pabon authored and inetic committed Oct 21, 2024
1 parent 2897a49 commit e6a0795
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 84 deletions.
2 changes: 1 addition & 1 deletion lib/app/mixins/repo_actions_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ mixin RepositoryActionsMixin on LoggyType {
context: context,
title: S.current.actionLocateRepo,
body: [
Fields.ellipsedText(
Text(
dbFile,
style: context.theme.appTextStyle.bodyMedium
.copyWith(fontWeight: FontWeight.w400),
Expand Down
28 changes: 2 additions & 26 deletions lib/app/utils/fields.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'dart:async';

import 'package:auto_size_text/auto_size_text.dart';
import 'package:badges/badges.dart' as b;
import 'package:extended_text/extended_text.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:ouisync/ouisync.dart';
Expand Down Expand Up @@ -290,13 +289,12 @@ class Fields {
),
Expanded(flex: 0, child: space),
Expanded(
child: ellipsedText(
child: Text(
text,
textAlign: textAlign,
textOverflow: textOverflow,
overflow: textOverflow,
softWrap: textSoftWrap,
style: style,
ellipsisPosition: TextOverflowPosition.middle,
),
)
],
Expand Down Expand Up @@ -324,28 +322,6 @@ class Fields {
maxFontSize: maxFontSize ?? double.infinity,
);

static Widget ellipsedText(String text,
{Key? key,
TextAlign textAlign = TextAlign.start,
TextOverflow textOverflow = TextOverflow.ellipsis,
TextOverflowPosition ellipsisPosition = TextOverflowPosition.middle,
bool softWrap = true,
TextStyle? style,
int maxLines = 1}) =>
ExtendedText(
text,
key: key,
textAlign: textAlign,
softWrap: softWrap,
overflow: textOverflow,
maxLines: maxLines,
style: style,
overflowWidget: TextOverflowWidget(
position: ellipsisPosition,
child: Text('...'),
),
);

static Widget constrainedText(String text,
{Key? key,
int flex = 1,
Expand Down
12 changes: 6 additions & 6 deletions lib/app/widgets/bars/folder_navigation_bar.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:extended_text/extended_text.dart';
import 'package:flutter/material.dart';

import '../../cubits/cubits.dart';
import '../../utils/fields.dart';
import '../../utils/repo_path.dart' as repo_path;
import '../../utils/strings.dart';

Expand All @@ -16,7 +14,7 @@ class FolderNavigationBar extends StatelessWidget {
final path = _repo.state.currentFolder.path;

return Container(
padding: const EdgeInsetsDirectional.only(start: 12.0),
padding: const EdgeInsets.only(left: 12.0),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Expand All @@ -42,10 +40,12 @@ class FolderNavigationBar extends StatelessWidget {
SizedBox(width: path == separator ? 5.0 : 0.0),
Expanded(
child: Padding(
padding: EdgeInsetsDirectional.only(start: 12.0, end: 12.0),
child: Fields.ellipsedText(
padding: EdgeInsets.only(left: 12.0, right: 12.0),
child: Text(
current,
ellipsisPosition: TextOverflowPosition.middle,
maxLines: 1,
softWrap: true,
overflow: TextOverflow.ellipsis,
),
),
),
Expand Down
11 changes: 6 additions & 5 deletions lib/app/widgets/bars/repositories_bar.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'package:extended_text/extended_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:ouisync/ouisync.dart';
import 'package:ouisync_app/app/widgets/notification_badge.dart';
import 'package:ouisync_app/app/widgets/throughput_display.dart';
import '../notification_badge.dart';
import '../throughput_display.dart';
import 'package:stream_transform/stream_transform.dart';

import '../../../generated/l10n.dart';
Expand Down Expand Up @@ -50,9 +49,11 @@ class RepositoriesBar extends StatelessWidget
Widget _buildName(RepoEntry? repo) => Expanded(
child: Container(
padding: Dimensions.paddingItem,
child: Fields.ellipsedText(
child: Text(
repo?.name ?? S.current.messageNoRepos,
ellipsisPosition: TextOverflowPosition.middle,
maxLines: 1,
softWrap: true,
overflow: TextOverflow.ellipsis,
),
),
);
Expand Down
7 changes: 4 additions & 3 deletions lib/app/widgets/dialogs/move_entry_bottom_sheet.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:io';

import 'package:extended_text/extended_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Expand Down Expand Up @@ -90,10 +89,12 @@ class _MoveEntryDialogState extends State<MoveEntryDialog> {
icon: Icons.drive_file_move_outlined,
text: name,
),
Fields.ellipsedText(
Text(
S.current.messageMoveEntryOrigin(parent),
ellipsisPosition: TextOverflowPosition.middle,
style: bodyStyle,
maxLines: 1,
softWrap: true,
overflow: TextOverflow.ellipsis,
),
_selectActions(context, cubit.showList),
],
Expand Down
17 changes: 10 additions & 7 deletions lib/app/widgets/dialogs/save_shared_media.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:extended_text/extended_text.dart';
import 'package:flutter/material.dart';
import 'package:path/path.dart' as p;

Expand Down Expand Up @@ -201,10 +200,12 @@ class _MediaDescription extends StatelessWidget {
),
Expanded(
child: Container(
padding: EdgeInsetsDirectional.symmetric(horizontal: 8.0),
child: Fields.ellipsedText(
padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Text(
name,
ellipsisPosition: TextOverflowPosition.middle,
maxLines: 1,
softWrap: true,
overflow: TextOverflow.ellipsis,
),
),
),
Expand All @@ -214,10 +215,12 @@ class _MediaDescription extends StatelessWidget {
children: [
Expanded(
child: Container(
padding: EdgeInsetsDirectional.symmetric(horizontal: 8.0),
child: Fields.ellipsedText(
padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Text(
parent,
ellipsisPosition: TextOverflowPosition.middle,
maxLines: 1,
softWrap: true,
overflow: TextOverflow.ellipsis,
),
),
),
Expand Down
21 changes: 11 additions & 10 deletions lib/app/widgets/items/entry_info_table.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:extended_text/extended_text.dart';
import 'package:flutter/material.dart';

import '../../../generated/l10n.dart';
Expand Down Expand Up @@ -56,15 +55,17 @@ class EntryInfoTable extends StatelessWidget {
),
child: Text(label)),
Container(
padding: EdgeInsetsDirectional.only(
top: verticalPadding,
bottom: verticalPadding,
),
child: Fields.ellipsedText(
info,
maxLines: 4,
ellipsisPosition: TextOverflowPosition.middle,
)),
padding: EdgeInsets.only(
top: verticalPadding,
bottom: verticalPadding,
),
child: Text(
info,
maxLines: 4,
softWrap: true,
overflow: TextOverflow.ellipsis,
),
),
],
);
}
7 changes: 4 additions & 3 deletions lib/app/widgets/items/file_description.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:extended_text/extended_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Expand All @@ -22,9 +21,11 @@ class FileDescription extends StatelessWidget with AppLogger {
Widget build(BuildContext context) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Fields.ellipsedText(
Text(
entry.name,
ellipsisPosition: TextOverflowPosition.middle,
maxLines: 1,
softWrap: true,
overflow: TextOverflow.ellipsis,
),
Dimensions.spacingVerticalHalf,
_buildDetails(context),
Expand Down
7 changes: 4 additions & 3 deletions lib/app/widgets/items/list_item.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:extended_text/extended_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Expand Down Expand Up @@ -75,9 +74,11 @@ class DirectoryListItem extends StatelessWidget {
Expanded(
child: Container(
padding: Dimensions.paddingItem,
child: Fields.ellipsedText(
child: Text(
entry.name,
ellipsisPosition: TextOverflowPosition.middle,
maxLines: 1,
softWrap: true,
overflow: TextOverflow.ellipsis,
),
),
),
Expand Down
7 changes: 4 additions & 3 deletions lib/app/widgets/items/repo_description.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:extended_text/extended_text.dart';
import 'package:flutter/material.dart';

import '../../cubits/repo.dart';
Expand Down Expand Up @@ -29,10 +28,12 @@ class RepoDescription extends StatelessWidget with AppLogger {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Fields.ellipsedText(
Text(
state.location.name,
style: nameTextStyle,
ellipsisPosition: TextOverflowPosition.middle,
maxLines: 1,
softWrap: true,
overflow: TextOverflow.ellipsis,
),
Fields.autosizeText(
state.accessMode.name,
Expand Down
16 changes: 0 additions & 16 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -382,22 +382,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.5"
extended_text:
dependency: "direct main"
description:
name: extended_text
sha256: a09e3db6b405457a5cd43d19e892dcb7ec9ae1f0b40d5e95d06fedc2d1c13bf7
url: "https://pub.dev"
source: hosted
version: "14.0.1"
extended_text_library:
dependency: transitive
description:
name: extended_text_library
sha256: "55d09098ec56fab0d9a8a68950ca0bbf2efa1327937f7cec6af6dfa066234829"
url: "https://pub.dev"
source: hosted
version: "12.0.0"
fake_async:
dependency: transitive
description:
Expand Down
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ dependencies:
device_info_plus: ^10.1.1
dns_client: ^0.2.1
equatable: ^2.0.3
extended_text: ^14.0.1
ffi: ^2.0.1
file: ^7.0.0
file_picker: ^8.1.2
Expand Down

0 comments on commit e6a0795

Please sign in to comment.