fluffychat/lib/pages/views/empty_page_view.dart

38 lines
951 B
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;
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(
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,
child: LinearProgressIndicator(),
),
),
],
2020-12-06 12:51:40 +01:00
),
);
}
}