2021-06-20 09:31:22 +02:00
|
|
|
import 'dart:math';
|
|
|
|
|
2020-12-06 12:51:40 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class EmptyPage extends StatelessWidget {
|
2021-06-20 09:31:22 +02:00
|
|
|
final bool loading;
|
|
|
|
static const double _width = 200;
|
2021-11-19 20:28:17 +01:00
|
|
|
const EmptyPage({this.loading = false, Key? key}) : super(key: key);
|
2020-12-06 12:51:40 +01:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2021-06-20 09:31:22 +02:00
|
|
|
final _width = min(MediaQuery.of(context).size.width, EmptyPage._width);
|
2020-12-06 12:51:40 +01:00
|
|
|
return Scaffold(
|
2021-09-07 14:22:47 +02:00
|
|
|
// Add invisible appbar to make status bar on Android tablets bright.
|
|
|
|
appBar: AppBar(
|
|
|
|
automaticallyImplyLeading: false,
|
|
|
|
elevation: 0,
|
2021-11-15 07:59:51 +01:00
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
2021-09-07 14:22:47 +02:00
|
|
|
),
|
|
|
|
extendBodyBehindAppBar: true,
|
2021-08-31 11:51:39 +02:00
|
|
|
body: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
2021-06-20 09:31:22 +02:00
|
|
|
children: [
|
2021-08-31 11:51:39 +02:00
|
|
|
Center(
|
|
|
|
child: Hero(
|
|
|
|
tag: 'info-logo',
|
|
|
|
child: Image.asset(
|
|
|
|
'assets/info-logo.png',
|
|
|
|
width: _width,
|
|
|
|
height: _width,
|
2021-06-20 09:31:22 +02:00
|
|
|
),
|
2021-08-31 11:51:39 +02:00
|
|
|
),
|
2021-06-20 09:31:22 +02:00
|
|
|
),
|
2021-08-31 11:51:39 +02:00
|
|
|
if (loading)
|
|
|
|
Center(
|
|
|
|
child: SizedBox(
|
|
|
|
width: _width,
|
2021-10-14 18:09:30 +02:00
|
|
|
child: const LinearProgressIndicator(),
|
2021-08-31 11:51:39 +02:00
|
|
|
),
|
|
|
|
),
|
2021-06-20 09:31:22 +02:00
|
|
|
],
|
2020-12-06 12:51:40 +01:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|