Future<void> logout(BuildContext context) async {
await secureStorage.delete(key: 'email');
await secureStorage.delete(key: 'password');
isLoggedIn = false;
notifyListeners();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Logged out successfully')),
);
Navigator.pushReplacementNamed(context, '/'); // Redirect to main screen
}
After getting server side response reload dart file
return buildBaseScreen(
currentIndex: 0, // Set the appropriate index for the bottom nav bar
title: 'Publisher',
body: RefreshIndicator(
onRefresh: () async {
await influencerViewModel.fetchInfluencers();
},
Future<void> updateInfluencerSelection(String influencerId, String socialKey, bool isSelected, String email) async {
try {
await api.updateInfluencerSelection(influencerId, socialKey, isSelected, email);
print("Selection updated successfully");
await fetchInfluencers(); // Fetch the updated list of influencers
notifyListeners(); // Notify listeners after updating the selection
} catch (e) {
print("Error updating selection: $e");
}
}
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)