flutter_profile/lib/src/services/profile_service.dart
2022-11-25 12:09:38 +01:00

28 lines
838 B
Dart

// SPDX-FileCopyrightText: 2022 Iconica
//
// SPDX-License-Identifier: BSD-3-Clause
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_profile/src/models/user.dart';
/// ProfileService can be extended and set for the profilePage. The following method can be overriden.
///
/// BottompageAction is called when the [InkWell] at the bottom of the page is tapped.
///
/// EditProfile is called when a user changes and submits a standard textfields.
///
/// UploadImage is called when te user presses the avatar.
abstract class ProfileService {
const ProfileService();
FutureOr<void> pageBottomAction();
FutureOr<void> editProfile(User user, String key, String? value);
FutureOr<void> uploadImage(
BuildContext context, {
required Function(bool isUploading) onUploadStateChanged,
});
}