Implement album feature on mobile (#420)

* Refactor sharing to album

* Added library page in the bottom navigation bar

* Refactor SharedAlbumService to album service

* Refactor apiProvider to its file

* Added image grid

* render album thumbnail

* Using the wrap to render thumbnail and album info better

* Navigate to album viewer

* After deletion, navigate to the respective page of the shared and non-shared album

* Correctly remove album in local state

* Refactor create album page

* Implemented create non-shared album
This commit is contained in:
Alex
2022-08-03 00:04:34 -05:00
committed by GitHub
parent 0e85b0fd8f
commit e8d1f89a47
42 changed files with 521 additions and 154 deletions

View File

@@ -0,0 +1,4 @@
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/shared/services/api.service.dart';
final apiServiceProvider = Provider((ref) => ApiService());

View File

@@ -1,8 +1,5 @@
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:openapi/api.dart';
final apiServiceProvider = Provider((ref) => ApiService());
class ApiService {
late ApiClient _apiClient;
@@ -15,7 +12,6 @@ class ApiService {
setEndpoint(String endpoint) {
_apiClient = ApiClient(basePath: endpoint);
userApi = UserApi(_apiClient);
authenticationApi = AuthenticationApi(_apiClient);
albumApi = AlbumApi(_apiClient);

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/shared/providers/api.provider.dart';
import 'package:immich_mobile/shared/services/api.service.dart';
import 'package:openapi/api.dart';
@@ -11,6 +12,7 @@ final serverInfoServiceProvider = Provider(
class ServerInfoService {
final ApiService _apiService;
ServerInfoService(this._apiService);
Future<ServerInfoResponseDto?> getServerInfo() async {

View File

@@ -3,6 +3,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:http/http.dart';
import 'package:http_parser/http_parser.dart';
import 'package:image_picker/image_picker.dart';
import 'package:immich_mobile/shared/providers/api.provider.dart';
import 'package:immich_mobile/shared/services/api.service.dart';
import 'package:immich_mobile/utils/files_helper.dart';
import 'package:openapi/api.dart';

View File

@@ -2,6 +2,7 @@ import 'package:auto_route/auto_route.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/constants/immich_colors.dart';
import 'package:immich_mobile/modules/home/providers/home_page_state.provider.dart';
import 'package:immich_mobile/routing/router.dart';
@@ -18,6 +19,7 @@ class TabControllerPage extends ConsumerWidget {
const HomeRoute(),
SearchRoute(),
const SharingRoute(),
const LibraryRoute()
],
builder: (context, child, animation) {
final tabsRouter = AutoTabsRouter.of(context);
@@ -34,12 +36,14 @@ class TabControllerPage extends ConsumerWidget {
bottomNavigationBar: isMultiSelectEnable
? null
: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
backgroundColor: immichBackgroundColor,
selectedLabelStyle: const TextStyle(
fontSize: 15,
fontSize: 13,
fontWeight: FontWeight.w600,
),
unselectedLabelStyle: const TextStyle(
fontSize: 15,
fontSize: 13,
fontWeight: FontWeight.w600,
),
currentIndex: tabsRouter.activeIndex,
@@ -59,6 +63,12 @@ class TabControllerPage extends ConsumerWidget {
label: 'tab_controller_nav_sharing'.tr(),
icon: const Icon(Icons.group_outlined),
),
BottomNavigationBarItem(
label: 'tab_controller_nav_library'.tr(),
icon: const Icon(
Icons.photo_album_outlined,
),
)
],
),
),