initial commit

This commit is contained in:
2024-02-05 11:18:08 +07:00
parent 5fe37558a8
commit 5ee2b8f1f1
112 changed files with 3581 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
class PathAssets {
PathAssets._();
/// LOGO
static const String iconSplashRight = 'assets/icons/splash-right.png';
static const String iconSplashLeft = 'assets/icons/splash-left.png';
static const String iconReksadana = 'assets/icons/icon-reksadana.png';
static const String iconOjk = 'assets/icons/icon-ojk.png';
static const String iconInklusi = 'assets/icons/icon-inklusi.png';
static const String iconGoogle = 'assets/icons/icon-google.png';
static const String icon1 = 'assets/icons/icon-1.png';
static const String iconConnect = 'assets/icons/icon-connect.png';
/// IMAGE
static const String imgSplashLogo = 'assets/images/splash-logo.png';
static const String imgRegis = 'assets/images/img-registration.png';
static const String imgEmail = 'assets/images/img-email.png';
static const String imgDashboard = 'assets/images/img-dashboard.png';
static const String imgSelfieClear = 'assets/images/img-selfie-clear.png';
static const String imgSelfieBlur = 'assets/images/img-selfie-blur.png';
static const String imgKtpLight = 'assets/images/img-ktp-light.png';
static const String imgKtpCropped = 'assets/images/img-ktp-cropped.png';
static const String imgKtpClear = 'assets/images/img-ktp-clear.png';
static const String imgKtpBlur = 'assets/images/img-ktp-blur.png';
}

View File

@@ -0,0 +1,134 @@
import 'package:cims_apps/application/theme/color_palette.dart';
import 'package:cims_apps/core/utils/size_config.dart';
import 'package:flutter/material.dart';
class ButtonView extends StatelessWidget {
final String name;
final VoidCallback onPressed;
final Widget? prefixIcon, suffixIcon;
final double? height, width, widthSuffix, widthPrefix, marginVertical;
final EdgeInsetsGeometry? contentPadding;
final bool isSecondaryColor, isOutlined, heightWrapContent, disabled;
final Color? backgroundColor, textColor;
final MainAxisAlignment? mainAxisAlignmentContent;
// final _widthBtn = SizeConfig.screenWidth / 1.5;
final _widthBtn = SizeConfig.width * .9;
// final _heightBtn = SizeConfig.screenHeight / 12;
final _heightBtn = SizeConfig.height * .07;
final FontWeight textWeight;
final double? textSize, sizeBorderRadius;
final int? maxLines;
ButtonView(
{super.key,
required this.name,
required this.onPressed,
this.prefixIcon,
this.suffixIcon,
this.widthPrefix,
this.widthSuffix,
this.height,
this.width,
this.contentPadding,
this.backgroundColor,
this.textColor,
this.textWeight = FontWeight.bold,
this.textSize,
this.mainAxisAlignmentContent,
this.disabled = false,
this.heightWrapContent = false,
this.isSecondaryColor = false,
this.isOutlined = false,
this.maxLines = 2,
this.sizeBorderRadius,
this.marginVertical})
: assert(
suffixIcon == null || prefixIcon == null,
"Cannot provide both a suffixIcon and a prefixIcon, select one",
);
@override
Widget build(BuildContext context) {
final color = Theme.of(context).colorScheme;
final widthSuffix =
this.widthSuffix ?? (heightWrapContent ? width! / 4.7 : _widthBtn / 16);
final widthPrefix =
this.widthPrefix ?? (heightWrapContent ? width! / 4.7 : _widthBtn / 16);
return Container(
margin: EdgeInsets.symmetric(vertical: marginVertical ?? 32.0),
width: width ?? _widthBtn,
height: heightWrapContent ? null : height ?? _heightBtn,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
disabledBackgroundColor: isOutlined ? Colors.white : color.surface,
padding: contentPadding,
backgroundColor: backgroundColor ??
(isOutlined
? Colors.white
: isSecondaryColor
? ColorPalette.grey
: ColorPalette.primary),
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(sizeBorderRadius ?? 48),
side: isOutlined
? BorderSide(
color: disabled
? color.surface
: isSecondaryColor
? ColorPalette.greyBorder
: ColorPalette.primary,
)
: BorderSide.none,
),
),
onPressed: disabled ? null : onPressed,
child: Row(
mainAxisAlignment: mainAxisAlignmentContent ??
(prefixIcon != null
? MainAxisAlignment.center
: suffixIcon != null
? MainAxisAlignment.end
: MainAxisAlignment.center),
children: [
if (prefixIcon != null) ...[
prefixIcon!,
SizedBox(width: widthPrefix),
] else
Container(),
Flexible(
child: Text(
name,
textAlign: TextAlign.center,
maxLines: maxLines,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: textSize ?? 16,
fontWeight: textWeight,
color: textColor ??
(disabled && isOutlined
? color.primary
: disabled
? Colors.white
: isOutlined && isSecondaryColor
? ColorPalette.blackFont
: isOutlined
? color.primary
: isSecondaryColor
? Colors.white
: Colors.white),
),
),
),
if (suffixIcon != null) ...[
SizedBox(width: widthSuffix),
suffixIcon!
] else
Container()
],
),
),
);
}
}

