Skip to content

Commit

Permalink
Lsucessfully added location permission ❇️
Browse files Browse the repository at this point in the history
  • Loading branch information
olawills committed Oct 8, 2023
1 parent 5d2ba49 commit 6c3200d
Show file tree
Hide file tree
Showing 45 changed files with 445 additions and 283 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
# /lib/services/utils/api.dart
/lib/app/core/services/api_tokens.dart
/lib/firebase_options.dart
5 changes: 3 additions & 2 deletions lib/app/common/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
export '../common/constants/app_constant.dart';
export '../common/constants/app_style.dart';
export '../common/constants/border_radius.dart';
export '../common/constants/color_style.dart';
export 'constants/app_colors.dart';
export '../common/constants/app_sizes.dart';
// ** Extensions Export

export '../common/extensions/app_extension.dart';
Expand All @@ -14,7 +15,7 @@ export '../common/widgets/custom_btn.dart';
export '../common/widgets/custom_txt_field.dart';
export '../common/widgets/display_pic_widget.dart';
export '../common/widgets/loading_page.dart';
export 'widgets/toast_messages.dart';
export 'utils/toast_messages.dart';
export '../common/widgets/onscreen_keyboard.dart';
export '../common/widgets/reusable_text.dart';
export '../common/widgets/spacer.dart';
Expand Down
19 changes: 19 additions & 0 deletions lib/app/common/constants/app_colors.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';

class AppColors {
static final AppColors _instance = AppColors._internal();

factory AppColors() => _instance;

AppColors._internal();

static const darkRed = Color(0xFFA42823);
static const blackColor = Color(0xFF000000);
static const whiteColor = Color(0xFFFFFFFF);
static final blackWithOpacity = const Color(0xFF000000).withOpacity(0.9);
static const darkGreyColor = Color(0xFF7F7777);
static const brightRedColor = Color(0XFFEF0606);
static const colorGrey = Color(0XFF6A6464);
static final redWithLowOpacity = const Color(0XFFffb6b6).withOpacity(0.4);
static const keyboardColor = Color(0xFF898A8D);
}
46 changes: 46 additions & 0 deletions lib/app/common/constants/app_sizes.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import 'package:flutter_screenutil/flutter_screenutil.dart';

class SizeOf {
SizeOf._internal();

static double carouselWidth = 264.sp;
static double carouselHeight = 254.sp;
static double carouselBodyHeight = 54.sp;
static double carouselBodyWidth = 262.sp;
static double similarTasteWidth = 258.sp;
static double similarTasteHeight = 225.sp;

static double p2 = 2.sp;
static double p4 = 4.sp;

static double p6 = 6.sp;

static double p8 = 8.sp;

static double p10 = 10.sp;

static double p12 = 12.sp;

static double p14 = 14.sp;

static double p16 = 16.sp;

static double p18 = 18.sp;

static double p20 = 20.sp;

static double p22 = 22.sp;

static double p24 = 24.sp;
static double p26 = 26.sp;
static double p28 = 28.sp;

static double p30 = 30.sp;

static double p32 = 32.sp;

static double p34 = 34.sp;
static double p36 = 36.sp;
static double p38 = 38.sp;
static double p40 = 40.sp;
}
40 changes: 40 additions & 0 deletions lib/app/common/constants/app_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,50 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart';

import 'app_colors.dart';

TextStyle appMStyle(double size, Color color, FontWeight fw) {
return GoogleFonts.poppins(fontSize: size.sp, color: color, fontWeight: fw);
}

TextStyle appBStyle(double size, Color color, FontWeight fw) {
return GoogleFonts.inter(fontSize: size.sp, color: color, fontWeight: fw);
}

class AppTextStyle {
static final AppTextStyle _instance = AppTextStyle._();

factory AppTextStyle() => _instance;
AppTextStyle._();

static TextStyle titleSmall = GoogleFonts.poppins(
fontSize: 16.sp,
fontWeight: FontWeight.w500,
);
static TextStyle titleMedium = GoogleFonts.poppins(
fontSize: 20.sp,
fontWeight: FontWeight.w400,
color: AppColors.blackColor,
);
static TextStyle titleLarge = GoogleFonts.poppins(
fontSize: 23.sp,
fontWeight: FontWeight.w700,
color: AppColors.blackColor,
);
static TextStyle bodyMedium = GoogleFonts.poppins(
fontSize: 17.sp,
fontWeight: FontWeight.w500,
color: AppColors.blackColor,
);

static TextStyle bodySmall = GoogleFonts.poppins(
fontSize: 16.sp,
fontWeight: FontWeight.w600,
color: AppColors.blackColor,
);
static TextStyle bodyLarge = GoogleFonts.poppins(
fontSize: 18.sp,
fontWeight: FontWeight.w500,
color: AppColors.blackColor,
);
}
11 changes: 0 additions & 11 deletions lib/app/common/constants/color_style.dart

