spotube/lib/pages/desktop_login/desktop_login.dart
Kingkor Roy Tirtho 92a418c8a8 feat: artist card redesign
chore: add license as asset for about
2023-03-12 10:06:37 +06:00

76 lines
2.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:spotube/collections/assets.gen.dart';
import 'package:spotube/components/desktop_login/login_form.dart';
import 'package:spotube/components/shared/page_window_title_bar.dart';
import 'package:spotube/hooks/use_breakpoints.dart';
class DesktopLoginPage extends HookConsumerWidget {
const DesktopLoginPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context, ref) {
final breakpoint = useBreakpoints();
final theme = Theme.of(context);
final color = theme.colorScheme.surfaceVariant.withOpacity(.3);
return SafeArea(
child: Scaffold(
appBar: const PageWindowTitleBar(
leading: BackButton(),
),
body: SingleChildScrollView(
child: Center(
child: Container(
margin: const EdgeInsets.all(10),
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(10),
),
child: Column(
children: [
Assets.spotubeLogoPng.image(
width: MediaQuery.of(context).size.width *
(breakpoint <= Breakpoints.md ? .5 : .3),
),
Text(
"Add your spotify credentials to get started",
style: theme.textTheme.titleMedium,
),
Text(
"Don't worry, any of your credentials won't be collected or shared with anyone",
style: theme.textTheme.labelMedium,
),
const SizedBox(height: 10),
TokenLoginForm(
onDone: () => GoRouter.of(context).go("/"),
),
const SizedBox(height: 10),
Wrap(
alignment: WrapAlignment.center,
crossAxisAlignment: WrapCrossAlignment.center,
children: [
const Text("Don't know how to do this?"),
TextButton(
child: const Text(
"Follow along the Step by Step guide",
),
onPressed: () => GoRouter.of(context).push(
"/login-tutorial",
),
),
],
),
],
),
),
),
),
),
);
}
}