flutter_profile/lib/src/services/profile_service.dart

28 lines
838 B
Dart
Raw Normal View History

2022-10-31 17:15:05 +01:00
// SPDX-FileCopyrightText: 2022 Iconica
//
// SPDX-License-Identifier: BSD-3-Clause
import 'dart:async';
import 'package:flutter/material.dart';
2022-09-21 14:37:16 +02:00
import 'package:flutter_profile/src/models/user.dart';
2022-08-26 15:31:42 +02:00
2022-09-20 14:11:38 +02:00
/// 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.
2022-09-20 14:11:38 +02:00
///
/// EditProfile is called when a user changes and submits a standard textfields.
///
/// UploadImage is called when te user presses the avatar.
2022-08-26 16:28:40 +02:00
abstract class ProfileService {
2022-08-26 15:31:42 +02:00
const ProfileService();
FutureOr<void> pageBottomAction();
2022-08-26 15:31:42 +02:00
2022-11-15 11:20:48 +01:00
FutureOr<void> editProfile(User user, String key, String? value);
2022-08-26 15:31:42 +02:00
2022-11-25 12:09:38 +01:00
FutureOr<void> uploadImage(
BuildContext context, {
required Function(bool isUploading) onUploadStateChanged,
});
2022-08-26 15:31:42 +02:00
}