Initial commit
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
import 'package:cargocalculaterapp/core/extension/build_context_extension.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class ProfileInfoFieldWidget extends StatelessWidget {
|
||||
const ProfileInfoFieldWidget({
|
||||
super.key,
|
||||
required this.title,
|
||||
this.inputType,
|
||||
this.controller,
|
||||
this.readOnly = false,
|
||||
this.hasError,
|
||||
this.errorText,
|
||||
required this.isValid,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final TextInputType? inputType;
|
||||
final TextEditingController? controller;
|
||||
final bool readOnly;
|
||||
final bool? hasError;
|
||||
final bool isValid;
|
||||
final String? errorText;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
CupertinoTextFormFieldRow(
|
||||
readOnly: readOnly,
|
||||
cursorColor: context.color.accentColor,
|
||||
prefix: SizedBox(
|
||||
width: 90,
|
||||
child: Text(
|
||||
title,
|
||||
style: context.text.profileCategory.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
controller: controller,
|
||||
style: context.text.profileCategory,
|
||||
textAlign: TextAlign.left,
|
||||
keyboardType: inputType,
|
||||
),
|
||||
if ((controller?.text.isNotEmpty ?? false) &&
|
||||
(hasError ?? false) &&
|
||||
(!isValid))
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 16.0, top: 0),
|
||||
child: Text(
|
||||
errorText ?? "",
|
||||
style: const TextStyle(
|
||||
color: CupertinoColors.systemRed,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import 'package:cargocalculaterapp/core/extension/build_context_extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../../core/utils/app_utils.dart';
|
||||
|
||||
class UserInfoWidget extends StatelessWidget {
|
||||
const UserInfoWidget({super.key, required this.title, required this.name});
|
||||
|
||||
final String title;
|
||||
final String name;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(child: Text(title, style: context.text.orderListTitle)),
|
||||
AppUtils.kBoxWidth8,
|
||||
Expanded(
|
||||
child: Text(
|
||||
name,
|
||||
style: context.text.profileCategory,
|
||||
textAlign: TextAlign.end,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user