Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dry/sunset sunrise #149

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update sunset_sunrise.dart
Dry refactored code
Ritam Chakraborty authored Oct 30, 2023
commit b7798d63b8fbb9e62cb019bbe573ffc9e6ee16fc
21 changes: 13 additions & 8 deletions lib/app/widgets/sun_moon/sunset_sunrise.dart
Original file line number Diff line number Diff line change
@@ -21,6 +21,11 @@ class _SunsetSunriseState extends State<SunsetSunrise> {

@override
Widget build(BuildContext context) {
const crossAxisCenterAlignment = CrossAxisAlignment.center;
final textTheme = context.textTheme;
final titleSmall = textTheme.titleSmall;
final titleLarge = textTheme.titleLarge;

return Card(
margin: const EdgeInsets.only(bottom: 15),
child: Padding(
@@ -29,22 +34,22 @@ class _SunsetSunriseState extends State<SunsetSunrise> {
children: [
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: crossAxisCenterAlignment,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: crossAxisCenterAlignment,
children: [
Text(
'sunrise'.tr,
style: context.textTheme.titleSmall,
style: titleSmall,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
const SizedBox(height: 2),
Text(
statusData.getTimeFormat(widget.timeSunrise),
style: context.textTheme.titleLarge,
style: titleLarge,
),
],
),
@@ -61,22 +66,22 @@ class _SunsetSunriseState extends State<SunsetSunrise> {
),
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: crossAxisCenterAlignment,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: crossAxisCenterAlignment,
children: [
Text(
'sunset'.tr,
style: context.textTheme.titleSmall,
style: titleSmall,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
const SizedBox(height: 2),
Text(
statusData.getTimeFormat(widget.timeSunset),
style: context.textTheme.titleLarge,
style: titleLarge,
),
],
),