60 lines
1.8 KiB
Dart
60 lines
1.8 KiB
Dart
import 'dart:math';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:hiddingsel_app/constants/constant.dart';
|
|
import 'package:hiddingsel_app/appflow/view/menu_pages/search.dart';
|
|
import 'package:intl/intl.dart';
|
|
|
|
import '../navigation_drawer.dart';
|
|
|
|
class StartView extends StatelessWidget with NavigationDrawerItem {
|
|
|
|
String get title => 'Start';
|
|
|
|
final Function(PreferredSizeWidget appBar, Widget body) _onChange;
|
|
|
|
const StartView(onChange) : _onChange = onChange;
|
|
|
|
@override
|
|
Widget build(BuildContext context) => LayoutBuilder(
|
|
builder: (context, constraints) => Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
Container(
|
|
width: constraints.maxWidth,
|
|
height: constraints.maxHeight,
|
|
child: Image(
|
|
image: AssetImage('assets/images/start/img_start_${NumberFormat("00", "en_US").format(Random().nextInt(12)+1)}.png'),
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
Positioned(
|
|
top: constraints.maxHeight * 0.6,
|
|
child: Column(
|
|
children: [
|
|
Text(
|
|
'WILLKOMMEN!',
|
|
style: UITheme.theme.textTheme.displayMedium,
|
|
),
|
|
Divider(),
|
|
FloatingActionButton(
|
|
backgroundColor: UIColors.white,
|
|
child: Icon(
|
|
Icons.search,
|
|
color: UIColors.grey5,
|
|
),
|
|
onPressed: () {
|
|
_onChange(
|
|
Search(_onChange).getAppBar(),
|
|
Search(_onChange),
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|