View File

@@ -0,0 +1,113 @@
import 'dart:io';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:lottie/lottie.dart';
class ImageView extends StatelessWidget {
final dynamic image;
final double? height, width;
final BoxFit? fit;
final double? borderRadius;
final Color? loadingColor;
final Widget? loadingWidget;
final Widget? errorWidget;
///widget Image ini sudah di bikin fleksibel untuk menampilkan image dari File, assets dan internet
const ImageView({
Key? key,
required this.image,
this.height,
this.width,
this.loadingWidget,
this.loadingColor,
this.fit = BoxFit.cover,
this.borderRadius,
this.errorWidget,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final errWidget = errorWidget ??
Icon(
Icons.image_not_supported_outlined,
size: fit == BoxFit.fitHeight ? height : width,
color: Colors.grey,
);
if (image is String) {
var image = this.image as String;
if (image.isNotEmpty) {
if (image.startsWith("https") || image.startsWith("http")) {
if (image.endsWith(".svg")) {
return SvgPicture.network(
image,
fit: BoxFit.fitWidth,
width: width,
height: height,
);
}
return ClipRRect(
borderRadius: BorderRadius.circular(borderRadius ?? 0.0),
child: CachedNetworkImage(
imageUrl: image,
width: width,
height: height,
fit: fit,
placeholder: (context, url) {
return loadingWidget ??
Center(
child: CircularProgressIndicator(
color: loadingColor,
),
);
},
errorWidget: (context, _, x) {
return errWidget;
},
),
);
} else if (image.startsWith("assets")) {
if (image.endsWith(".json")) {
return LottieBuilder.asset(
image,
height: height,
width: width,
);
}
// handle svg from assets
if (image.endsWith('.svg')) {
return SvgPicture.asset(
image,
fit: BoxFit.fitWidth,
width: width,
height: height,
);
}
return ClipRRect(
borderRadius: BorderRadius.circular(borderRadius ?? 0.0),
child: Image.asset(
image,
height: height,
width: width,
fit: fit,
),
);
}
}
}
if (image is File) {
return ClipRRect(
borderRadius: BorderRadius.circular(borderRadius ?? 0.0),
child: Image.file(
image,
height: height,
width: width,
fit: fit,
),
);
}
return errWidget;
}
}

View File

@@ -0,0 +1,45 @@
import 'package:cims_apps/application/theme/color_palette.dart';
import 'package:flutter/material.dart';
class TextCaption extends StatelessWidget {
final String title, subtitle;
const TextCaption({
Key? key,
required this.title,
this.subtitle = '',
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(bottom: 32.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.w700,
color: ColorPalette.slate800,
),
),
subtitle.isNotEmpty
? Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
subtitle,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: ColorPalette.slate800,
),
),
)
: const SizedBox(),
],
),
);
}
}

View File

