TF-248 Update UI for web

This commit is contained in:
dab246
2022-02-10 18:07:48 +07:00
committed by Dat H. Pham
parent 5c0c1de5f3
commit c22bc94052
15 changed files with 205 additions and 189 deletions
@@ -123,6 +123,10 @@ class _ScrollingFloatingButtonAnimatedState
@override
Widget build(BuildContext context) {
final shortestSide = MediaQuery.of(context).size.shortestSide;
if (shortestSide < 60) {
return SizedBox.shrink();
}
return Card(
elevation: widget.elevation,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(widget.height! / 2))),
@@ -1,6 +1,5 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:flutter/material.dart';
// import 'package:flutter_svg/flutter_svg.dart';
typedef OnTapAvatarActionClick = void Function();
@@ -8,7 +7,6 @@ class AvatarBuilder {
Key? _key;
String? _text;
double? _size;
// String? _iconStatus;
Color? _bgColor;
Color? _textColor;
OnTapAvatarActionClick? _onTapAvatarActionClick;
@@ -27,11 +25,6 @@ class AvatarBuilder {
_text = text;
}
// AvatarBuilder iconStatus(String iconStatus) {
// _iconStatus = iconStatus;
// return this;
// }
void backgroundColor(Color bgColor) {
_bgColor = bgColor;
}
@@ -62,15 +55,19 @@ class AvatarBuilder {
key: _key,
width: _size ?? 40,
height: _size ?? 40,
padding: EdgeInsets.zero,
margin: EdgeInsets.zero,
alignment: Alignment.center,
child: Stack(
children: [
Container(
width: _size ?? 40,
height: _size ?? 40,
padding: EdgeInsets.zero,
margin: EdgeInsets.zero,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular((_size ?? 40) / 2),
borderRadius: BorderRadius.circular((_size ?? 40) * 0.5),
border: Border.all(color: Colors.transparent),
boxShadow: _boxShadows ?? [],
gradient: _avatarColors?.isNotEmpty == true
@@ -80,14 +77,13 @@ class AvatarBuilder {
tileMode: TileMode.decal,
colors: _avatarColors ?? [])
: null,
color: _bgColor ?? AppColor.avatarColor),
color: _bgColor ?? AppColor.avatarColor
),
child: Text(
'${_text ?? ''}',
style: TextStyle(fontSize: 20, color: _textColor ?? AppColor.avatarTextColor, fontWeight: FontWeight.w500))),
// if (_iconStatus != null && _iconStatus!.isNotEmpty)
// Align(
// child: SvgPicture.asset(_iconStatus!, width: 12, height: 12, fit: BoxFit.fill),
// alignment: Alignment.bottomRight)
style: TextStyle(fontSize: 20, color: _textColor ?? AppColor.avatarTextColor, fontWeight: FontWeight.w500)
)
),
],
)),
);