Added central user credentials management
This commit is contained in:
@ -7,7 +7,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:localstore/localstore.dart';
|
||||
|
||||
import '../../../widget/errorView.dart';
|
||||
import '../../../widget/placeholderView.dart';
|
||||
import 'jsonViewer.dart';
|
||||
|
||||
class CacheView extends StatefulWidget {
|
||||
@ -93,7 +93,7 @@ class _CacheViewState extends State<CacheView> {
|
||||
);
|
||||
} else {
|
||||
return const Center(
|
||||
child: ErrorView(icon: Icons.hourglass_empty, text: "Keine Daten"),
|
||||
child: PlaceholderView(icon: Icons.hourglass_empty, text: "Keine Daten"),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
@ -1,31 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ErrorView extends StatelessWidget {
|
||||
final IconData icon;
|
||||
final String text;
|
||||
const ErrorView({Key? key, this.icon = Icons.report_gmailerrorred, this.text = "Es ist ein Fehler aufgetreten!"}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(top: 100, left: 20, right: 20),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.all(30),
|
||||
child: Icon(icon, color: Colors.grey, size: 60),
|
||||
),
|
||||
Text(text,
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
color: Colors.grey,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
34
lib/widget/placeholderView.dart
Normal file
34
lib/widget/placeholderView.dart
Normal file
@ -0,0 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PlaceholderView extends StatelessWidget {
|
||||
final IconData icon;
|
||||
final String text;
|
||||
const PlaceholderView({Key? key, required this.icon, required this.text}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DefaultTextStyle(
|
||||
style: const TextStyle(),
|
||||
child: Center(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(top: 100, left: 20, right: 20),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.all(30),
|
||||
child: Icon(icon, color: Colors.grey, size: 60),
|
||||
),
|
||||
Text(text,
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
color: Colors.grey,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user