veilidchat/lib/pages/index.dart

56 lines
1.9 KiB
Dart
Raw Normal View History

2023-01-09 22:50:34 -05:00
import 'package:flutter/material.dart';
2023-07-28 20:36:05 -04:00
import 'package:flutter_riverpod/flutter_riverpod.dart';
2023-07-22 23:29:10 -04:00
import 'package:flutter_svg/flutter_svg.dart';
2023-07-26 14:20:29 -04:00
import 'package:radix_colors/radix_colors.dart';
2023-07-23 23:13:21 -04:00
2023-07-28 20:36:05 -04:00
import '../providers/window_control.dart';
2023-01-09 22:50:34 -05:00
2023-07-28 20:36:05 -04:00
class IndexPage extends ConsumerWidget {
2023-01-09 22:50:34 -05:00
const IndexPage({super.key});
@override
2023-07-28 20:36:05 -04:00
Widget build(BuildContext context, WidgetRef ref) {
ref.watch(windowControlProvider);
2023-10-09 16:52:37 -04:00
final theme = Theme.of(context);
final textTheme = theme.textTheme;
final monoTextStyle = textTheme.labelSmall!
.copyWith(fontFamily: 'Source Code Pro', fontSize: 11);
final emojiTextStyle = textTheme.labelSmall!
.copyWith(fontFamily: 'Noto Color Emoji', fontSize: 11);
2023-07-22 23:29:10 -04:00
return Scaffold(
body: DecoratedBox(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: <Color>[
RadixColors.dark.plum.step4,
RadixColors.dark.plum.step2,
])),
child: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxHeight: 300),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
2023-10-09 16:52:37 -04:00
// Hack to preload fonts
Offstage(child: Text('🧱', style: emojiTextStyle)),
// Hack to preload fonts
Offstage(child: Text('A', style: monoTextStyle)),
// Splash Screen
2023-07-22 23:29:10 -04:00
Expanded(
flex: 2,
child: SvgPicture.asset(
2023-07-26 14:20:29 -04:00
'assets/images/icon.svg',
2023-07-22 23:29:10 -04:00
)),
Expanded(
child: SvgPicture.asset(
2023-07-28 20:36:05 -04:00
'assets/images/title.svg',
))
2023-07-22 23:29:10 -04:00
]))),
));
2023-01-09 22:50:34 -05:00
}
}