38 lines
1.2 KiB
Dart
38 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:wallpaper/common/components/base_masonry_gridView.dart';
|
|
import 'package:wallpaper/common/components/title_bar_widget.dart';
|
|
import 'package:wallpaper/modules/favorite/favorite_controller.dart';
|
|
|
|
class FavoriteView extends GetView<FavoriteController> {
|
|
const FavoriteView({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Get.lazyPut(() => FavoriteController());
|
|
return SafeArea(
|
|
child: GetBuilder<FavoriteController>(
|
|
builder: (logic) {
|
|
return Column(
|
|
children: [
|
|
TitleBarWidget(
|
|
title: 'Favorites',
|
|
showMenuBtn: controller.wallpaperList.isNotEmpty,
|
|
deleteOnTap: controller.deleteAll,
|
|
),
|
|
Expanded(
|
|
child: BaseMasonryGridView(
|
|
viewState: controller.viewState,
|
|
wallpaperList: controller.wallpaperList,
|
|
itemOnTap: (index) => controller.itemOnTap(index),
|
|
onLongPress: (index) => controller.onLongPress(index),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|