register user detail
This commit is contained in:
@@ -36,7 +36,7 @@ class AppBarWidget extends StatelessWidget implements PreferredSizeWidget {
|
||||
scrolledUnderElevation: 0.0,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
title: TextWidget().tex20W700(titleTxt, clr: AppColor.charcoalColor),
|
||||
title: TextWidget().text20W700(titleTxt, clr: AppColor.charcoalColor),
|
||||
leading: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 16.w,
|
||||
|
||||
18
lib/shared/components/bloc/checkbox/checkbox_bloc.dart
Normal file
18
lib/shared/components/bloc/checkbox/checkbox_bloc.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:bloc/bloc.dart';
|
||||
|
||||
import 'checkbox_event.dart';
|
||||
import 'checkbox_state.dart';
|
||||
|
||||
class CheckboxBloc extends Bloc<CheckboxEvent, CheckBoxState> {
|
||||
CheckboxBloc() : super(CheckboxUnchecked()) {
|
||||
on<ToggleCheckbox>(_onToggleCheckbox);
|
||||
}
|
||||
|
||||
void _onToggleCheckbox(ToggleCheckbox event, Emitter<CheckBoxState> emit) {
|
||||
if (state is CheckboxUnchecked) {
|
||||
emit(CheckboxChecked());
|
||||
} else {
|
||||
emit(CheckboxUnchecked());
|
||||
}
|
||||
}
|
||||
}
|
||||
10
lib/shared/components/bloc/checkbox/checkbox_event.dart
Normal file
10
lib/shared/components/bloc/checkbox/checkbox_event.dart
Normal file
@@ -0,0 +1,10 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
abstract class CheckboxEvent extends Equatable {
|
||||
const CheckboxEvent();
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class ToggleCheckbox extends CheckboxEvent {}
|
||||
12
lib/shared/components/bloc/checkbox/checkbox_state.dart
Normal file
12
lib/shared/components/bloc/checkbox/checkbox_state.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
abstract class CheckBoxState extends Equatable {
|
||||
const CheckBoxState();
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class CheckboxUnchecked extends CheckBoxState {}
|
||||
|
||||
class CheckboxChecked extends CheckBoxState {}
|
||||
@@ -26,7 +26,7 @@ class ButtonWidget {
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: clr,
|
||||
),
|
||||
child: TextWidget().tex14W700(
|
||||
child: TextWidget().text14W700(
|
||||
text,
|
||||
clr: txtClr ?? AppColor.plainWhite,
|
||||
),
|
||||
|
||||
42
lib/shared/components/checkbox_widget.dart
Normal file
42
lib/shared/components/checkbox_widget.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:tanami_app/core/styles/app_color.dart';
|
||||
|
||||
import 'bloc/checkbox/checkbox_bloc.dart';
|
||||
import 'bloc/checkbox/checkbox_event.dart';
|
||||
import 'bloc/checkbox/checkbox_state.dart';
|
||||
|
||||
class CheckBoxWidget extends StatelessWidget {
|
||||
const CheckBoxWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<CheckboxBloc, CheckBoxState>(
|
||||
builder: (context, state) {
|
||||
return Checkbox(
|
||||
activeColor: AppColor.checkBoxActiveColor,
|
||||
checkColor: Colors.white,
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
(states) {
|
||||
if (states.contains(MaterialState.selected)) {
|
||||
return const BorderSide(
|
||||
color: AppColor.checkBoxActiveColor, width: 2);
|
||||
}
|
||||
return const BorderSide(
|
||||
color: AppColor.strokeColor,
|
||||
width: 2,
|
||||
);
|
||||
},
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(6), // Custom radius
|
||||
),
|
||||
value: state is CheckboxChecked,
|
||||
onChanged: (value) {
|
||||
context.read<CheckboxBloc>().add(ToggleCheckbox());
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ class FormLabelTextField extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextWidget().tex14W500(
|
||||
TextWidget().text14W500(
|
||||
title,
|
||||
clr: AppColor.textLabelColor,
|
||||
),
|
||||
@@ -56,7 +56,7 @@ class FormLabelTextField extends StatelessWidget {
|
||||
},
|
||||
texttype: type == "phone number"
|
||||
? TextInputType.phone
|
||||
: TextInputType.none,
|
||||
: TextInputType.name,
|
||||
textEditingController: textEditingController,
|
||||
readonly: type == "country selection" ? true : false,
|
||||
hintText: hintText,
|
||||
|
||||
@@ -14,7 +14,7 @@ class TextWidget {
|
||||
|
||||
//Text Size 14
|
||||
|
||||
Widget tex14W500(
|
||||
Widget text14W500(
|
||||
String text, {
|
||||
Color? clr,
|
||||
TextDecoration? textDecoration,
|
||||
@@ -29,7 +29,7 @@ class TextWidget {
|
||||
color: clr ?? AppColor.plainWhite));
|
||||
}
|
||||
|
||||
Widget tex14W700(String text,
|
||||
Widget text14W700(String text,
|
||||
{Color? clr, TextDecoration? textDecoration, TextAlign? txtAlign}) {
|
||||
return Text(text,
|
||||
textAlign: txtAlign ?? TextAlign.center,
|
||||
@@ -41,7 +41,7 @@ class TextWidget {
|
||||
}
|
||||
|
||||
//Text Size 15
|
||||
Widget tex15W500(
|
||||
Widget text15W500(
|
||||
String text, {
|
||||
Color? clr,
|
||||
}) {
|
||||
@@ -53,7 +53,7 @@ class TextWidget {
|
||||
color: clr ?? AppColor.plainWhite));
|
||||
}
|
||||
|
||||
Widget tex15W400(
|
||||
Widget text15W400(
|
||||
String text, {
|
||||
Color? clr,
|
||||
TextDecoration? textDecoration,
|
||||
@@ -70,7 +70,7 @@ class TextWidget {
|
||||
}
|
||||
|
||||
//Text Size 22
|
||||
Widget tex22W700(String text, {Color? clr}) {
|
||||
Widget text22W700(String text, {Color? clr}) {
|
||||
return Text(text,
|
||||
style: GoogleFonts.dmSans(
|
||||
fontSize: 22,
|
||||
@@ -79,7 +79,7 @@ class TextWidget {
|
||||
}
|
||||
|
||||
//Text Size 20
|
||||
Widget tex20W700(String text, {Color? clr}) {
|
||||
Widget text20W700(String text, {Color? clr}) {
|
||||
return Text(text,
|
||||
style: GoogleFonts.dmSans(
|
||||
fontSize: 20,
|
||||
|
||||
@@ -14,7 +14,7 @@ ToastificationItem successToastMessage(
|
||||
icon: const Icon(Icons.done),
|
||||
type: ToastificationType.success,
|
||||
context: context,
|
||||
title: TextWidget().tex15W400(
|
||||
title: TextWidget().text15W400(
|
||||
textV,
|
||||
clr: AppColor.darkGreyColor,
|
||||
txtAlign: TextAlign.start,
|
||||
@@ -33,7 +33,7 @@ ToastificationItem errorToastMessage(
|
||||
icon: const Icon(Icons.error),
|
||||
type: ToastificationType.error,
|
||||
context: context,
|
||||
title: TextWidget().tex15W400(
|
||||
title: TextWidget().text15W400(
|
||||
textV,
|
||||
clr: AppColor.darkGreyColor,
|
||||
txtAlign: TextAlign.start,
|
||||
|
||||
Reference in New Issue
Block a user