mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Refactor mobile to use OpenApi generated SDK (#336)
This commit is contained in:
parent
d69470e207
commit
ae7e582ec8
276 changed files with 14513 additions and 3003 deletions
|
|
@ -19,10 +19,13 @@ class SplashScreenPage extends HookConsumerWidget {
|
|||
Hive.box<HiveSavedLoginInfo>(hiveLoginInfoBox).get(savedLoginInfoKey);
|
||||
|
||||
void performLoggingIn() async {
|
||||
var isAuthenticated = await ref
|
||||
.read(authenticationProvider.notifier)
|
||||
.login(
|
||||
loginInfo!.email, loginInfo.password, loginInfo.serverUrl, true);
|
||||
var isAuthenticated =
|
||||
await ref.read(authenticationProvider.notifier).login(
|
||||
loginInfo!.email,
|
||||
loginInfo.password,
|
||||
loginInfo.serverUrl,
|
||||
true,
|
||||
);
|
||||
|
||||
if (isAuthenticated) {
|
||||
// Resume backup (if enable) then navigate
|
||||
|
|
@ -33,14 +36,17 @@ class SplashScreenPage extends HookConsumerWidget {
|
|||
}
|
||||
}
|
||||
|
||||
useEffect(() {
|
||||
if (loginInfo?.isSaveLogin == true) {
|
||||
performLoggingIn();
|
||||
} else {
|
||||
AutoRouter.of(context).push(const LoginRoute());
|
||||
}
|
||||
return null;
|
||||
}, []);
|
||||
useEffect(
|
||||
() {
|
||||
if (loginInfo?.isSaveLogin == true) {
|
||||
performLoggingIn();
|
||||
} else {
|
||||
AutoRouter.of(context).push(const LoginRoute());
|
||||
}
|
||||
return null;
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: immichBackgroundColor,
|
||||
|
|
|
|||
|
|
@ -35,23 +35,30 @@ class TabControllerPage extends ConsumerWidget {
|
|||
? null
|
||||
: BottomNavigationBar(
|
||||
selectedLabelStyle: const TextStyle(
|
||||
fontSize: 15, fontWeight: FontWeight.w600),
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
unselectedLabelStyle: const TextStyle(
|
||||
fontSize: 15, fontWeight: FontWeight.w600),
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
currentIndex: tabsRouter.activeIndex,
|
||||
onTap: (index) {
|
||||
tabsRouter.setActiveIndex(index);
|
||||
},
|
||||
items: [
|
||||
BottomNavigationBarItem(
|
||||
label: 'tab_controller_nav_photos'.tr(),
|
||||
icon: const Icon(Icons.photo)),
|
||||
label: 'tab_controller_nav_photos'.tr(),
|
||||
icon: const Icon(Icons.photo),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
label: 'tab_controller_nav_search'.tr(),
|
||||
icon: const Icon(Icons.search)),
|
||||
label: 'tab_controller_nav_search'.tr(),
|
||||
icon: const Icon(Icons.search),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
label: 'tab_controller_nav_sharing'.tr(),
|
||||
icon: const Icon(Icons.group_outlined)),
|
||||
label: 'tab_controller_nav_sharing'.tr(),
|
||||
icon: const Icon(Icons.group_outlined),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -54,13 +54,16 @@ class VersionAnnouncementOverlay extends HookConsumerWidget {
|
|||
child: RichText(
|
||||
text: TextSpan(
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontFamily: 'WorkSans',
|
||||
color: Colors.black87,
|
||||
height: 1.2),
|
||||
fontSize: 14,
|
||||
fontFamily: 'WorkSans',
|
||||
color: Colors.black87,
|
||||
height: 1.2,
|
||||
),
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: 'version_announcement_overlay_text_1'.tr(),
|
||||
text:
|
||||
'version_announcement_overlay_text_1'
|
||||
.tr(),
|
||||
),
|
||||
const TextSpan(
|
||||
text: ' Immich ',
|
||||
|
|
@ -71,11 +74,14 @@ class VersionAnnouncementOverlay extends HookConsumerWidget {
|
|||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: "version_announcement_overlay_text_2".tr(),
|
||||
text:
|
||||
"version_announcement_overlay_text_2"
|
||||
.tr(),
|
||||
),
|
||||
TextSpan(
|
||||
text: "version_announcement_overlay_release_notes"
|
||||
.tr(),
|
||||
text:
|
||||
"version_announcement_overlay_release_notes"
|
||||
.tr(),
|
||||
style: const TextStyle(
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
|
|
@ -83,7 +89,9 @@ class VersionAnnouncementOverlay extends HookConsumerWidget {
|
|||
..onTap = goToReleaseNote,
|
||||
),
|
||||
TextSpan(
|
||||
text: "version_announcement_overlay_text_3".tr(),
|
||||
text:
|
||||
"version_announcement_overlay_text_3"
|
||||
.tr(),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
@ -92,22 +100,25 @@ class VersionAnnouncementOverlay extends HookConsumerWidget {
|
|||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16.0),
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
shape: const StadiumBorder(),
|
||||
visualDensity: VisualDensity.standard,
|
||||
primary: Colors.indigo,
|
||||
onPrimary: Colors.grey[50],
|
||||
elevation: 2,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10, horizontal: 25),
|
||||
style: ElevatedButton.styleFrom(
|
||||
shape: const StadiumBorder(),
|
||||
visualDensity: VisualDensity.standard,
|
||||
primary: Colors.indigo,
|
||||
onPrimary: Colors.grey[50],
|
||||
elevation: 2,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
horizontal: 25,
|
||||
),
|
||||
onPressed: onAcknowledgeTapped,
|
||||
child: const Text(
|
||||
"version_announcement_overlay_ack",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
).tr()),
|
||||
),
|
||||
onPressed: onAcknowledgeTapped,
|
||||
child: const Text(
|
||||
"version_announcement_overlay_ack",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
).tr(),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue