TF-390 Apply new ui composer for browser
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
typedef IconWebCallback = void Function();
|
||||
@@ -20,7 +21,7 @@ Widget buildIconWeb({
|
||||
iconSize: iconSize,
|
||||
padding: iconPadding ?? EdgeInsets.all(8.0),
|
||||
splashRadius: splashRadius ?? 20,
|
||||
tooltip: tooltip,
|
||||
tooltip: tooltip ?? '',
|
||||
onPressed: onTap)
|
||||
);
|
||||
}
|
||||
@@ -50,4 +51,47 @@ Widget buildIconWebHasPosition(BuildContext context, {
|
||||
child: icon,
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget buildTextCircleButton(String text, {
|
||||
TextStyle? textStyle,
|
||||
IconWebCallback? onTap,
|
||||
}) {
|
||||
return Material(
|
||||
shape: CircleBorder(),
|
||||
color: Colors.transparent,
|
||||
child: TextButton(
|
||||
child: Text(
|
||||
text,
|
||||
style: textStyle ?? TextStyle(fontWeight: FontWeight.normal, fontSize: 15, color: AppColor.lineItemListColor)),
|
||||
style: ButtonStyle(
|
||||
overlayColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) => AppColor.colorFocusButton),
|
||||
shape: MaterialStateProperty.all(CircleBorder()),
|
||||
padding: MaterialStateProperty.resolveWith<EdgeInsets>((Set<MaterialState> states) => EdgeInsets.all(5)),
|
||||
elevation: MaterialStateProperty.resolveWith<double>((Set<MaterialState> states) => 0)),
|
||||
onPressed: () => onTap?.call()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildTextButton(String text, {
|
||||
TextStyle? textStyle,
|
||||
double? width,
|
||||
double? height,
|
||||
Color? backgroundColor,
|
||||
double? radius,
|
||||
IconWebCallback? onTap,
|
||||
}) {
|
||||
return SizedBox(
|
||||
width: width ?? double.infinity,
|
||||
height: height ?? 40,
|
||||
child: ElevatedButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith((states) => backgroundColor ?? AppColor.colorTextButton),
|
||||
elevation: MaterialStateProperty.resolveWith((states) => 0),
|
||||
shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius: BorderRadius.circular(radius ?? 0)))),
|
||||
child: Text(text, style: textStyle ?? TextStyle(fontSize: 17, color: Colors.white, fontWeight: FontWeight.w500)),
|
||||
onPressed: () => onTap?.call()
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user