|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/all_requests_provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/notifications_provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
|
@ -28,6 +29,7 @@ class _DashboardPageState extends State<DashboardPage> {
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
Provider.of<AllRequestsProvider>(context, listen: false).getRequests();
|
|
|
|
|
Provider.of<NotificationsProvider>(context, listen: false).getSystemNotifications();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -54,10 +56,10 @@ class _DashboardPageState extends State<DashboardPage> {
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(1), // Border radius
|
|
|
|
|
child: ClipOval(
|
|
|
|
|
child: (snapshot.user.profilePhotoName?.isNotEmpty ?? false)
|
|
|
|
|
? Image.network(snapshot.user.profilePhotoName)
|
|
|
|
|
: snapshot.profileImage != null
|
|
|
|
|
? Image.file(snapshot.profileImage)
|
|
|
|
|
child: snapshot.profileImage != null
|
|
|
|
|
? Image.file(snapshot.profileImage)
|
|
|
|
|
: (snapshot.user.profilePhotoName?.isNotEmpty ?? false)
|
|
|
|
|
? Image.network(snapshot.user.profilePhotoName)
|
|
|
|
|
: const Icon(
|
|
|
|
|
Icons.person,
|
|
|
|
|
size: 24,
|
|
|
|
|
|