Skip to content

Commit

Permalink
Update manifest_options.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagocarvalhodev committed Nov 19, 2024
1 parent ed9d975 commit c23a69a
Showing 1 changed file with 53 additions and 59 deletions.
112 changes: 53 additions & 59 deletions lib/core/upload/view/manifest_options/manifest_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,73 +94,68 @@ class __ManifestOptionTileState extends State<_ManifestOptionTile> {
widget.manifestSelection.undername != null);
final hasSelectedAnt = widget.manifestSelection.antRecord != null;

return AnimatedContainer(
duration: const Duration(milliseconds: 300),
decoration: BoxDecoration(
color: colorTokens.containerL2,
borderRadius: BorderRadius.circular(5),
),
curve: Curves.easeInOut,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
height: isExpanded
? 168
: showingName
? 70
: 50,
child: GestureDetector(
onTap: () {},
return SingleChildScrollView(
child: AnimatedContainer(
duration: const Duration(milliseconds: 300),
decoration: BoxDecoration(
color: colorTokens.containerL2,
borderRadius: BorderRadius.circular(5),
),
curve: Curves.easeInOut,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
height: isExpanded
? 168
: showingName
? 70
: 50,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Row(
mainAxisSize: MainAxisSize.max,
children: [
ArDriveCheckBox(
key: ValueKey(widget.isSelected),
checked: widget.isSelected,
onChange: (value) {
if (value) {
context
.read<UploadManifestOptionsBloc>()
.add(SelectManifest(manifest: file));
} else {
context
.read<UploadManifestOptionsBloc>()
.add(DeselectManifest(manifest: file));
}
},
),
const SizedBox(width: 16),
Expanded(
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
Flexible(
flex: 2,
child: Row(
children: [
ArDriveIcons.manifest(
size: 16,
color: file.isHidden ? hiddenColor : null),
const SizedBox(width: 8),
Text(
file.name,
style: typography.paragraphNormal(
color: file.isHidden ? hiddenColor : null,
),
),
if (file.isHidden) ...[
const SizedBox(width: 8),
Text('(hidden)',
style: typography.paragraphNormal(
color: hiddenColor,
))
]
],
),
),
Flexible(
flex: 1,
child: ArDriveCheckBox(
key: ValueKey(widget.isSelected),
checked: widget.isSelected,
onChange: (value) {
if (value) {
context
.read<UploadManifestOptionsBloc>()
.add(SelectManifest(manifest: file));
} else {
context
.read<UploadManifestOptionsBloc>()
.add(DeselectManifest(manifest: file));
}
},
ArDriveIcons.manifest(
size: 16,
color: file.isHidden ? hiddenColor : null),
const SizedBox(width: 8),
Expanded(
child: Text(
file.name,
style: typography.paragraphNormal(
color: file.isHidden ? hiddenColor : null,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
if (file.isHidden) ...[
const SizedBox(width: 8),
Text('(hidden)',
style: typography.paragraphNormal(
color: hiddenColor,
))
]
],
),
),
Expand All @@ -172,16 +167,16 @@ class __ManifestOptionTileState extends State<_ManifestOptionTile> {
text: !state.arnsNamesLoaded
? 'Loading Names...'
: hasSelectedAnt
? 'Change ArNS'
: 'Add ArNS',
? 'Change ArNS Name'
: 'Add ArNS Name',
typography: typography,
isDisabled: isExpanded ||
!widget.isSelected ||
!state.arnsNamesLoaded ||
(state.arnsNamesLoaded && state.ants!.isEmpty),
fontStyle: typography.paragraphSmall(),
variant: ButtonVariant.primary,
maxWidth: state.arnsNamesLoaded ? 100 : 120,
maxWidth: state.arnsNamesLoaded ? 140 : 160,
maxHeight: 30,
onPressed: () {
context
Expand All @@ -190,7 +185,6 @@ class __ManifestOptionTileState extends State<_ManifestOptionTile> {
},
),
)
// TODO: Add back when we have the right UI for it
],
),
if (showingName) ...[
Expand Down

0 comments on commit c23a69a

Please sign in to comment.