refactoring
security update
This commit is contained in:
parent
1747ab0245
commit
78fe9e7b09
39 changed files with 289 additions and 132 deletions
|
@ -1,13 +1,14 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mc_gallery/features/core/data/constants/const_media.dart';
|
||||
|
||||
import '/features/core/data/constants/const_colors.dart';
|
||||
import '/features/core/data/constants/const_durations.dart';
|
||||
import '/features/core/data/constants/const_media.dart';
|
||||
import '/features/core/widgets/gap.dart';
|
||||
import '/features/core/widgets/mcg_scaffold.dart';
|
||||
import '/features/core/widgets/state/multi_value_listenable_builder.dart';
|
||||
import '/features/core/widgets/state/view_model_builder.dart';
|
||||
import '/features/home/widgets/custom_wrap.dart';
|
||||
import '../../data/enums/search_option.dart';
|
||||
import '../../data/models/image_model.dart';
|
||||
import 'gallery_view_model.dart';
|
||||
|
@ -81,21 +82,38 @@ class GalleryView extends StatelessWidget {
|
|||
valueListenable: model.isSearchingListenable,
|
||||
builder: (context, final isSearching, _) => AnimatedSwitcher(
|
||||
duration: ConstDurations.oneAndHalfDefaultAnimationDuration,
|
||||
child: Column(
|
||||
children: [
|
||||
ValueListenableBuilder<bool>(
|
||||
valueListenable: model.isViewingFavouriteListenable,
|
||||
builder: (context, final isViewingFavourites, child) =>
|
||||
Switch(
|
||||
value: isViewingFavourites,
|
||||
onChanged: model.onFavouriteViewChange,
|
||||
),
|
||||
),
|
||||
!isSearching
|
||||
? _DownloadedGalleryView(galleryViewModel: model)
|
||||
: _SearchGalleryView(galleryViewModel: model),
|
||||
],
|
||||
),
|
||||
child: !isSearching
|
||||
? Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
ValueListenableBuilder<bool>(
|
||||
valueListenable: model.isViewingFavouriteListenable,
|
||||
builder:
|
||||
(context, final isViewingFavourites, child) =>
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ConstMedia.buildIcon(
|
||||
ConstMedia.favStarOutline,
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
Switch(
|
||||
value: isViewingFavourites,
|
||||
onChanged: model.onFavouriteViewChange,
|
||||
),
|
||||
ConstMedia.buildIcon(
|
||||
ConstMedia.favStarFilled,
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
_DownloadedGalleryView(galleryViewModel: model),
|
||||
],
|
||||
)
|
||||
: _SearchGalleryView(galleryViewModel: model),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue