feat: login page
This commit is contained in:
@@ -7,21 +7,21 @@ class AppStyle {
|
||||
|
||||
static TextStyle md = TextStyle(color: AppColor.textPrimary, fontSize: 14);
|
||||
|
||||
static TextStyle lg = TextStyle(color: AppColor.textPrimary, fontSize: 18);
|
||||
static TextStyle lg = TextStyle(color: AppColor.textPrimary, fontSize: 16);
|
||||
|
||||
static TextStyle xl = TextStyle(color: AppColor.textPrimary, fontSize: 20);
|
||||
static TextStyle xl = TextStyle(color: AppColor.textPrimary, fontSize: 18);
|
||||
|
||||
static TextStyle xxl = TextStyle(color: AppColor.textPrimary, fontSize: 22);
|
||||
static TextStyle xxl = TextStyle(color: AppColor.textPrimary, fontSize: 20);
|
||||
|
||||
static TextStyle h6 = TextStyle(color: AppColor.textPrimary, fontSize: 24);
|
||||
static TextStyle h6 = TextStyle(color: AppColor.textPrimary, fontSize: 22);
|
||||
|
||||
static TextStyle h5 = TextStyle(color: AppColor.textPrimary, fontSize: 26);
|
||||
static TextStyle h5 = TextStyle(color: AppColor.textPrimary, fontSize: 24);
|
||||
|
||||
static TextStyle h4 = TextStyle(color: AppColor.textPrimary, fontSize: 28);
|
||||
static TextStyle h4 = TextStyle(color: AppColor.textPrimary, fontSize: 26);
|
||||
|
||||
static TextStyle h3 = TextStyle(color: AppColor.textPrimary, fontSize: 30);
|
||||
static TextStyle h3 = TextStyle(color: AppColor.textPrimary, fontSize: 28);
|
||||
|
||||
static TextStyle h2 = TextStyle(color: AppColor.textPrimary, fontSize: 32);
|
||||
static TextStyle h2 = TextStyle(color: AppColor.textPrimary, fontSize: 30);
|
||||
|
||||
static TextStyle h1 = TextStyle(color: AppColor.textPrimary, fontSize: 34);
|
||||
static TextStyle h1 = TextStyle(color: AppColor.textPrimary, fontSize: 32);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ part of 'theme.dart';
|
||||
|
||||
class AppValue {
|
||||
static const double padding = 16.0;
|
||||
static const double margin = 16.0;
|
||||
static const double radius = 8.0;
|
||||
static const double elevation = 4.0;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,46 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../presentation/components/assets/fonts.gen.dart';
|
||||
|
||||
part 'app_color.dart';
|
||||
part 'app_style.dart';
|
||||
part 'app_value.dart';
|
||||
|
||||
class ThemeApp {
|
||||
static ThemeData get theme => ThemeData(
|
||||
useMaterial3: true,
|
||||
);
|
||||
useMaterial3: true,
|
||||
scaffoldBackgroundColor: AppColor.background,
|
||||
fontFamily: FontFamily.quicksand,
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
hintStyle: AppStyle.md.copyWith(color: AppColor.textSecondary),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: AppValue.padding),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(AppValue.radius),
|
||||
borderSide: const BorderSide(color: AppColor.border),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(AppValue.radius),
|
||||
borderSide: const BorderSide(color: AppColor.border),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(AppValue.radius),
|
||||
borderSide: const BorderSide(color: AppColor.primary, width: 2),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(AppValue.radius),
|
||||
borderSide: const BorderSide(color: AppColor.error),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: AppColor.backgroundLight,
|
||||
),
|
||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.transparent,
|
||||
shadowColor: Colors.transparent,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppValue.radius),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
class AppValidator {
|
||||
static String? validateEmail(String? value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Email wajib diisi';
|
||||
}
|
||||
final emailRegex = RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$');
|
||||
if (!emailRegex.hasMatch(value)) {
|
||||
return 'Format email tidak valid';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static String? validatePassword(String? value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Password wajib diisi';
|
||||
}
|
||||
if (value.length < 8) {
|
||||
return 'Password minimal 8 karakter';
|
||||
}
|
||||
// if (!RegExp(r'[A-Z]').hasMatch(value)) {
|
||||
// return 'Password harus mengandung huruf besar';
|
||||
// }
|
||||
// if (!RegExp(r'[0-9]').hasMatch(value)) {
|
||||
// return 'Password harus mengandung angka';
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user