mirror of
https://github.com/Iconica-Development/flutter_profile.git
synced 2025-05-19 01:03:45 +02:00
Merge pull request #14 from Iconica-Development/feat/avatar-changes-for-safino
feat: avatar changes for safino
This commit is contained in:
commit
08c6312f88
10 changed files with 292 additions and 114 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -34,4 +34,6 @@ example/ios/
|
||||||
example/linux/
|
example/linux/
|
||||||
example/macos/
|
example/macos/
|
||||||
example/windows/
|
example/windows/
|
||||||
example/web/
|
example/web/
|
||||||
|
.flutter-plugins
|
||||||
|
.flutter-plugins-dependencies
|
||||||
|
|
|
@ -91,9 +91,7 @@ class _ProfileExampleState extends State<ProfileExample> {
|
||||||
user: _user,
|
user: _user,
|
||||||
service: ExampleProfileService(),
|
service: ExampleProfileService(),
|
||||||
style: ProfileStyle(
|
style: ProfileStyle(
|
||||||
avatarStyle: const AvatarStyle(
|
avatarTextStyle: const TextStyle(fontSize: 20),
|
||||||
displayNameStyle: TextStyle(fontSize: 20),
|
|
||||||
),
|
|
||||||
pagePadding: EdgeInsets.only(
|
pagePadding: EdgeInsets.only(
|
||||||
top: 50,
|
top: 50,
|
||||||
bottom: 50,
|
bottom: 50,
|
||||||
|
|
|
@ -15,6 +15,27 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
|
cached_network_image:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: cached_network_image
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.2.2"
|
||||||
|
cached_network_image_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: cached_network_image_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.0"
|
||||||
|
cached_network_image_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: cached_network_image_web
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.2"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -36,6 +57,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.16.0"
|
version: "1.16.0"
|
||||||
|
crypto:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: crypto
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.2"
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -50,11 +78,39 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.1"
|
version: "1.3.1"
|
||||||
|
ffi:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: ffi
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.1"
|
||||||
|
file:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "6.1.4"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_blurhash:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_blurhash
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.7.0"
|
||||||
|
flutter_cache_manager:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_cache_manager
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.3.0"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
|
@ -68,12 +124,26 @@ packages:
|
||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "0.0.9"
|
version: "0.0.11"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
http:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.13.5"
|
||||||
|
http_parser:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http_parser
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.2"
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -102,6 +172,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.0"
|
version: "1.8.0"
|
||||||
|
octo_image:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: octo_image
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.2"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -109,6 +186,90 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.2"
|
version: "1.8.2"
|
||||||
|
path_provider:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.11"
|
||||||
|
path_provider_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_android
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.22"
|
||||||
|
path_provider_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_ios
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.11"
|
||||||
|
path_provider_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_linux
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.7"
|
||||||
|
path_provider_macos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_macos
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.6"
|
||||||
|
path_provider_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.5"
|
||||||
|
path_provider_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_windows
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.3"
|
||||||
|
pedantic:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: pedantic
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.11.1"
|
||||||
|
platform:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: platform
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.0"
|
||||||
|
plugin_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: plugin_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.3"
|
||||||
|
process:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: process
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.2.4"
|
||||||
|
rxdart:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: rxdart
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.27.7"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -121,6 +282,20 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.0"
|
version: "1.9.0"
|
||||||
|
sqflite:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.0+3"
|
||||||
|
sqflite_common:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sqflite_common
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.0+2"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -142,6 +317,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.1.1"
|
||||||
|
synchronized:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: synchronized
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.0+3"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -156,6 +338,20 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.12"
|
version: "0.4.12"
|
||||||
|
typed_data:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: typed_data
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.3.1"
|
||||||
|
uuid:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: uuid
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.7"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -163,6 +359,20 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.2"
|
version: "2.1.2"
|
||||||
|
win32:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: win32
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.1"
|
||||||
|
xdg_directories:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: xdg_directories
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.0+2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.17.6 <3.0.0"
|
dart: ">=2.18.0 <3.0.0"
|
||||||
flutter: ">=1.17.0"
|
flutter: ">=3.3.0"
|
||||||
|
|
|
@ -8,7 +8,6 @@ export 'src/widgets/profile/profile_page.dart';
|
||||||
export 'src/widgets/profile/profile_style.dart';
|
export 'src/widgets/profile/profile_style.dart';
|
||||||
export 'src/widgets/avatar/avatar_wrapper.dart';
|
export 'src/widgets/avatar/avatar_wrapper.dart';
|
||||||
export 'src/widgets/avatar/avatar.dart';
|
export 'src/widgets/avatar/avatar.dart';
|
||||||
export 'src/widgets/avatar/avatar_style.dart';
|
|
||||||
export 'src/services/profile_service.dart';
|
export 'src/services/profile_service.dart';
|
||||||
export 'src/widgets/item_builder/item_builder.dart';
|
export 'src/widgets/item_builder/item_builder.dart';
|
||||||
export 'src/models/user.dart';
|
export 'src/models/user.dart';
|
||||||
|
|
|
@ -2,63 +2,60 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: BSD-3-Clause
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_profile/src/models/user.dart';
|
import 'package:flutter_profile/src/models/user.dart';
|
||||||
import 'package:flutter_profile/src/widgets/avatar/avatar_style.dart';
|
|
||||||
|
|
||||||
class Avatar extends StatelessWidget {
|
class Avatar extends StatelessWidget {
|
||||||
const Avatar({
|
const Avatar({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.user,
|
this.user,
|
||||||
this.style = const AvatarStyle(),
|
this.size = 100,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final User user;
|
final User? user;
|
||||||
final AvatarStyle style;
|
final double size;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var imageProvider = _getImageProvider();
|
var imageProvider = _getImageProvider(user!);
|
||||||
|
var hasImage = imageProvider != null;
|
||||||
|
var hasNames =
|
||||||
|
user != null && (user!.firstName != null || user!.lastName != null);
|
||||||
|
|
||||||
if (imageProvider != null) {
|
return Container(
|
||||||
return Container(
|
width: size,
|
||||||
width: style.width,
|
height: size,
|
||||||
height: style.height,
|
decoration: BoxDecoration(
|
||||||
decoration: BoxDecoration(
|
shape: BoxShape.circle,
|
||||||
shape: BoxShape.circle,
|
color: !hasImage && hasNames
|
||||||
image: DecorationImage(
|
? _generateColorWithIntials(user!.firstName, user!.lastName)
|
||||||
image: imageProvider,
|
: null,
|
||||||
fit: BoxFit.cover,
|
image: hasImage
|
||||||
),
|
? DecorationImage(
|
||||||
),
|
image: imageProvider,
|
||||||
);
|
fit: BoxFit.cover,
|
||||||
} else if (user.firstName != null || user.lastName != null) {
|
)
|
||||||
return Container(
|
: null,
|
||||||
width: style.width,
|
),
|
||||||
height: style.height,
|
child: hasImage || !hasNames
|
||||||
decoration: BoxDecoration(
|
? null
|
||||||
color: _generateColorWithIntials(user.firstName, user.lastName),
|
: Center(
|
||||||
shape: BoxShape.circle,
|
child: Text(
|
||||||
),
|
style: TextStyle(
|
||||||
child: Center(
|
fontSize: size * 0.4,
|
||||||
child: Text(
|
),
|
||||||
style: TextStyle(
|
user!.initials,
|
||||||
fontSize: style.width * 0.4,
|
),
|
||||||
),
|
),
|
||||||
user.initials,
|
);
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Container();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageProvider? _getImageProvider() {
|
ImageProvider? _getImageProvider(User? user) {
|
||||||
if (user.image != null) {
|
if (user?.image != null) {
|
||||||
return MemoryImage(user.image!);
|
return MemoryImage(user!.image!);
|
||||||
} else if (user.imageUrl != null) {
|
} else if (user?.imageUrl != null) {
|
||||||
return NetworkImage(user.imageUrl!);
|
return CachedNetworkImageProvider(user!.imageUrl!);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
// SPDX-FileCopyrightText: 2022 Iconica
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
/// AvatarStyle is used to set the style of the avatar displayed at the top of the [ProfilePage].
|
|
||||||
///
|
|
||||||
/// Width is used to set the width of the avatar. Defaults to 100.
|
|
||||||
///
|
|
||||||
/// Height is used to set the height of the avatar. Defaults to 100.
|
|
||||||
///
|
|
||||||
/// InitialStyle sets the [TextStyle] of the initial which are shown when no image is provided.
|
|
||||||
///
|
|
||||||
/// DisplayNameStyle sets the [TextStyle] for the displayname underneath the avatar.
|
|
||||||
class AvatarStyle {
|
|
||||||
const AvatarStyle({
|
|
||||||
this.width = 100,
|
|
||||||
this.height = 100,
|
|
||||||
this.displayName = true,
|
|
||||||
this.initialStyle = const TextStyle(),
|
|
||||||
this.displayNamePadding = const EdgeInsets.only(top: 16),
|
|
||||||
this.displayNameStyle = const TextStyle(),
|
|
||||||
});
|
|
||||||
|
|
||||||
final double width;
|
|
||||||
final double height;
|
|
||||||
final TextStyle initialStyle;
|
|
||||||
final bool displayName;
|
|
||||||
final EdgeInsets displayNamePadding;
|
|
||||||
final TextStyle displayNameStyle;
|
|
||||||
}
|
|
|
@ -5,44 +5,48 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_profile/src/models/user.dart';
|
import 'package:flutter_profile/src/models/user.dart';
|
||||||
import 'package:flutter_profile/src/widgets/avatar/avatar.dart';
|
import 'package:flutter_profile/src/widgets/avatar/avatar.dart';
|
||||||
import 'package:flutter_profile/src/widgets/avatar/avatar_style.dart';
|
|
||||||
|
|
||||||
class AvaterWrapper extends StatelessWidget {
|
class AvatarWrapper extends StatelessWidget {
|
||||||
const AvaterWrapper({
|
const AvatarWrapper({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.user,
|
required this.user,
|
||||||
this.avatar,
|
this.showName = false,
|
||||||
this.style = const AvatarStyle(),
|
this.padding = const EdgeInsets.only(top: 16),
|
||||||
|
this.size = 100,
|
||||||
|
this.textStyle,
|
||||||
|
this.customAvatar,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final User user;
|
final User user;
|
||||||
final Widget? avatar;
|
final Widget? customAvatar;
|
||||||
final AvatarStyle style;
|
final bool showName;
|
||||||
|
final EdgeInsets padding;
|
||||||
|
final TextStyle? textStyle;
|
||||||
|
final double size;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var avatar = this.avatar ??
|
var avatar = customAvatar ??
|
||||||
Avatar(
|
Avatar(
|
||||||
user: user,
|
user: user,
|
||||||
style: style,
|
size: size,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!style.displayName) {
|
return showName
|
||||||
return avatar;
|
? Column(
|
||||||
}
|
children: [
|
||||||
|
avatar,
|
||||||
return Column(
|
Padding(
|
||||||
children: [
|
padding: padding,
|
||||||
avatar,
|
child: Flexible(
|
||||||
if (user.firstName != null || user.firstName != null)
|
child: Text(
|
||||||
Padding(
|
style: textStyle,
|
||||||
padding: style.displayNamePadding,
|
user.displayName,
|
||||||
child: Text(
|
),
|
||||||
user.displayName,
|
),
|
||||||
style: style.displayNameStyle,
|
),
|
||||||
),
|
],
|
||||||
)
|
)
|
||||||
],
|
: avatar;
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
// SPDX-License-Identifier: BSD-3-Clause
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_profile/src/widgets/avatar/avatar_style.dart';
|
|
||||||
|
|
||||||
/// ProfielStyle is used to set a couple of style paramaters for the whole profile page.
|
/// ProfielStyle is used to set a couple of style paramaters for the whole profile page.
|
||||||
///
|
///
|
||||||
|
@ -14,14 +13,14 @@ import 'package:flutter_profile/src/widgets/avatar/avatar_style.dart';
|
||||||
/// BetweenDefaultitemPadding sets te padding between each user data item.
|
/// BetweenDefaultitemPadding sets te padding between each user data item.
|
||||||
class ProfileStyle {
|
class ProfileStyle {
|
||||||
const ProfileStyle({
|
const ProfileStyle({
|
||||||
this.avatarStyle = const AvatarStyle(),
|
this.avatarTextStyle = const TextStyle(),
|
||||||
this.betweenDefaultItemPadding = 10,
|
this.betweenDefaultItemPadding = 10,
|
||||||
this.pagePadding = EdgeInsets.zero,
|
this.pagePadding = EdgeInsets.zero,
|
||||||
this.bottomActionTextStyle,
|
this.bottomActionTextStyle,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// AvatarStyle can be used to set some avatar styling parameters.
|
/// AvatarStyle can be used to set some avatar styling parameters.
|
||||||
final AvatarStyle avatarStyle;
|
final TextStyle avatarTextStyle;
|
||||||
|
|
||||||
/// PagePadding can be set to determine the padding of the whole page againt the profile page parent.
|
/// PagePadding can be set to determine the padding of the whole page againt the profile page parent.
|
||||||
final EdgeInsetsGeometry pagePadding;
|
final EdgeInsetsGeometry pagePadding;
|
||||||
|
|
|
@ -218,10 +218,10 @@ class _ProfileWrapperState extends State<ProfileWrapper> {
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await widget.service.uploadImage(context);
|
await widget.service.uploadImage(context);
|
||||||
},
|
},
|
||||||
child: AvaterWrapper(
|
child: AvatarWrapper(
|
||||||
user: widget.user,
|
user: widget.user,
|
||||||
style: widget.style.avatarStyle,
|
textStyle: widget.style.avatarTextStyle,
|
||||||
avatar: widget.customAvatar,
|
customAvatar: widget.customAvatar,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|
|
@ -8,6 +8,7 @@ environment:
|
||||||
flutter: ">=1.17.0"
|
flutter: ">=1.17.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
|
cached_network_image: ^3.2.2
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
|
@ -16,4 +17,4 @@ dev_dependencies:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_lints: ^2.0.0
|
flutter_lints: ^2.0.0
|
||||||
|
|
||||||
flutter:
|
flutter:
|
Loading…
Reference in a new issue