TF-517 Implement TapCallBack when click logo app
This commit is contained in:
@@ -4,6 +4,9 @@ import 'package:flutter_svg/flutter_svg.dart';
|
|||||||
/// A builder which builds a reusable slogan widget.
|
/// A builder which builds a reusable slogan widget.
|
||||||
/// This contains the logo and the slogan text.
|
/// This contains the logo and the slogan text.
|
||||||
/// The elements are arranged in a column or row.
|
/// The elements are arranged in a column or row.
|
||||||
|
|
||||||
|
typedef OnTapCallback = void Function();
|
||||||
|
|
||||||
class SloganBuilder {
|
class SloganBuilder {
|
||||||
|
|
||||||
final bool arrangedByHorizontal;
|
final bool arrangedByHorizontal;
|
||||||
@@ -15,6 +18,7 @@ class SloganBuilder {
|
|||||||
String? _logoSVG;
|
String? _logoSVG;
|
||||||
String? _logo;
|
String? _logo;
|
||||||
double? _sizeLogo;
|
double? _sizeLogo;
|
||||||
|
OnTapCallback? _onTapCallback;
|
||||||
|
|
||||||
SloganBuilder({this.arrangedByHorizontal = false});
|
SloganBuilder({this.arrangedByHorizontal = false});
|
||||||
|
|
||||||
@@ -46,23 +50,33 @@ class SloganBuilder {
|
|||||||
_sizeLogo = size;
|
_sizeLogo = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void addOnTapCallback(OnTapCallback? onTapCallback) {
|
||||||
|
_onTapCallback = onTapCallback;
|
||||||
|
}
|
||||||
|
|
||||||
Widget build() {
|
Widget build() {
|
||||||
if (!arrangedByHorizontal) {
|
if (!arrangedByHorizontal) {
|
||||||
return Column(children: [
|
return InkWell(
|
||||||
_logoApp(),
|
onTap: () => _onTapCallback?.call(),
|
||||||
Padding(
|
child: Column(children: [
|
||||||
padding: EdgeInsets.only(top: 16, left: 16, right: 16),
|
_logoApp(),
|
||||||
child: Text(_text ?? '', key: _key, style: _textStyle, textAlign: _textAlign),
|
Padding(
|
||||||
),
|
padding: EdgeInsets.only(top: 16, left: 16, right: 16),
|
||||||
]);
|
child: Text(_text ?? '', key: _key, style: _textStyle, textAlign: _textAlign),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return Row(children: [
|
return InkWell(
|
||||||
_logoApp(),
|
onTap: () => _onTapCallback?.call(),
|
||||||
Padding(
|
child: Row(children: [
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
_logoApp(),
|
||||||
child: Text(_text ?? '', key: _key, style: _textStyle, textAlign: _textAlign),
|
Padding(
|
||||||
),
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
]);
|
child: Text(_text ?? '', key: _key, style: _textStyle, textAlign: _textAlign),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ class ManageAccountDashBoardView extends GetWidget<ManageAccountDashBoardControl
|
|||||||
..setSloganTextAlign(TextAlign.center)
|
..setSloganTextAlign(TextAlign.center)
|
||||||
..setSloganTextStyle(const TextStyle(color: Colors.black, fontSize: 20, fontWeight: FontWeight.bold))
|
..setSloganTextStyle(const TextStyle(color: Colors.black, fontSize: 20, fontWeight: FontWeight.bold))
|
||||||
..setSizeLogo(24)
|
..setSizeLogo(24)
|
||||||
|
..addOnTapCallback(() => controller.backToMailboxDashBoard())
|
||||||
..setLogo(_imagePaths.icLogoTMail))
|
..setLogo(_imagePaths.icLogoTMail))
|
||||||
.build(),
|
.build(),
|
||||||
Obx(() {
|
Obx(() {
|
||||||
|
|||||||
Reference in New Issue
Block a user