profile image improvement & notificaiton

main_design2.0
Sikander Saleem 2 years ago
parent 7d50ac3f81
commit 686c70e3db

@ -40,9 +40,9 @@ class NotificationsProvider extends ChangeNotifier {
/// for more details check http state manager
/// lib\controllers\http_status_manger\http_status_manger.dart
Future<int> getSystemNotifications({
@required String host,
@required User user,
@required int hospitalId,
String host,
User user,
int hospitalId,
}) async {
if (isLoading == true) return -2;
isLoading = true;

@ -40,11 +40,11 @@ class AppDrawer extends StatelessWidget {
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
child: snapshot.profileImage != null
? Image.file(snapshot.profileImage)
: const Icon(
: (snapshot.user.profilePhotoName?.isNotEmpty ?? false)
? Image.network(snapshot.user.profilePhotoName)
: const Icon(
Icons.person,
size: 50,
color: Colors.white,

@ -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,

@ -71,11 +71,11 @@ class _ProfilePageState extends State<ProfilePage> {
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
child: snapshot.profileImage != null
? Image.file(snapshot.profileImage)
: const Icon(
: (snapshot.user.profilePhotoName?.isNotEmpty ?? false)
? Image.network(snapshot.user.profilePhotoName)
: const Icon(
Icons.person,
size: 50,
color: Colors.white,

Loading…
Cancel
Save