initial commit
This commit is contained in:
25
lib/application/assets/path_assets.dart
Normal file
25
lib/application/assets/path_assets.dart
Normal 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';
|
||||
}
|
||||
134
lib/application/component/button/button_view.dart
Normal file
134
lib/application/component/button/button_view.dart
Normal 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()
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
113
lib/application/component/image/image_view.dart
Normal file
113
lib/application/component/image/image_view.dart
Normal 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;
|
||||
}
|
||||
}
|
||||
45
lib/application/component/text_caption/text_caption.dart
Normal file
45
lib/application/component/text_caption/text_caption.dart
Normal 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(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
195
lib/application/component/text_form/text_form_view.dart
Normal file
195
lib/application/component/text_form/text_form_view.dart
Normal 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,
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
77
lib/application/theme/color_palette.dart
Normal file
77
lib/application/theme/color_palette.dart
Normal 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);
|
||||
}
|
||||
11
lib/core/route/base_route.dart
Normal file
11
lib/core/route/base_route.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BaseRoute {
|
||||
String routeName;
|
||||
Widget clazz;
|
||||
|
||||
BaseRoute({
|
||||
required this.routeName,
|
||||
required this.clazz,
|
||||
});
|
||||
}
|
||||
62
lib/core/route/route.dart
Normal file
62
lib/core/route/route.dart
Normal file
@@ -0,0 +1,62 @@
|
||||
import 'package:cims_apps/features/splash_screen.dart';
|
||||
import 'package:cims_apps/routes/all_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
enum RouteType { push, pushReplace, pushRemove }
|
||||
|
||||
const initialRoute = SplashScreen.routeName;
|
||||
|
||||
Route<dynamic>? generateRoutes(RouteSettings settings) {
|
||||
AllRoute().key();
|
||||
return MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
AllRoute.allRouteMap[settings.name]?.clazz ?? const SizedBox(),
|
||||
settings: settings);
|
||||
}
|
||||
|
||||
Future routePush(
|
||||
BuildContext context, {
|
||||
RouteType? routeType,
|
||||
Object? arguments,
|
||||
required Widget page,
|
||||
}) {
|
||||
var pageRoute = MaterialPageRoute(
|
||||
builder: (context) => page,
|
||||
settings: RouteSettings(name: "/${page.toString()}", arguments: arguments),
|
||||
);
|
||||
if (routeType == RouteType.pushReplace) {
|
||||
return Navigator.pushReplacement(
|
||||
context,
|
||||
pageRoute,
|
||||
result: ModalRoute.of(context)?.currentResult,
|
||||
);
|
||||
}
|
||||
if (routeType == RouteType.pushRemove) {
|
||||
return Navigator.of(context).pushAndRemoveUntil(
|
||||
pageRoute,
|
||||
(route) => false,
|
||||
);
|
||||
}
|
||||
|
||||
return Navigator.push(context, pageRoute);
|
||||
}
|
||||
|
||||
Future routeNamed(
|
||||
BuildContext context, {
|
||||
RouteType? routeType,
|
||||
Object? arguments,
|
||||
required String routeName,
|
||||
}) {
|
||||
if (routeType == RouteType.pushReplace) {
|
||||
return Navigator.pushReplacementNamed(context, routeName,
|
||||
arguments: arguments, result: ModalRoute.of(context)?.currentResult);
|
||||
}
|
||||
if (routeType == RouteType.pushRemove) {
|
||||
return Navigator.of(context).pushNamedAndRemoveUntil(
|
||||
routeName,
|
||||
(route) => false,
|
||||
arguments: arguments,
|
||||
);
|
||||
}
|
||||
return Navigator.pushNamed(context, routeName);
|
||||
}
|
||||
37
lib/core/route/route_observer.dart
Normal file
37
lib/core/route/route_observer.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CoreRouteObserver extends NavigatorObserver {
|
||||
@override
|
||||
void didPush(Route route, Route? previousRoute) {
|
||||
if (kDebugMode) {
|
||||
log("\nRoute Name: ${route.settings.name} - push\n");
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void didPop(Route route, Route? previousRoute) {
|
||||
super.didPop(route, previousRoute);
|
||||
if (kDebugMode) {
|
||||
log("\nRoute Name: ${route.settings.name} - pop\n");
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void didRemove(Route route, Route? previousRoute) {
|
||||
if (kDebugMode) {
|
||||
log("\nRoute Name: ${route.settings.name} - remove\n");
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void didReplace({Route? newRoute, Route? oldRoute}) {
|
||||
if (kDebugMode) {
|
||||
if (newRoute != null) {
|
||||
log("\nRoute Name: ${newRoute.settings.name} - replace\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
15
lib/core/utils/size_config.dart
Normal file
15
lib/core/utils/size_config.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SizeConfig {
|
||||
//initOnStartUp
|
||||
static MediaQueryData mediaQuery = const MediaQueryData();
|
||||
static bool isMobile = true;
|
||||
static double width = 0;
|
||||
static double height = 0;
|
||||
|
||||
static void initOnStartUp(BuildContext context) {
|
||||
mediaQuery = MediaQuery.of(context);
|
||||
width = mediaQuery.size.width;
|
||||
height = mediaQuery.size.height;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,207 @@
|
||||
import 'package:cims_apps/application/assets/path_assets.dart';
|
||||
import 'package:cims_apps/application/component/button/button_view.dart';
|
||||
import 'package:cims_apps/application/component/image/image_view.dart';
|
||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||
import 'package:cims_apps/core/route/route.dart';
|
||||
import 'package:cims_apps/core/utils/size_config.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submission_parent.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class InitialRegistrationStep extends StatelessWidget {
|
||||
static const routeName = '/InitialRegistrationStep';
|
||||
const InitialRegistrationStep({Key? key}) : super(key: key);
|
||||
|
||||
Widget _stepItem({
|
||||
required String description,
|
||||
bool isActive = false,
|
||||
bool isDone = false,
|
||||
bool isLast = false,
|
||||
}) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 30,
|
||||
width: 30,
|
||||
decoration: BoxDecoration(
|
||||
color: isDone ? ColorPalette.primary : Colors.white,
|
||||
border: Border.all(
|
||||
width: 2.0,
|
||||
color: isActive || isDone
|
||||
? ColorPalette.primary
|
||||
: Colors.grey),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: isDone
|
||||
? const Align(
|
||||
alignment: Alignment.center,
|
||||
child: Icon(
|
||||
Icons.done_outlined,
|
||||
color: Colors.white,
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
if (!isLast)
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints.expand(
|
||||
width: 0.0, height: SizeConfig.width * .07),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
child: VerticalDivider(
|
||||
color: isDone ? ColorPalette.primary : Colors.grey,
|
||||
thickness: 2.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 8.0,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 8.0,
|
||||
),
|
||||
Text(
|
||||
description,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isActive ? ColorPalette.primary : ColorPalette.slate800,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List listStep = [
|
||||
{
|
||||
'desc': 'Personal Data',
|
||||
'isActive': true,
|
||||
'isDone': true,
|
||||
'isLast': false,
|
||||
},
|
||||
{
|
||||
'desc': 'Email',
|
||||
'isActive': true,
|
||||
'isDone': false,
|
||||
'isLast': false,
|
||||
},
|
||||
{
|
||||
'desc': 'Identity Card Photo ',
|
||||
'isActive': false,
|
||||
'isDone': false,
|
||||
'isLast': false,
|
||||
},
|
||||
{
|
||||
'desc': 'Identity Card Photo ',
|
||||
'isActive': false,
|
||||
'isDone': false,
|
||||
'isLast': false,
|
||||
},
|
||||
{
|
||||
'desc': 'ID Card Data Accuracy',
|
||||
'isActive': false,
|
||||
'isDone': false,
|
||||
'isLast': false,
|
||||
},
|
||||
{
|
||||
'desc': 'Bank Data',
|
||||
'isActive': false,
|
||||
'isDone': false,
|
||||
'isLast': false,
|
||||
},
|
||||
{
|
||||
'desc': 'Digital Signature',
|
||||
'isActive': false,
|
||||
'isDone': false,
|
||||
'isLast': false,
|
||||
},
|
||||
{
|
||||
'desc': 'Know your Risk Profile',
|
||||
'isActive': false,
|
||||
'isDone': false,
|
||||
'isLast': false,
|
||||
},
|
||||
{
|
||||
'desc': 'Completed Registration',
|
||||
'isActive': false,
|
||||
'isDone': false,
|
||||
'isLast': true,
|
||||
},
|
||||
];
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Registration'),
|
||||
),
|
||||
body: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ImageView(
|
||||
image: PathAssets.imgRegis,
|
||||
width: SizeConfig.width * .4,
|
||||
),
|
||||
SizedBox(
|
||||
width: SizeConfig.width * .45,
|
||||
child: const Text(
|
||||
"It's time for your registration",
|
||||
maxLines: 2,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 18,
|
||||
color: ColorPalette.slate800),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: SizeConfig.height * .6,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(
|
||||
children: listStep
|
||||
.asMap()
|
||||
.entries
|
||||
.map((e) => _stepItem(
|
||||
description: '${e.value['desc']}',
|
||||
isActive: e.value['isActive'],
|
||||
isDone: e.value['isDone'],
|
||||
isLast: e.value['isLast'],
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
ButtonView(
|
||||
name: 'Let’s Start',
|
||||
marginVertical: 8.0,
|
||||
onPressed: () {
|
||||
routePush(context, page: const SubmissionParent());
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
66
lib/features/auth/registration/view/registration_view.dart
Normal file
66
lib/features/auth/registration/view/registration_view.dart
Normal file
@@ -0,0 +1,66 @@
|
||||
import 'package:cims_apps/application/component/button/button_view.dart';
|
||||
import 'package:cims_apps/application/component/text_caption/text_caption.dart';
|
||||
import 'package:cims_apps/application/component/text_form/text_form_view.dart';
|
||||
import 'package:cims_apps/core/route/route.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/initial_registration_step.dart';
|
||||
import 'package:cims_apps/features/bottom_navigation_view.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class RegistrationView extends StatelessWidget {
|
||||
static const routName = '/RegistrationView';
|
||||
const RegistrationView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Sign Up'),
|
||||
),
|
||||
body: Container(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const TextCaption(
|
||||
title: 'Enter your phone number',
|
||||
subtitle: 'Input your registered phone number',
|
||||
),
|
||||
TextFormView(name: 'Phone Number'),
|
||||
ButtonView(
|
||||
name: 'Next',
|
||||
onPressed: () {
|
||||
routePush(context, page: const InitialRegistrationStep());
|
||||
},
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: RichText(
|
||||
textAlign: TextAlign.center,
|
||||
text: TextSpan(children: [
|
||||
const TextSpan(
|
||||
text: 'Already have an account? ',
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
print('object');
|
||||
},
|
||||
text: ' Sign In',
|
||||
style: const TextStyle(
|
||||
color: Colors.blue,
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
import 'package:cims_apps/application/component/button/button_view.dart';
|
||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||
import 'package:cims_apps/core/utils/size_config.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_email.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_personal_data.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SubmissionParent extends StatefulWidget {
|
||||
static const routeName = '/SubmissionParent';
|
||||
const SubmissionParent({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SubmissionParent> createState() => _SubmissionParentState();
|
||||
}
|
||||
|
||||
class _SubmissionParentState extends State<SubmissionParent> {
|
||||
int _currentStep = 1;
|
||||
final int _stepAmount = 9;
|
||||
Widget _stepItem({bool isCurrentStep = false, bool isDone = false}) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
if (_currentStep > 1) {
|
||||
_currentStep--;
|
||||
} else if (_currentStep == 1) {
|
||||
_currentStep++;
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(right: 4.0, left: 4.0),
|
||||
height: 6,
|
||||
width: SizeConfig.width * .08,
|
||||
decoration: BoxDecoration(
|
||||
color: isCurrentStep || isDone
|
||||
? ColorPalette.primary
|
||||
: ColorPalette.greyBorderNeutrals,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_content(int index) {
|
||||
switch (index) {
|
||||
case 1:
|
||||
return const SubmitPersonalData();
|
||||
case 2:
|
||||
return const SubmitEmail();
|
||||
case 3:
|
||||
return Container(
|
||||
child: Text("Step 3"),
|
||||
);
|
||||
case 4:
|
||||
return Container(
|
||||
child: Text("Step 4"),
|
||||
);
|
||||
case 5:
|
||||
return Container(
|
||||
child: Text("Step 5"),
|
||||
);
|
||||
case 6:
|
||||
return Container(
|
||||
child: Text("Step 6"),
|
||||
);
|
||||
case 7:
|
||||
return Container(
|
||||
child: Text("Step 7"),
|
||||
);
|
||||
case 8:
|
||||
return Container(
|
||||
child: Text("Step 8"),
|
||||
);
|
||||
case 9:
|
||||
return Container(
|
||||
child: Text("Step 9"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Registration'),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16.0, vertical: 16.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: List.generate(
|
||||
_stepAmount,
|
||||
(index) => _stepItem(
|
||||
isCurrentStep: _currentStep == index + 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: _content(_currentStep),
|
||||
)
|
||||
],
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: ButtonView(
|
||||
name: 'Next',
|
||||
marginVertical: 16.0,
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_currentStep++;
|
||||
});
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:cims_apps/application/component/text_caption/text_caption.dart';
|
||||
import 'package:cims_apps/application/component/text_form/text_form_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SubmitEmail extends StatelessWidget {
|
||||
const SubmitEmail({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const TextCaption(title: 'Enter your e-mail'),
|
||||
TextFormView(
|
||||
name: 'E-mail Address',
|
||||
hintText: 'Input e-mail address',
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import 'package:cims_apps/application/component/text_caption/text_caption.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SubmitPersonalData extends StatelessWidget {
|
||||
const SubmitPersonalData({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextCaption(title: 'Your personal details'),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
71
lib/features/bottom_navigation_view.dart
Normal file
71
lib/features/bottom_navigation_view.dart
Normal file
@@ -0,0 +1,71 @@
|
||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BottomNavigationView extends StatefulWidget {
|
||||
const BottomNavigationView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<BottomNavigationView> createState() => _BottomNavigationViewState();
|
||||
}
|
||||
|
||||
class _BottomNavigationViewState extends State<BottomNavigationView> {
|
||||
int _selectedIndex = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
///TODO: masukan pagenya dilistWidget ini
|
||||
List<Widget> listWidget = [
|
||||
Container(
|
||||
color: Colors.amberAccent,
|
||||
),
|
||||
Container(
|
||||
color: Colors.redAccent,
|
||||
),
|
||||
Container(),
|
||||
Container(),
|
||||
Container(),
|
||||
Container(),
|
||||
];
|
||||
|
||||
List<BottomNavigationBarItem> listNavigation = const [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.home_outlined),
|
||||
label: 'Home',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.search),
|
||||
label: 'Search',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.compare_arrows),
|
||||
label: 'Transaction',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.pie_chart_rounded),
|
||||
label: 'Portfolio',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.person),
|
||||
label: 'Profile',
|
||||
),
|
||||
];
|
||||
|
||||
return Scaffold(
|
||||
body: listWidget[_selectedIndex],
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
onTap: (value) {
|
||||
setState(() {
|
||||
_selectedIndex = value;
|
||||
});
|
||||
},
|
||||
currentIndex: _selectedIndex,
|
||||
items: listNavigation,
|
||||
showUnselectedLabels: true,
|
||||
selectedItemColor: ColorPalette.primary,
|
||||
unselectedItemColor: Colors.black,
|
||||
selectedLabelStyle: const TextStyle(color: ColorPalette.primary),
|
||||
unselectedLabelStyle: const TextStyle(color: Colors.black),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
import 'package:cims_apps/application/assets/path_assets.dart';
|
||||
import 'package:cims_apps/application/component/button/button_view.dart';
|
||||
import 'package:cims_apps/application/component/image/image_view.dart';
|
||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||
import 'package:cims_apps/core/route/route.dart';
|
||||
import 'package:cims_apps/core/utils/size_config.dart';
|
||||
import 'package:cims_apps/features/auth/registration/view/registration_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DashboardPublicView extends StatelessWidget {
|
||||
static const routeName = '/DashboardPublicView';
|
||||
const DashboardPublicView({Key? key}) : super(key: key);
|
||||
|
||||
Widget _caption() {
|
||||
return Column(
|
||||
children: [
|
||||
const Text(
|
||||
'Welcome!',
|
||||
style: TextStyle(
|
||||
color: ColorPalette.primary,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 28),
|
||||
),
|
||||
SizedBox(
|
||||
width: SizeConfig.width * .8,
|
||||
child: const Text(
|
||||
'We serve the management of Third Party investment funds in fulfilling financial goals.',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: ColorPalette.greyFont),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 32.0,
|
||||
horizontal: 24.0,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ImageView(
|
||||
image: PathAssets.icon1,
|
||||
width: SizeConfig.width * .35,
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
heightFactor: 1,
|
||||
child: _caption()),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: ImageView(
|
||||
image: PathAssets.imgDashboard,
|
||||
width: SizeConfig.width * .7,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ButtonView(
|
||||
name: 'Sign in',
|
||||
isOutlined: true,
|
||||
width: SizeConfig.width * .43,
|
||||
height: SizeConfig.height * .06,
|
||||
onPressed: () {},
|
||||
),
|
||||
ButtonView(
|
||||
name: 'Sign Up',
|
||||
width: SizeConfig.width * .43,
|
||||
height: SizeConfig.height * .06,
|
||||
onPressed: () {
|
||||
routePush(context, page: const RegistrationView());
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
const ImageView(image: PathAssets.iconConnect),
|
||||
ButtonView(
|
||||
name: 'Google',
|
||||
isSecondaryColor: true,
|
||||
isOutlined: true,
|
||||
prefixIcon: const ImageView(
|
||||
image: PathAssets.iconGoogle,
|
||||
width: 26,
|
||||
),
|
||||
onPressed: () {},
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ImageView(
|
||||
image: PathAssets.iconOjk,
|
||||
width: SizeConfig.width * .20,
|
||||
),
|
||||
ImageView(
|
||||
image: PathAssets.iconInklusi,
|
||||
width: SizeConfig.width * .20,
|
||||
),
|
||||
ImageView(
|
||||
image: PathAssets.iconReksadana,
|
||||
width: SizeConfig.width * .20,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
55
lib/features/splash_screen.dart
Normal file
55
lib/features/splash_screen.dart
Normal file
@@ -0,0 +1,55 @@
|
||||
import 'package:cims_apps/application/assets/path_assets.dart';
|
||||
import 'package:cims_apps/application/component/image/image_view.dart';
|
||||
import 'package:cims_apps/core/route/route.dart';
|
||||
import 'package:cims_apps/core/utils/size_config.dart';
|
||||
import 'package:cims_apps/features/dashboard/dashboard_public/view/dashboard_public_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SplashScreen extends StatefulWidget {
|
||||
static const routeName = '/SplashScreen';
|
||||
const SplashScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SplashScreen> createState() => _SplashScreenState();
|
||||
}
|
||||
|
||||
class _SplashScreenState extends State<SplashScreen> {
|
||||
@override
|
||||
void initState() {
|
||||
Future.delayed(const Duration(seconds: 3)).then(
|
||||
(value) => routePush(context, page: const DashboardPublicView()),
|
||||
);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final color = Theme.of(context).colorScheme;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: color.primary,
|
||||
body: Stack(
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: ImageView(
|
||||
image: PathAssets.iconSplashRight,
|
||||
width: SizeConfig.width * .25,
|
||||
)),
|
||||
Center(
|
||||
child: ImageView(
|
||||
image: PathAssets.imgSplashLogo,
|
||||
width: SizeConfig.width * .6,
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: ImageView(
|
||||
image: PathAssets.iconSplashLeft,
|
||||
width: SizeConfig.width * .25,
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
50
lib/main.dart
Normal file
50
lib/main.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
import 'package:cims_apps/application/theme/color_palette.dart';
|
||||
import 'package:cims_apps/core/route/route.dart';
|
||||
import 'package:cims_apps/core/utils/size_config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
|
||||
// This widget is the root of your application.
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SizeConfig.initOnStartUp(context);
|
||||
|
||||
return MaterialApp(
|
||||
title: 'CIMS',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: ThemeData(
|
||||
appBarTheme: const AppBarTheme(
|
||||
centerTitle: true,
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 1,
|
||||
foregroundColor: Colors.black,
|
||||
titleTextStyle: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: ColorPalette.slate800,
|
||||
)),
|
||||
fontFamily: 'Manrope',
|
||||
scaffoldBackgroundColor: Colors.white,
|
||||
colorScheme: const ColorScheme.light().copyWith(
|
||||
primary: const Color(0xff2563EB),
|
||||
onPrimary: const Color(0xFFFF9130),
|
||||
secondary: const Color(0xFFFECDA6),
|
||||
onBackground: const Color(0xFFA9A9A9),
|
||||
),
|
||||
// useMaterial3: true,
|
||||
),
|
||||
initialRoute: initialRoute,
|
||||
onGenerateRoute: generateRoutes,
|
||||
navigatorObservers: [
|
||||
NavigatorObserver(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
22
lib/routes/all_route.dart
Normal file
22
lib/routes/all_route.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:cims_apps/core/route/base_route.dart';
|
||||
import 'package:cims_apps/routes/dashboard/dashboard_route.dart';
|
||||
|
||||
import 'initial/initial_route.dart';
|
||||
|
||||
class AllRoute {
|
||||
static Map<String, BaseRoute> allRouteMap = {};
|
||||
|
||||
List<BaseRoute> allRoute = [
|
||||
...InitialRoute.listRoute,
|
||||
...DashboardRoute.listRoute,
|
||||
];
|
||||
|
||||
void key() {
|
||||
if (allRouteMap.isNotEmpty) {
|
||||
return;
|
||||
}
|
||||
for (var e in allRoute) {
|
||||
allRouteMap[e.routeName] = e;
|
||||
}
|
||||
}
|
||||
}
|
||||
0
lib/routes/auth/registration_route.dart
Normal file
0
lib/routes/auth/registration_route.dart
Normal file
10
lib/routes/dashboard/dashboard_route.dart
Normal file
10
lib/routes/dashboard/dashboard_route.dart
Normal file
@@ -0,0 +1,10 @@
|
||||
import 'package:cims_apps/core/route/base_route.dart';
|
||||
import 'package:cims_apps/features/dashboard/dashboard_public/view/dashboard_public_view.dart';
|
||||
|
||||
class DashboardRoute {
|
||||
static List<BaseRoute> listRoute = [
|
||||
BaseRoute(
|
||||
routeName: DashboardPublicView.routeName,
|
||||
clazz: const DashboardPublicView()),
|
||||
];
|
||||
}
|
||||
8
lib/routes/initial/initial_route.dart
Normal file
8
lib/routes/initial/initial_route.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
import 'package:cims_apps/core/route/base_route.dart';
|
||||
import 'package:cims_apps/features/splash_screen.dart';
|
||||
|
||||
class InitialRoute {
|
||||
static List<BaseRoute> listRoute = [
|
||||
BaseRoute(routeName: SplashScreen.routeName, clazz: const SplashScreen()),
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user