2024-01-05 05:20:55 +00:00
|
|
|
import 'package:auto_route/auto_route.dart';
|
2022-02-03 10:06:44 -06:00
|
|
|
import 'package:flutter/material.dart';
|
2022-11-27 14:34:19 -06:00
|
|
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
2022-02-03 10:06:44 -06:00
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
2023-11-09 16:19:53 +00:00
|
|
|
import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
2024-08-06 19:50:27 +05:30
|
|
|
import 'package:immich_mobile/extensions/theme_extensions.dart';
|
2024-06-10 12:43:54 -05:00
|
|
|
import 'package:immich_mobile/widgets/forms/login/login_form.dart';
|
2022-11-27 14:34:19 -06:00
|
|
|
import 'package:immich_mobile/routing/router.dart';
|
|
|
|
|
import 'package:package_info_plus/package_info_plus.dart';
|
2022-02-03 10:06:44 -06:00
|
|
|
|
2024-01-15 16:50:33 +00:00
|
|
|
@RoutePage()
|
2022-02-03 10:06:44 -06:00
|
|
|
class LoginPage extends HookConsumerWidget {
|
2024-01-27 16:14:32 +00:00
|
|
|
const LoginPage({super.key});
|
2022-02-03 10:06:44 -06:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
2022-11-27 14:34:19 -06:00
|
|
|
final appVersion = useState('0.0.0');
|
|
|
|
|
|
|
|
|
|
getAppInfo() async {
|
|
|
|
|
PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
|
|
|
|
appVersion.value = packageInfo.version;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
useEffect(
|
|
|
|
|
() {
|
|
|
|
|
getAppInfo();
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return Scaffold(
|
2024-08-28 12:30:06 -04:00
|
|
|
body: LoginForm(),
|
2024-03-13 12:14:59 -05:00
|
|
|
bottomNavigationBar: SafeArea(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.only(bottom: 16.0),
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 50,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'v${appVersion.value}',
|
2024-08-06 19:50:27 +05:30
|
|
|
style: TextStyle(
|
|
|
|
|
color: context.colorScheme.onSurfaceSecondary,
|
2022-11-27 14:34:19 -06:00
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: "Inconsolata",
|
|
|
|
|
),
|
|
|
|
|
),
|
2024-03-13 12:14:59 -05:00
|
|
|
const Text(' '),
|
|
|
|
|
GestureDetector(
|
|
|
|
|
child: Text(
|
|
|
|
|
'Logs',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: context.primaryColor,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: "Inconsolata",
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
context.pushRoute(const AppLogRoute());
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
2022-11-27 14:34:19 -06:00
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
2022-02-03 10:06:44 -06:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|