lint changes

This commit is contained in:
Deven Joshi
2021-05-05 15:10:46 +05:30
parent a688ab3a10
commit 5ad74b8f2b
4 changed files with 238 additions and 217 deletions
@@ -2,16 +2,11 @@ import 'package:flutter/material.dart';
import 'package:flutter_portal/flutter_portal.dart';
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
/// Tile to display a message, used in stream chat to display connection status
class InfoTile extends StatelessWidget {
final String message;
final Widget child;
final bool showMessage;
final Alignment? tileAnchor;
final Alignment? childAnchor;
final TextStyle? textStyle;
final Color? backgroundColor;
/// Constructor for creating an [InfoTile] widget
const InfoTile({
Key? key,
required this.message,
required this.child,
required this.showMessage,
@@ -19,31 +14,50 @@ class InfoTile extends StatelessWidget {
this.childAnchor,
this.textStyle,
this.backgroundColor,
});
}) : super(key: key);
/// String to display
final String message;
/// Widget to display over
final Widget child;
/// Flag to show message
final bool showMessage;
/// Anchor for tile - [portalAnchor] for [PortalEntry]
final Alignment? tileAnchor;
/// Alignment for child - [childAnchor] for [PortalEntry]
final Alignment? childAnchor;
/// [TextStyle] for message
final TextStyle? textStyle;
/// Background color for tile
final Color? backgroundColor;
@override
Widget build(BuildContext context) {
return PortalEntry(
visible: showMessage,
portalAnchor: tileAnchor ?? Alignment.topCenter,
childAnchor: childAnchor ?? Alignment.bottomCenter,
portal: Container(
height: 25,
color: backgroundColor ??
StreamChatTheme.of(context).colorTheme.grey.withOpacity(0.9),
child: Center(
child: Text(
message,
style: textStyle ??
StreamChatTheme.of(context).textTheme.body.copyWith(
color: Colors.white,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
Widget build(BuildContext context) => PortalEntry(
visible: showMessage,
portalAnchor: tileAnchor ?? Alignment.topCenter,
childAnchor: childAnchor ?? Alignment.bottomCenter,
portal: Container(
height: 25,
color: backgroundColor ??
StreamChatTheme.of(context).colorTheme.grey.withOpacity(0.9),
child: Center(
child: Text(
message,
style: textStyle ??
StreamChatTheme.of(context).textTheme.body.copyWith(
color: Colors.white,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
),
),
child: child,
);
}
child: child,
);
}