@@ -0,0 +1,195 @@
import 'package:cims_apps/application/theme/color_palette.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
class TextFormView extends StatelessWidget {
final String name;
final String? helperText;
final String? initialValue;
final VoidCallback? onTap;
final VoidCallback? onSubmit;
final bool enabled;
final bool readOnly;
final String? hintText, errorText;
final TextEditingController? ctrl;
final Widget? suffixIcon, suffixLable;
final Widget? prefixIcon;
final TextInputType? keyboardType;
final FormFieldValidator<String>? validator;
final bool obscureText;
final int? maxLength;
final ValueChanged<String>? onChanged;
final List<TextInputFormatter>? inputFormatters;
final TextStyle? errorStyle, hintTextStyle;
final _borderRadius = const BorderRadius.all(Radius.circular(10));
final Color? enabledborderColor;
final Color? focusedBorderColor;
final bool textrea, isTextAlignCenter;
final Widget? trailingTitleWidget;
final BoxConstraints? suffixIconConstraints;
final BoxConstraints? preffixIconConstraints;
final bool disableColor;
final Color? disabledborderColor;
final bool? enableInteractiveSelection;
final Color? fontColorDisabled;
final FocusNode? focusNode;
// ignore: prefer_const_constructors_in_immutables
TextFormView(
{Key? key,
required this.name,
this.helperText,
this.onTap,
this.fontColorDisabled,
this.enabledborderColor,
this.disabledborderColor,
this.initialValue,
this.enabled = true,
this.readOnly = false,
this.obscureText = false,
this.hintText,
this.hintTextStyle,
this.suffixIcon,
this.suffixLable,
this.prefixIcon,
this.keyboardType,
this.ctrl,
this.focusedBorderColor,
this.validator,
this.maxLength,
this.onChanged,
this.inputFormatters,
this.onSubmit,
this.textrea = false,
this.errorText,
this.errorStyle,
this.trailingTitleWidget,
this.suffixIconConstraints,
this.preffixIconConstraints,
this.disableColor = false,
this.enableInteractiveSelection = true,
this.focusNode,
this.isTextAlignCenter = false})
: super(key: key);
@override
Widget build(BuildContext context) {
if (inputFormatters != null && maxLength != null) {
inputFormatters?.add(LengthLimitingTextInputFormatter(maxLength));
}
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
name.isNotEmpty
? validator != null
? Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
name,
style: const TextStyle(
fontSize: 16,
color: ColorPalette.greyLight,
),
),
suffixLable ??
const Text(
" * ",
style: TextStyle(
fontSize: 16,
color: Colors.red,
),
),
],
)
: Text(
name,
style: const TextStyle(
fontSize: 16,
),
)
: const SizedBox(),
trailingTitleWidget ?? const SizedBox(),
],
),
const SizedBox(height: 8.0),
TextFormField(
focusNode: focusNode,
onTapOutside: (event) => FocusScope.of(context).unfocus(),
minLines: textrea ? 8 : 1,
maxLines: textrea ? null : 1,
initialValue: initialValue,
enabled: enabled,
controller: ctrl,
// maxLength: maxLength,
keyboardType: keyboardType,
onTap: onTap,
onEditingComplete: onSubmit,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: fontColorDisabled ?? Colors.black,
),
readOnly: readOnly,
validator: validator,
obscureText: obscureText,
onChanged: onChanged,
inputFormatters: inputFormatters ??
[
RemoveEmojiInputFormatter(),
if (maxLength != null)
LengthLimitingTextInputFormatter(maxLength)
],
enableInteractiveSelection: enableInteractiveSelection,
textAlign: isTextAlignCenter ? TextAlign.center : TextAlign.left,
decoration: InputDecoration(
helperText: helperText,
errorStyle: errorStyle,
errorText: errorText,
errorMaxLines: 2,
hintStyle: hintTextStyle ??
const TextStyle(
fontSize: 14,
color: Colors.grey,
fontWeight: FontWeight.normal,
),
isDense: true,
hintText: hintText,
filled: true,
fillColor: enabled && disableColor == false
? Colors.white
: const Color.fromARGB(255, 233, 236, 239),
disabledBorder: OutlineInputBorder(
borderRadius: _borderRadius,
borderSide: BorderSide(
color: disabledborderColor ?? ColorPalette.greyFont,
),
),
enabledBorder: OutlineInputBorder(
borderRadius: _borderRadius,
borderSide: BorderSide(
color: enabledborderColor ?? ColorPalette.greyBase,
),
),
focusedBorder: OutlineInputBorder(
borderRadius: _borderRadius,
borderSide: BorderSide(
color: focusedBorderColor ?? ColorPalette.greyBase,
),
),
border: OutlineInputBorder(borderRadius: _borderRadius),
suffixIcon: suffixIcon,
prefixIcon: prefixIcon,
suffixIconConstraints: suffixIconConstraints,
prefixIconConstraints: preffixIconConstraints,
),
)
],
);
}
}