This file was deleted.

7 changes: 7 additions & 0 deletions lib/app/common/extensions/app_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ extension FormValidators on String {
}
}

extension BuildOnContext on BuildContext {
TextTheme get textTheme => Theme.of(this).textTheme;

double get sizeWidth => MediaQuery.of(this).size.width;
double get sizeHeight => MediaQuery.of(this).size.height;
}

// extension WidgetAnimation on Widget {
// Animate fadeInFromTop({
// Duration? delay,
Expand Down
15 changes: 15 additions & 0 deletions lib/app/common/utils/dialogs.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:dating_app/app/common/constants/app_colors.dart';
import 'package:flutter/material.dart';

abstract class ShowDialog {
ShowDialog._();

Future<T?> showDialog<T>({
required BuildContext context,
required Widget Function(BuildContext) builder,
bool barrierDismmissible = true,
Color? barrierColor = AppColors.darkRed,
String? barrierLabel,
TraversalEdgeBehavior? traversalEdgeBehavior,
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ToastMessages {
Fluttertoast.showToast(
msg: NetworkExceptions.getErrorMessage(error),
fontSize: 16,
backgroundColor: Color(kDarkRed.value),
backgroundColor: Color(AppColors.darkRed.value),
toastLength: Toast.LENGTH_LONG,
gravity: ToastGravity.BOTTOM);
}
Expand All @@ -23,15 +23,15 @@ class ToastMessages {
return Fluttertoast.showToast(
msg: message,
gravity: ToastGravity.BOTTOM,
backgroundColor: Color(kDarkRed.value),
backgroundColor: Color(AppColors.darkRed.value),
);
}

showToastErrorMessage(String message) {
return Fluttertoast.showToast(
msg: message,
gravity: ToastGravity.BOTTOM,
backgroundColor: Color(kDarkRed.value),
backgroundColor: Color(AppColors.darkRed.value),
);
}
}
12 changes: 7 additions & 5 deletions lib/app/common/widgets/custom_btn.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ class CustomButton extends StatelessWidget {
height: height,
alignment: Alignment.center,
decoration: BoxDecoration(
color: isLoading ? loadingColor ?? Color(kDarkGrey.value) : color,
color: isLoading ? loadingColor ?? AppColors.colorGrey : color,
borderRadius: resize ? klargeBorderRadius : kmediumBorderRadius,
),
child: resize
? Icon(icon, size: 23.sp, color: Color(kLight.value))
? Icon(icon, size: 23.sp, color: AppColors.whiteColor)
: const Center().reusableText(
text ?? '',
style: appMStyle(
Expand Down Expand Up @@ -83,16 +83,18 @@ class CustomElevatedButton extends StatelessWidget {
onPressed: onPressed,
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
side: const BorderSide(width: 1.5, color: kGrey),
side: const BorderSide(width: 1.5, color: AppColors.colorGrey),
borderRadius: BorderRadius.all(Radius.circular(radius ?? 10.r)),
),
padding: EdgeInsets.zero,
backgroundColor: kDarkRed,
backgroundColor: AppColors.darkRed,
),
child: Center(
child: ReusableText(
text: text,
style: appMStyle(16, kLight, FontWeight.w500),
// style: appMStyle(16, AppColors.whiteColor, FontWeight.w500),
style: context.textTheme.bodyMedium!
.copyWith(fontWeight: FontWeight.w500),
),
),
),
Expand Down
35 changes: 15 additions & 20 deletions lib/app/common/widgets/custom_txt_field.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import 'package:dating_app/app/common/constants/app_style.dart';
import 'package:dating_app/app/common/constants/border_radius.dart';
import 'package:dating_app/app/common/constants/color_style.dart';
import 'package:dating_app/app/common/widgets/reusable_text.dart';
import 'package:dating_app/app/common/common.dart';

import '../../core/core.dart';

Expand Down Expand Up @@ -58,22 +55,24 @@ class _CustomTxtFieldState extends State<CustomTxtField> {
Widget build(BuildContext context) {
final inputBorder = OutlineInputBorder(
borderRadius: knormalBorderRadius,
borderSide: BorderSide(color: Color(kDarkGrey.value), width: 1.5),
borderSide: const BorderSide(color: AppColors.darkGreyColor, width: 1.5),
);
final errorBorder = OutlineInputBorder(
borderRadius: kminiMediumBorderRadius,
borderSide: BorderSide(color: Color(kDarkRed.value), width: 1.5),
borderSide: const BorderSide(color: AppColors.darkRed, width: 1.5),
);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ReusableText(
text: widget.labelText ?? '',
style: appMStyle(
17,
Color(kDark.value),
FontWeight.w500,
),
// style: appMStyle(
// 17,
// Color(kDark.value),
// FontWeight.w500,
// ),
style: context.textTheme.bodyLarge!
.copyWith(fontWeight: FontWeight.w600),
),
TextFormField(
controller: widget.textEditingController,
Expand All @@ -88,11 +87,7 @@ class _CustomTxtFieldState extends State<CustomTxtField> {
onTapOutside: (event) {
FocusScope.of(context).unfocus();
},
style: appMStyle(
17,
Color(kDark.value),
FontWeight.w500,
),
style: context.textTheme.bodyLarge!.copyWith(),
validator: widget.validator,
decoration: InputDecoration(
filled: widget.filled,
Expand All @@ -109,14 +104,14 @@ class _CustomTxtFieldState extends State<CustomTxtField> {
? Icons.visibility_outlined
: Icons.visibility_off_outlined,
color: passwordvisibility
? Color(kDarkRed.value)
: Color(kDarkGrey.value),
? AppColors.darkRed
: AppColors.darkGreyColor,
size: 18,
),
)
: null,
hintStyle: widget.hintStyle ??
appMStyle(17, Color(kDark.value), FontWeight.w400),
appMStyle(17, AppColors.blackColor, FontWeight.w400),
disabledBorder: inputBorder,
enabledBorder: widget.inputBorder ?? inputBorder,
focusedErrorBorder: errorBorder,
Expand All @@ -127,7 +122,7 @@ class _CustomTxtFieldState extends State<CustomTxtField> {
ReusableText(
text:
widget.isValidationMessage ? widget.validationMessage ?? '' : '',
style: appMStyle(17, Color(kBrightRed.value), FontWeight.w500),
style: appMStyle(17, AppColors.brightRedColor, FontWeight.w500),
)
],
);
Expand Down
4 changes: 2 additions & 2 deletions lib/app/common/widgets/display_pic_widget.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:dating_app/app/common/constants/color_style.dart';
import 'package:dating_app/app/common/constants/app_colors.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../../core/core.dart';
Expand All @@ -22,7 +22,7 @@ class UserDisplayPicture extends StatelessWidget {
onTap: onTap,
child: CircleAvatar(
radius: isLargeDp ? 80.r : 20.r,
backgroundColor: Color(kDarkRed.value),
backgroundColor: AppColors.darkRed,
child: CircleAvatar(
radius: isLargeDp ? 76.r : 18.r,
backgroundImage: AssetImage(imageUrl),
Expand Down
4 changes: 2 additions & 2 deletions lib/app/common/widgets/loading_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:dating_app/app/common/constants/color_style.dart';
import 'package:dating_app/app/common/constants/app_colors.dart';

import '../../core/core.dart';

Expand All @@ -7,6 +7,6 @@ class LoadingPage extends StatelessWidget {

@override
Widget build(BuildContext context) => Container(
color: Color(kDarkGrey.value).withOpacity(0.15),
color: AppColors.darkGreyColor.withOpacity(0.15),
);
}
4 changes: 2 additions & 2 deletions lib/app/common/widgets/no_internet_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class NoInternetConnectionWidget extends StatelessWidget {
10.sbh,
ReusableText(
text: AppString.connectionMessage,
style: appMStyle(24, kDarkWithOp, FontWeight.bold),
style: appMStyle(24, AppColors.blackWithOpacity, FontWeight.bold),
),
15.sbh,
ReusableText(
text: AppString.socketException,
style: appMStyle(16, kDarkWithOp, FontWeight.w400),
style: appMStyle(16, AppColors.blackWithOpacity, FontWeight.w400),
),
20.sbh,
CustomElevatedButton(
Expand Down
Loading

0 comments on commit 6c3200d

Please sign in to comment.