Skip to content

Commit

Permalink
Improvement: Optimization of Drawer's header (#345)
Browse files Browse the repository at this point in the history
Changed the height of the drawer's header(made it responsive)
Changed the font sizes,
Added a divider to make it more visually appealing
  • Loading branch information
shrey258 authored Jan 21, 2024
1 parent 98c0acd commit e9783d7
Showing 1 changed file with 64 additions and 57 deletions.
121 changes: 64 additions & 57 deletions lib/app/modules/home/views/home_view.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// ignore_for_file: lines_longer_than_80_chars

import 'package:flutter/material.dart';
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
import 'package:flutter_svg/flutter_svg.dart';

import 'package:get/get.dart';
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
import 'package:ultimate_alarm_clock/app/data/models/alarm_model.dart';
import 'package:ultimate_alarm_clock/app/data/providers/firestore_provider.dart';
import 'package:ultimate_alarm_clock/app/data/providers/isar_provider.dart';
import 'package:ultimate_alarm_clock/app/modules/about/controller/about_controller.dart';
import 'package:ultimate_alarm_clock/app/modules/home/views/toggle_button.dart';
import 'package:ultimate_alarm_clock/app/modules/settings/controllers/settings_controller.dart';
import 'package:ultimate_alarm_clock/app/modules/settings/controllers/theme_controller.dart';
Expand All @@ -17,7 +15,6 @@ import 'package:ultimate_alarm_clock/app/utils/audio_utils.dart';
import 'package:ultimate_alarm_clock/app/utils/constants.dart';
import 'package:ultimate_alarm_clock/app/utils/utils.dart';

import '../../settings/views/language_menu.dart';
import '../controllers/home_controller.dart';

class HomeView extends GetView<HomeController> {
Expand Down Expand Up @@ -308,62 +305,67 @@ class HomeView extends GetView<HomeController> {
: ksecondaryBackgroundColor,
child: Column(
children: [
DrawerHeader(
decoration: const BoxDecoration(color: kLightSecondaryColor),
child: Center(
child: Row(
children: [
const Flexible(
flex: 1,
child: CircleAvatar(
radius: 30,
backgroundImage: AssetImage(
'assets/images/ic_launcher-playstore.png',
SizedBox(
height: height * 0.2,
child: DrawerHeader(
decoration: const BoxDecoration(color: kLightSecondaryColor),
child: Center(
child: Row(
children: [
const Flexible(
flex: 1,
child: CircleAvatar(
radius: 30,
backgroundImage: AssetImage(
'assets/images/ic_launcher-playstore.png',
),
),
),
),
const SizedBox(
width: 10,
),
Flexible(
flex: 3,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: width * 0.5,
child: Text(
'Ultimate Alarm Clock'.tr,
softWrap: true,
style: Theme.of(context)
.textTheme
.displayMedium!
.copyWith(
color: themeController.isLightMode.value
? kprimaryTextColor
: ksecondaryTextColor,
fontWeight: FontWeight.bold),
const SizedBox(
width: 10,
),
Flexible(
flex: 3,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: width * 0.5,
child: Text(
'Ultimate Alarm Clock'.tr,
softWrap: true,
style: Theme.of(context)
.textTheme
.displaySmall!
.copyWith(
color:
themeController.isLightMode.value
? kprimaryTextColor
: ksecondaryTextColor,
fontWeight: FontWeight.bold),
),
),
),
SizedBox(
width: width * 0.5,
child: Text(
'v0.5.0'.tr,
softWrap: true,
style: Theme.of(context)
.textTheme
.titleLarge!
.copyWith(
color: themeController.isLightMode.value
? kprimaryTextColor
: ksecondaryTextColor,
fontWeight: FontWeight.bold),
SizedBox(
width: width * 0.5,
child: Text(
'v0.5.0'.tr,
softWrap: true,
style: Theme.of(context)
.textTheme
.titleMedium!
.copyWith(
color:
themeController.isLightMode.value
? kprimaryTextColor
: ksecondaryTextColor,
fontWeight: FontWeight.bold),
),
),
),
],
],
),
),
),
],
],
),
),
),
),
Expand All @@ -376,7 +378,7 @@ class HomeView extends GetView<HomeController> {
contentPadding: const EdgeInsets.only(left: 20, right: 44),
title: Text(
'Settings'.tr,
style: Theme.of(context).textTheme.titleLarge!.copyWith(
style: Theme.of(context).textTheme.titleMedium!.copyWith(
color: themeController.isLightMode.value
? kLightPrimaryTextColor.withOpacity(0.8)
: kprimaryTextColor.withOpacity(0.8),
Expand All @@ -391,6 +393,11 @@ class HomeView extends GetView<HomeController> {
),
),
// LanguageMenu(),
Divider(
color: Colors.white,
indent: width * 0.01,
endIndent: width * 0.01,
),
ListTile(
onTap: () {
Utils.hapticFeedback();
Expand All @@ -400,7 +407,7 @@ class HomeView extends GetView<HomeController> {
contentPadding: const EdgeInsets.only(left: 20, right: 44),
title: Text(
'About'.tr,
style: Theme.of(context).textTheme.titleLarge!.copyWith(
style: Theme.of(context).textTheme.titleMedium!.copyWith(
color: themeController.isLightMode.value
? kLightPrimaryTextColor.withOpacity(0.8)
: kprimaryTextColor.withOpacity(0.8)),
Expand Down

0 comments on commit e9783d7

Please sign in to comment.