View File

@@ -0,0 +1,77 @@
import 'package:flutter/material.dart';
class ColorPalette {
ColorPalette._();
static const Color neutral10 = Color(0xFFFFFFFF);
static const Color neutral20 = Color(0xFFF5F5F5);
static const Color neutral30 = Color(0xFFEDEDED);
static const Color neutral40 = Color(0xFFE0E0E0);
static const Color neutral50 = Color(0xFFC2C2C2);
static const Color neutral60 = Color(0xFF9E9E9E);
static const Color neutral70 = Color(0xFF757575);
static const Color neutral80 = Color(0xFF616161);
static const Color neutral90 = Color(0xFF404040);
static const Color neutral100 = Color(0xFF0A0A0A);
static const Color white = Color(0xFFFFFFFF);
static const Color secondary = Color.fromARGB(255, 254, 194, 15);
static const Color underGreen = Color(0xFF005539);
static const Color appBarItemColor = Color(0xFF1F1D20);
static const Color primary = Color(0xff2563EB);
static const Color secondaryGold = Color(0xFFC49B40);
static const Color crem = Color(0xFFFEF5DF);
static const Color crem2 = Color(0xFFF5EBD4);
static const Color greyInactive = Color(0xFFAEAEAE);
// static const Color greyDarker = Color(0xFF252525);
static const Color greys = Color(0xFF4E4E4E);
static const Color greySecond = Color(0xFF565656);
// static const Color greyBase = Color(0xFF898989);
// static const Color greyLight = Color(0xFFD0D0D0);
static const Color greyWhite = Color(0xFFF4F4F4);
static const Color pink = Color(0xFFFFCCDF);
static const Color blueLight = Color(0xFFDBEBFF);
static const Color tussock = Color(0xFF4F3F1D);
// static const Color tussockGold = Color(0xFFF39F1E);
static const Color linearGradient1 = Color(0xFFCBA143);
static const Color linearGradient2 = Color(0xFFF8D5A1);
static const Color yellowLight = Color(0xFFFFE6AD);
static const Color orange = Color(0xFFF2994A);
static const Color red = Color(0xFFFF000A);
static const Color fontGreyProfile = Color(0xFF444444);
static const Color blackFont = Color(0xFF1F1D20);
static const Color colorBgMultiBahasaInProfile =
Color.fromARGB(30, 188, 188, 188);
static const Color colorSwitchButtonActive = Color(0xFF3EB290);
static const Color greyFont = Color(0xFF515050);
static const Color blueGrey = Color(0xFFFAFCFF);
static const Color grey = Color(0xFFE8EEF7);
static const Color greyLights = Color(0xFFF7F7F8);
static const Color disable = Color(0xFF828282);
static const Color greyDarker = Color(0xFF252525);
static Color greyDark = const Color(0xFF4E4E4E).withOpacity(0.7);
static const Color greyBase = Color(0xFF898989);
static const Color greyLight = Color(0xFF646E82);
static const Color greyLighter = Color(0xFFFFFFFF);
static const Color neroLight = Color(0xFFF2F2F2);
static const Color neroLightest = Color(0xFFFAFAFA);
static const Color purple = Color(0xFFDDCEFF);
static const Color positive = Color(0xFFE4F5ED);
static const Color negative = Color(0xFFFFCCDF);
static const Color neutral = Color(0xFFDBEBFF);
static const Color warning = Color(0xFFFFF5BF);
static const Color bgGold = Color(0xFFF2C94C);
static const Color tussockGold = Color(0xFFF39F1E);
static const Color greyBorder = Color(0xFFE4E7EE);
static const Color forrestLight = Color(0xFF00BCAC);
static const Color forrestBase = Color(0xFF006D64);
static const Color greyDisable = Color(0xFFDBDDE3);
static const Color greyBorderNeutrals = Color(0xFFD0D7E6);
static const Color greyBackground = Color(0xFFF8F9FB);
static const Color chathams = Color(0xFF081731);
static const Color chathamsBlue = Color(0xFF285BB9);
static const Color background = Color(0xFFDADADA);
static const Color backgroundBlueLight = Color(0xFFEBF3FD);
static const Color slate800 = Color(0xFF1E293B);
}