fluffychat/lib/widgets/layouts/empty_page.dart

46 lines
1.3 KiB
Dart
Raw Normal View History

import 'dart:math';
2020-12-06 12:51:40 +01:00
import 'package:flutter/material.dart';
class EmptyPage extends StatelessWidget {
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) {
2022-12-25 10:45:13 +01:00
final width = min(MediaQuery.of(context).size.width, EmptyPage._width) / 2;
2020-12-06 12:51:40 +01:00
return Scaffold(
// 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,
),
extendBodyBehindAppBar: true,
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: Hero(
tag: 'info-logo',
child: Image.asset(
2022-12-25 10:45:13 +01:00
'assets/favicon.png',
2022-08-14 16:59:21 +02:00
width: width,
height: width,
filterQuality: FilterQuality.medium,
),
),
),
if (loading)
Center(
child: SizedBox(
2022-08-14 16:59:21 +02:00
width: width,
2021-10-14 18:09:30 +02:00
child: const LinearProgressIndicator(),
),
),
],
2020-12-06 12:51:40 +01:00
),
);
}
}