fluffychat/lib/widgets/layouts/empty_page.dart

45 lines
1.2 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) {
final _width = min(MediaQuery.of(context).size.width, EmptyPage._width);
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(
'assets/info-logo.png',
width: _width,
height: _width,
),
),
),
if (loading)
Center(
child: SizedBox(
width: _width,
2021-10-14 18:09:30 +02:00
child: const LinearProgressIndicator(),
),
),
],
2020-12-06 12:51:40 +01:00
),
);
}
}