fluffychat/lib/widgets/layouts/empty_page.dart

45 lines
1.2 KiB
Dart
Raw Normal View History

import 'dart:math';
2020-12-06 11:51:40 +00:00
import 'package:flutter/material.dart';
class EmptyPage extends StatelessWidget {
final bool loading;
static const double _width = 200;
2021-11-19 19:28:17 +00:00
const EmptyPage({this.loading = false, Key? key}) : super(key: key);
2020-12-06 11:51:40 +00:00
@override
Widget build(BuildContext context) {
2022-08-14 14:59:21 +00:00
final width = min(MediaQuery.of(context).size.width, EmptyPage._width);
2020-12-06 11:51:40 +00:00
return Scaffold(
// Add invisible appbar to make status bar on Android tablets bright.
appBar: AppBar(
automaticallyImplyLeading: false,
elevation: 0,
2021-11-15 06:59:51 +00: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',
2022-08-14 14:59:21 +00:00
width: width,
height: width,
),
),
),
if (loading)
Center(
child: SizedBox(
2022-08-14 14:59:21 +00:00
width: width,
2021-10-14 16:09:30 +00:00
child: const LinearProgressIndicator(),
),
),
],
2020-12-06 11:51:40 +00:00
),
);
}
}