first commit
This commit is contained in:
3
lib/app/core/constants/api_constant.dart
Normal file
3
lib/app/core/constants/api_constant.dart
Normal file
@@ -0,0 +1,3 @@
|
||||
class ApiConstant {
|
||||
static const String contentTypeJson = 'application/json';
|
||||
}
|
||||
42
lib/app/core/constants/app_colors.dart
Normal file
42
lib/app/core/constants/app_colors.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
|
||||
class AppColors {
|
||||
// PRIMARY
|
||||
static Color primary900 = Colors.black;
|
||||
static Color primary700 = Colors.black87;
|
||||
static Color primary500 = Colors.black54;
|
||||
static Color primary300 = Colors.black38;
|
||||
|
||||
// ACCENT
|
||||
static Color accentRed600 = HexColor('#E10600');
|
||||
static Color accentRed500 = HexColor('#FF3B30');
|
||||
static Color accentPink = HexColor('#FF2D55');
|
||||
static Color accentGreen = HexColor('#34C759');
|
||||
|
||||
// STATUS
|
||||
static Color statusSuccess = HexColor('#28A745');
|
||||
static Color statusWarning = HexColor('#FFC107');
|
||||
static Color statusDanger = HexColor('#DC3545');
|
||||
|
||||
// NEUTRAL
|
||||
static Color neutral50 = HexColor('#FAFAFA');
|
||||
static Color neutral100 = HexColor('#F2F2F2');
|
||||
static Color neutral200 = HexColor('#E0E0E0');
|
||||
static Color neutral400 = HexColor('#BDBDBD');
|
||||
static Color neutral500 = HexColor('#8C8C8C');
|
||||
static Color neutral600 = HexColor('#757575');
|
||||
static Color neutral700 = Colors.grey.shade700;
|
||||
static Color neutral900 = HexColor('#212121');
|
||||
static Color neutralBlack = HexColor('#000000');
|
||||
static Color neutralWhite = HexColor('#FFFFFF');
|
||||
|
||||
// SUPPORT
|
||||
static Color supportSteel600 = HexColor('#2D3E50');
|
||||
static Color supportSteel300 = HexColor('#8FA3BF');
|
||||
|
||||
// SHIMMER/LOADING
|
||||
static Color shimmerBackgroundColor = HexColor('#292729');
|
||||
static Color shimmerBaseColor = HexColor('#292729');
|
||||
static Color shimmerHighColor = HexColor('#363436');
|
||||
}
|
||||
10
lib/app/core/constants/app_durations.dart
Normal file
10
lib/app/core/constants/app_durations.dart
Normal file
@@ -0,0 +1,10 @@
|
||||
class AppDurations {
|
||||
AppDurations._();
|
||||
|
||||
static const fast = Duration(milliseconds: 150);
|
||||
static const normal = Duration(milliseconds: 250);
|
||||
static const slow = Duration(milliseconds: 400);
|
||||
|
||||
static const pageTransition = Duration(milliseconds: 300);
|
||||
static const modalTransition = Duration(milliseconds: 250);
|
||||
}
|
||||
10
lib/app/core/constants/app_icon_sizes.dart
Normal file
10
lib/app/core/constants/app_icon_sizes.dart
Normal file
@@ -0,0 +1,10 @@
|
||||
class AppIconSizes {
|
||||
AppIconSizes._();
|
||||
|
||||
static const double xs = 14;
|
||||
static const double sm = 16;
|
||||
static const double md = 20;
|
||||
static const double lg = 24;
|
||||
static const double xl = 28;
|
||||
static const double xxl = 32;
|
||||
}
|
||||
12
lib/app/core/constants/app_opacity.dart
Normal file
12
lib/app/core/constants/app_opacity.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
class AppOpacity {
|
||||
AppOpacity._();
|
||||
|
||||
static const double disabled = 0.4;
|
||||
static const double muted = 0.6;
|
||||
static const double subtle = 0.8;
|
||||
|
||||
static const double overlayLight = 0.05;
|
||||
static const double opacity15 = 0.15;
|
||||
static const double overlay = 0.1;
|
||||
static const double overlayStrong = 0.2;
|
||||
}
|
||||
60
lib/app/core/constants/app_padding.dart
Normal file
60
lib/app/core/constants/app_padding.dart
Normal file
@@ -0,0 +1,60 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class AppPadding {
|
||||
AppPadding._();
|
||||
|
||||
static const EdgeInsets p0 = EdgeInsets.zero;
|
||||
static const EdgeInsets p2 = EdgeInsets.all(2);
|
||||
static const EdgeInsets p4 = EdgeInsets.all(4);
|
||||
static const EdgeInsets p6 = EdgeInsets.all(6);
|
||||
static const EdgeInsets p8 = EdgeInsets.all(8);
|
||||
static const EdgeInsets p10 = EdgeInsets.all(10);
|
||||
static const EdgeInsets p12 = EdgeInsets.all(12);
|
||||
static const EdgeInsets p14 = EdgeInsets.all(14);
|
||||
static const EdgeInsets p16 = EdgeInsets.all(16);
|
||||
static const EdgeInsets p24 = EdgeInsets.all(24);
|
||||
|
||||
static const EdgeInsets h4 = EdgeInsets.symmetric(horizontal: 4);
|
||||
static const EdgeInsets h8 = EdgeInsets.symmetric(horizontal: 8);
|
||||
static const EdgeInsets h10 = EdgeInsets.symmetric(horizontal: 10);
|
||||
static const EdgeInsets h12 = EdgeInsets.symmetric(horizontal: 12);
|
||||
static const EdgeInsets h14 = EdgeInsets.symmetric(horizontal: 14);
|
||||
static const EdgeInsets h16 = EdgeInsets.symmetric(horizontal: 16);
|
||||
static const EdgeInsets h18 = EdgeInsets.symmetric(horizontal: 18);
|
||||
static const EdgeInsets h24 = EdgeInsets.symmetric(
|
||||
horizontal: 24,
|
||||
);
|
||||
|
||||
static const EdgeInsets v2 = EdgeInsets.symmetric(vertical: 2);
|
||||
static const EdgeInsets v4 = EdgeInsets.symmetric(vertical: 4);
|
||||
static const EdgeInsets v6 = EdgeInsets.symmetric(vertical: 6);
|
||||
static const EdgeInsets v8 = EdgeInsets.symmetric(vertical: 8);
|
||||
static const EdgeInsets v10 = EdgeInsets.symmetric(vertical: 10);
|
||||
static const EdgeInsets v12 = EdgeInsets.symmetric(vertical: 12);
|
||||
static const EdgeInsets v14 = EdgeInsets.symmetric(vertical: 14);
|
||||
static const EdgeInsets v16 = EdgeInsets.symmetric(vertical: 16);
|
||||
static const EdgeInsets v20 = EdgeInsets.symmetric(vertical: 20);
|
||||
|
||||
static const EdgeInsets t6 = EdgeInsets.only(top: 6);
|
||||
static const EdgeInsets t8 = EdgeInsets.only(top: 8);
|
||||
static const EdgeInsets t12 = EdgeInsets.only(top: 12);
|
||||
static const EdgeInsets t16 = EdgeInsets.only(top: 16);
|
||||
static const EdgeInsets t24 = EdgeInsets.only(top: 24);
|
||||
|
||||
static const EdgeInsets b2 = EdgeInsets.only(bottom: 2);
|
||||
static const EdgeInsets b8 = EdgeInsets.only(bottom: 8);
|
||||
static const EdgeInsets b10 = EdgeInsets.only(bottom: 10);
|
||||
static const EdgeInsets b12 = EdgeInsets.only(bottom: 12);
|
||||
static const EdgeInsets b14 = EdgeInsets.only(bottom: 14);
|
||||
static const EdgeInsets b16 = EdgeInsets.only(bottom: 16);
|
||||
|
||||
static const EdgeInsets l6 = EdgeInsets.only(left: 6);
|
||||
static const EdgeInsets l8 = EdgeInsets.only(left: 8);
|
||||
static const EdgeInsets l12 = EdgeInsets.only(left: 12);
|
||||
static const EdgeInsets l16 = EdgeInsets.only(left: 16);
|
||||
static const EdgeInsets l26 = EdgeInsets.only(left: 26);
|
||||
|
||||
static const EdgeInsets r8 = EdgeInsets.only(right: 8);
|
||||
static const EdgeInsets r12 = EdgeInsets.only(right: 12);
|
||||
static const EdgeInsets r16 = EdgeInsets.only(right: 16);
|
||||
}
|
||||
13
lib/app/core/constants/app_radius.dart
Normal file
13
lib/app/core/constants/app_radius.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class AppRadius {
|
||||
AppRadius._();
|
||||
|
||||
static BorderRadius r6 = BorderRadius.circular(6);
|
||||
static BorderRadius r10 = BorderRadius.circular(10);
|
||||
static BorderRadius r8 = BorderRadius.circular(8);
|
||||
static BorderRadius r14 = BorderRadius.circular(14);
|
||||
static BorderRadius r18 = BorderRadius.circular(18);
|
||||
static BorderRadius r24 = BorderRadius.circular(24);
|
||||
static BorderRadius rFull = BorderRadius.circular(999);
|
||||
}
|
||||
36
lib/app/core/constants/app_shadows.dart
Normal file
36
lib/app/core/constants/app_shadows.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppShadows {
|
||||
AppShadows._();
|
||||
|
||||
static List<BoxShadow> xs = [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.07),
|
||||
blurRadius: 2,
|
||||
),
|
||||
];
|
||||
|
||||
static List<BoxShadow> sm = [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
blurRadius: 4,
|
||||
offset: const Offset(0, 1),
|
||||
),
|
||||
];
|
||||
|
||||
static List<BoxShadow> md = [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.15),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
];
|
||||
|
||||
static List<BoxShadow> lg = [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.2),
|
||||
blurRadius: 16,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
];
|
||||
}
|
||||
45
lib/app/core/constants/app_sizes.dart
Normal file
45
lib/app/core/constants/app_sizes.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
class AppSizes {
|
||||
AppSizes._();
|
||||
|
||||
static const double maxContentWidth = 600;
|
||||
|
||||
static const double bottomSheetHandleWidth = 40;
|
||||
static const double bottomSheetHandleHeight = 6;
|
||||
|
||||
static const double avatarSm = 32;
|
||||
static const double avatarMd = 40;
|
||||
static const double avatarLg = 64;
|
||||
|
||||
static const double iconContainerSm = 32;
|
||||
static const double iconContainerMd = 40;
|
||||
static const double iconContainerLg = 48;
|
||||
|
||||
static const double progressHeight = 4;
|
||||
|
||||
static const double buttonHeight = 44;
|
||||
static const double inputHeight = 48;
|
||||
|
||||
static const double illustrationWidthFactor = 0.6;
|
||||
|
||||
static const double s2 = 2;
|
||||
static const double s4 = 4;
|
||||
static const double s6 = 6;
|
||||
static const double s8 = 8;
|
||||
static const double s10 = 10;
|
||||
static const double s12 = 12;
|
||||
static const double s16 = 16;
|
||||
static const double s24 = 24;
|
||||
static const double s32 = 32;
|
||||
static const double s40 = 40;
|
||||
static const double s48 = 48;
|
||||
static const double s56 = 56;
|
||||
static const double s64 = 64;
|
||||
static const double s72 = 72;
|
||||
static const double s80 = 80;
|
||||
static const double s88 = 88;
|
||||
static const double s96 = 96;
|
||||
static const double s104 = 104;
|
||||
static const double s112 = 112;
|
||||
static const double s120 = 120;
|
||||
static const double s128 = 128;
|
||||
}
|
||||
28
lib/app/core/constants/app_spacing.dart
Normal file
28
lib/app/core/constants/app_spacing.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class AppSpacing {
|
||||
AppSpacing._();
|
||||
static const SizedBox h2 = SizedBox(height: 2);
|
||||
static const SizedBox h4 = SizedBox(height: 4);
|
||||
static const SizedBox h6 = SizedBox(height: 6);
|
||||
static const SizedBox h8 = SizedBox(height: 8);
|
||||
static const SizedBox h12 = SizedBox(height: 12);
|
||||
static const SizedBox h16 = SizedBox(height: 16);
|
||||
static const SizedBox h20 = SizedBox(height: 20);
|
||||
static const SizedBox h24 = SizedBox(height: 24);
|
||||
static const SizedBox h32 = SizedBox(height: 32);
|
||||
static const SizedBox h36 = SizedBox(height: 36);
|
||||
static const SizedBox h40 = SizedBox(height: 40);
|
||||
static const SizedBox h48 = SizedBox(height: 48);
|
||||
static const SizedBox h64 = SizedBox(height: 64);
|
||||
|
||||
static const SizedBox w4 = SizedBox(width: 4);
|
||||
static const SizedBox w6 = SizedBox(width: 6);
|
||||
static const SizedBox w8 = SizedBox(width: 8);
|
||||
static const SizedBox w10 = SizedBox(width: 10);
|
||||
static const SizedBox w12 = SizedBox(width: 12);
|
||||
static const SizedBox w14 = SizedBox(width: 14);
|
||||
static const SizedBox w16 = SizedBox(width: 16);
|
||||
static const SizedBox w24 = SizedBox(width: 24);
|
||||
static const SizedBox w32 = SizedBox(width: 32);
|
||||
}
|
||||
90
lib/app/core/constants/app_text_styles.dart
Normal file
90
lib/app/core/constants/app_text_styles.dart
Normal file
@@ -0,0 +1,90 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:frontend_eccp_mobile/app/core/constants/app_colors.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class AppTextStyles {
|
||||
AppTextStyles._();
|
||||
|
||||
static final String fontFamily = GoogleFonts.inter().fontFamily!;
|
||||
|
||||
static TextStyle hAnalytics = GoogleFonts.inter(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.neutral900,
|
||||
);
|
||||
static TextStyle h1 = GoogleFonts.inter(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.neutral900,
|
||||
);
|
||||
|
||||
static TextStyle h2 = GoogleFonts.inter(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.neutral900,
|
||||
);
|
||||
static TextStyle h2Light = GoogleFonts.inter(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColors.neutral900,
|
||||
);
|
||||
|
||||
static TextStyle h3 = GoogleFonts.inter(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.neutral900,
|
||||
);
|
||||
static TextStyle h4 = GoogleFonts.inter(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.neutral900,
|
||||
);
|
||||
|
||||
static TextStyle section = GoogleFonts.inter(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.neutral400,
|
||||
);
|
||||
|
||||
static TextStyle label = GoogleFonts.inter(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.neutral900,
|
||||
);
|
||||
|
||||
static TextStyle body = GoogleFonts.inter(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColors.neutral900,
|
||||
);
|
||||
|
||||
static TextStyle small = GoogleFonts.inter(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColors.neutral600,
|
||||
);
|
||||
|
||||
static TextStyle xs = GoogleFonts.inter(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColors.neutral400,
|
||||
);
|
||||
|
||||
static TextStyle badge = GoogleFonts.inter(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.primary700,
|
||||
);
|
||||
|
||||
static TextStyle button = GoogleFonts.inter(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white,
|
||||
);
|
||||
|
||||
static TextStyle value = GoogleFonts.inter(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.neutral900,
|
||||
);
|
||||
}
|
||||
13
lib/app/core/constants/constants.dart
Normal file
13
lib/app/core/constants/constants.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
export 'api_constant.dart';
|
||||
export 'app_colors.dart';
|
||||
export 'app_durations.dart';
|
||||
export 'app_icon_sizes.dart';
|
||||
export 'app_opacity.dart';
|
||||
export 'app_padding.dart';
|
||||
export 'app_radius.dart';
|
||||
export 'app_shadows.dart';
|
||||
export 'app_sizes.dart';
|
||||
export 'app_spacing.dart';
|
||||
export 'app_text_styles.dart';
|
||||
export 'dio_constant.dart';
|
||||
export 'globalkey.dart';
|
||||
3
lib/app/core/constants/dio_constant.dart
Normal file
3
lib/app/core/constants/dio_constant.dart
Normal file
@@ -0,0 +1,3 @@
|
||||
class DioExtraKey {
|
||||
static const String noAuth = 'noAuth';
|
||||
}
|
||||
5
lib/app/core/constants/enum/app_flavor_enum.dart
Normal file
5
lib/app/core/constants/enum/app_flavor_enum.dart
Normal file
@@ -0,0 +1,5 @@
|
||||
enum AppFlavor {
|
||||
development,
|
||||
staging,
|
||||
production,
|
||||
}
|
||||
1
lib/app/core/constants/enum/appbar_type_enum.dart
Normal file
1
lib/app/core/constants/enum/appbar_type_enum.dart
Normal file
@@ -0,0 +1 @@
|
||||
enum AppButtonType { primary, secondary }
|
||||
1
lib/app/core/constants/enum/location_status_enum.dart
Normal file
1
lib/app/core/constants/enum/location_status_enum.dart
Normal file
@@ -0,0 +1 @@
|
||||
enum SimpleLocationStatus { granted, denied, deniedForever, serviceDisabled }
|
||||
9
lib/app/core/constants/enum/network_error_code_enum.dart
Normal file
9
lib/app/core/constants/enum/network_error_code_enum.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
enum NetworkErrorCode {
|
||||
unauthorized,
|
||||
noInternet,
|
||||
serverError,
|
||||
requestCancelled,
|
||||
badCertificate,
|
||||
unknown,
|
||||
notFound,
|
||||
}
|
||||
30
lib/app/core/constants/enum/network_error_message_enum.dart
Normal file
30
lib/app/core/constants/enum/network_error_message_enum.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
enum NetworkErrorMessage {
|
||||
unauthorized,
|
||||
noInternet,
|
||||
serverError,
|
||||
requestCancelled,
|
||||
badCertificate,
|
||||
unknown,
|
||||
notFound,
|
||||
}
|
||||
|
||||
extension NetworkErrorMessageExt on NetworkErrorMessage {
|
||||
String get value {
|
||||
switch (this) {
|
||||
case NetworkErrorMessage.unauthorized:
|
||||
return 'Session expired. Please login again.';
|
||||
case NetworkErrorMessage.noInternet:
|
||||
return 'No internet connection.';
|
||||
case NetworkErrorMessage.serverError:
|
||||
return 'Server error occurred.';
|
||||
case NetworkErrorMessage.requestCancelled:
|
||||
return 'Request cancelled.';
|
||||
case NetworkErrorMessage.badCertificate:
|
||||
return 'Invalid certificate.';
|
||||
case NetworkErrorMessage.unknown:
|
||||
return 'Something went wrong.';
|
||||
case NetworkErrorMessage.notFound:
|
||||
return 'Oops,terjadi kesalahan tidak terduga. (404)';
|
||||
}
|
||||
}
|
||||
}
|
||||
1
lib/app/core/constants/enum/snackbar_type_enum.dart
Normal file
1
lib/app/core/constants/enum/snackbar_type_enum.dart
Normal file
@@ -0,0 +1 @@
|
||||
enum SnackBarType { success, error, warning, info }
|
||||
3
lib/app/core/constants/globalkey.dart
Normal file
3
lib/app/core/constants/globalkey.dart
Normal file
@@ -0,0 +1,3 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||
Reference in New Issue
Block a user