TF-1427 Remove object do not used

This commit is contained in:
dab246
2023-02-09 19:14:33 +07:00
committed by Dat Vu
parent 2cc2e17bf2
commit 181820ed45
13 changed files with 215 additions and 415 deletions
@@ -1,6 +1,7 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/presentation/utils/responsive_utils.dart';
import 'package:core/presentation/views/responsive/responsive_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@@ -27,60 +28,62 @@ class BackgroundWidgetBuilder extends StatelessWidget {
key: const Key('background_widget'),
child: SizedBox(
width: maxWidth ?? 360,
child: CustomScrollView(
slivers: [
SliverFillRemaining(
child: Container(
color: Colors.transparent,
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (iconSVG != null)
SvgPicture.asset(
iconSVG!,
width: responsiveUtils.isLandscapeMobile(context)
? 120
: 212,
height: responsiveUtils.isLandscapeMobile(context)
? 120
: 212,
fit: BoxFit.fill
),
Padding(
padding: EdgeInsets.only(top: iconSVG != null ? 12 : 0),
child: Text(
title,
style: const TextStyle(
color: Colors.black,
fontSize: 20,
fontWeight: FontWeight.normal
),
textAlign: TextAlign.center,
),
),
if (subTitle != null)
Padding(
padding: const EdgeInsets.only(top: 12),
child: Text(
subTitle!,
style: const TextStyle(
color: AppColor.colorSubtitle,
fontSize: 15,
fontWeight: FontWeight.normal
),
textAlign: TextAlign.center,
),
)
],
),
height: MediaQuery.of(context).size.height,
),
)
]
child: ResponsiveWidget(
mobile: CustomScrollView(slivers: [
SliverFillRemaining(child: _buildMessageBody(context))
]),
landscapeMobile: SingleChildScrollView(child: _buildMessageBody(context)),
responsiveUtils: responsiveUtils,
),
)
);
}
Widget _buildMessageBody(BuildContext context) {
return Container(
color: Colors.transparent,
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Column(
mainAxisAlignment: responsiveUtils.isLandscapeMobile(context)
? MainAxisAlignment.start
: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (iconSVG != null)
SvgPicture.asset(
iconSVG!,
width: 212,
height: 212,
fit: BoxFit.fill
),
Padding(
padding: EdgeInsets.only(top: iconSVG != null ? 12 : 0),
child: Text(
title,
style: const TextStyle(
color: Colors.black,
fontSize: 20,
fontWeight: FontWeight.normal
),
textAlign: TextAlign.center,
),
),
if (subTitle != null)
Padding(
padding: const EdgeInsets.only(top: 12),
child: Text(
subTitle!,
style: const TextStyle(
color: AppColor.colorSubtitle,
fontSize: 15,
fontWeight: FontWeight.normal
),
textAlign: TextAlign.center,
),
)
],
),
height: MediaQuery.of(context).size.height,
);
}
}