Skip to content

Commit

Permalink
Fix Minor UI (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sneha-s authored Mar 7, 2024
1 parent 6e3dad3 commit d845ed7
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 23 deletions.
10 changes: 6 additions & 4 deletions lib/data/configs/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ class AppTheme {

static DaysOfWeekStyle daysOfWeekStyle(BuildContext context) =>
DaysOfWeekStyle(
weekdayStyle: AppTextStyle.style16
.copyWith(color: context.colorScheme.textSecondary),
weekendStyle: AppTextStyle.style16
.copyWith(color: context.colorScheme.textDisable),
weekdayStyle: AppTextStyle.style16.copyWith(
color: context.colorScheme.textPrimary,
fontWeight: FontWeight.w600),
weekendStyle: AppTextStyle.style16.copyWith(
color: context.colorScheme.textDisable,
fontWeight: FontWeight.w600),
);

static List<BoxShadow> commonBoxShadow(BuildContext context) => [
Expand Down
17 changes: 10 additions & 7 deletions lib/data/core/extensions/widget_extension.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

extension GestureExtension on Widget {
Widget onTapGesture(VoidCallback onTap) {
return Container(
decoration: BoxDecoration(
return InkWell(
borderRadius: BorderRadius.circular(12),
onTap: onTap,
child: Material(
borderRadius: BorderRadius.circular(12),
),
child: GestureDetector(
onTap: onTap,
child: this,
color: Colors.transparent,
child: Container(
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12)),
child: this),
),
);
}
Expand Down
11 changes: 8 additions & 3 deletions lib/style/app_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:projectunity/data/core/extensions/context_extension.dart';
import 'package:projectunity/style/app_text_style.dart';

class AppPage extends StatelessWidget {
Expand Down Expand Up @@ -36,7 +37,7 @@ class AppPage extends StatelessWidget {
? null
: AppBar(
backgroundColor: backGroundColor,
title: titleWidget ?? _title(),
title: titleWidget ?? _title(context),
actions: actions,
leading: leading,
automaticallyImplyLeading: automaticallyImplyLeading,
Expand All @@ -47,10 +48,14 @@ class AppPage extends StatelessWidget {
);
}

Widget _title() => Text(
Widget _title(BuildContext context) => Text(
title ?? '',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontFamily: AppTextStyle.poppinsFontFamily),
style: TextStyle(
fontFamily: AppTextStyle.poppinsFontFamily,
fontSize: 22,
color: context.colorScheme.textPrimary,
fontWeight: FontWeight.w600),
);
}
6 changes: 6 additions & 0 deletions lib/style/app_text_style.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import 'package:flutter/cupertino.dart';
import 'package:projectunity/data/core/extensions/context_extension.dart';

class AppTextStyle {
static const String poppinsFontFamily = "Poppins";

static TextStyle headerStyle(BuildContext context) => TextStyle(
fontWeight: FontWeight.w600,
fontSize: 22,
color: context.colorScheme.textPrimary);

static const TextStyle style24 =
TextStyle(fontWeight: FontWeight.w600, fontSize: 24);

Expand Down
4 changes: 1 addition & 3 deletions lib/ui/admin/home/home_screen/admin_home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ class _AdminHomeScreenState extends State<AdminHomeScreen> {
builder: (context) {
final String name = SpaceNotifierWidget.of(context)?.name ?? "";
return Text(name,
style: AppTextStyle.style20.copyWith(
color: context.colorScheme.textPrimary,
),
style: AppTextStyle.headerStyle(context),
overflow: TextOverflow.ellipsis);
},
),
Expand Down
3 changes: 1 addition & 2 deletions lib/ui/shared/appbar_drawer/appbar/dashboard_appbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ class DashBoardAppBar extends StatelessWidget implements PreferredSize {
final String name =
SpaceNotifierWidget.of(context)?.name ?? "";
return Text(name,
style: AppTextStyle.style20
.copyWith(color: context.colorScheme.textPrimary),
style: AppTextStyle.headerStyle(context),
overflow: TextOverflow.ellipsis);
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class ProfileForm extends StatelessWidget {
const GenderSelection(),
FieldTitle(title: localization.employee_mobile_tag),
FieldEntry(
keyboardType: TextInputType.phone,
controller: phoneNumberController,
hintText: localization.admin_home_add_member_mobile_number_hint_text,
),
Expand Down
3 changes: 1 addition & 2 deletions lib/ui/user/home/home_screen/user_home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ class _UserHomeScreenState extends State<UserHomeScreen> {
builder: (context) {
final String name = SpaceNotifierWidget.of(context)?.name ?? "";
return Text(name,
style: AppTextStyle.style20
.copyWith(color: context.colorScheme.textPrimary),
style: AppTextStyle.headerStyle(context),
overflow: TextOverflow.ellipsis);
},
),
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/widget/employee_details_textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class FieldEntry extends StatelessWidget {
maxLength: maxLength,
controller: controller,
autocorrect: false,
style: AppTextStyle.style16
.copyWith(color: context.colorScheme.textSecondary),
style:
AppTextStyle.style16.copyWith(color: context.colorScheme.textPrimary),
textAlignVertical: TextAlignVertical.center,
decoration: InputDecoration(
isCollapsed: true,
Expand Down

0 comments on commit d845ed7

Please sign in to comment.