diff --git a/forui/example/lib/example.dart b/forui/example/lib/example.dart index 788445b5c..07cdb29f9 100644 --- a/forui/example/lib/example.dart +++ b/forui/example/lib/example.dart @@ -23,10 +23,15 @@ class _ExampleState extends State { const SizedBox(height: 100), FProgress(value: 0.9), const SizedBox(height: 10), - FAlert( - title: const Text('Heads Up! Forui is coming to flutter!'), - subtitle: const Text('You can add components dfijsoi djfosfj to your app using the cli.'), - ) + const FAvatar( + child: Text('DC'), + //backgroundImage: NetworkImage('https://picsum.photos/250?image=9'), + ), + const SizedBox(height: 20), + const CircleAvatar( + backgroundImage: NetworkImage('https://picsum.photos/250?image=9'), + child: Text('DC'), + ), ], ); } diff --git a/forui/lib/src/theme/theme_data.dart b/forui/lib/src/theme/theme_data.dart index 2291c9c14..5900c0343 100644 --- a/forui/lib/src/theme/theme_data.dart +++ b/forui/lib/src/theme/theme_data.dart @@ -1,6 +1,5 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; -import 'package:forui/src/widgets/avatar.dart'; import 'package:meta/meta.dart'; diff --git a/forui/lib/src/widgets/avatar.dart b/forui/lib/src/widgets/avatar.dart index dc748a5d0..63a933f60 100644 --- a/forui/lib/src/widgets/avatar.dart +++ b/forui/lib/src/widgets/avatar.dart @@ -69,13 +69,9 @@ class FAvatar extends StatelessWidget { child: child == null ? null : Center( - // Need to disable text scaling here so that the text doesn't - // escape the avatar when the textScaleFactor is large. - child: MediaQuery.withNoTextScaling( - child: DefaultTextStyle( - style: style.text, - child: child!, - ), + child: DefaultTextStyle( + style: style.text, + child: child!, ), ), ); @@ -113,7 +109,10 @@ final class FAvatarStyle with Diagnosticable { FAvatarStyle.inherit({required FColorScheme colorScheme, required FTypography typography}) : backgroundColor = colorScheme.muted, constraints = const BoxConstraints(minHeight: 40.0, minWidth: 40.0, maxHeight: 40.0, maxWidth: 40.0), - text = typography.base.copyWith(color: colorScheme.mutedForeground); + text = typography.base.copyWith( + color: colorScheme.mutedForeground, + height: 0, + ); /// Returns a copy of this [FAvatarStyle] with the given properties replaced. /// diff --git a/forui/lib/widgets.dart b/forui/lib/widgets.dart index 19861440e..6da3bd41b 100644 --- a/forui/lib/widgets.dart +++ b/forui/lib/widgets.dart @@ -19,6 +19,7 @@ library forui.widgets; import 'package:forui/forui.dart'; export 'src/widgets/alert/alert.dart' hide Variant; +export 'src/widgets/avatar.dart'; export 'src/widgets/badge/badge.dart' hide Variant; export 'src/widgets/bottom_navigation_bar/bottom_navigation_bar.dart'; export 'src/widgets/button/button.dart' hide Variant;