veilidchat/lib/layout/index.dart

68 lines
2.1 KiB
Dart
Raw Normal View History

2023-01-09 22:50:34 -05:00
import 'package:flutter/material.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
2024-02-28 20:32:37 -05:00
import '../tools/tools.dart';
class IndexPage extends StatefulWidget {
2023-01-09 22:50:34 -05:00
const IndexPage({super.key});
2024-02-28 20:32:37 -05:00
@override
State<IndexPage> createState() => _IndexPageState();
}
class _IndexPageState extends State<IndexPage> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) async {
await changeWindowSetup(
TitleBarStyle.hidden, OrientationCapability.normal);
});
}
2023-01-09 22:50:34 -05:00
@override
2023-12-26 20:26:54 -05:00
Widget build(BuildContext context) {
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
}
}