添加身份证照片选择器

添加个人信息补充页面
hmxc
张萌 3 years ago
parent 38dcecbc30
commit 6fd92c3edc

@ -1,6 +1,14 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart';
import 'package:aku_community/widget/others/bee_input_row.dart';
import 'package:aku_community/widget/picker/identify_card_picker.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:aku_community/extensions/widget_list_ext.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class SupplementInformationPage extends StatefulWidget {
SupplementInformationPage({Key? key}) : super(key: key);
@ -30,6 +38,7 @@ class _SupplementInformationPageState extends State<SupplementInformationPage> {
title: '补充个人信息',
bodyColor: Colors.white,
body: ListView(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
children: [
BeeInputRow(
title: '承租人',
@ -37,18 +46,74 @@ class _SupplementInformationPageState extends State<SupplementInformationPage> {
hintText: '杨赟',
isRequire: true,
),
BeeInputRow.button(title: '性别', onPressed:(){} , hintText: _sex,isRequire: true,),
BeeInputRow(title: '手机号码', controller: _phoneController, hintText: '13742494159',isRequire: true,),
BeeInputRow(title: '身份证号', controller: _codeController, hintText: 'hintText',isRequire: true,),
BeeInputRow(title: '紧急联系人', controller: _emergencyContactController, hintText: 'hintText'),
BeeInputRow(title: '紧急联系人电话', controller: _emergencyPhoneController, hintText: 'hintText'),
BeeInputRow(title: '通讯地址(含诉讼送达地址)', controller: _addressController, hintText: 'hintText'),
BeeInputRow(title: '工作单位', controller: _workUnitController, hintText: 'hintText'),
],
BeeInputRow.button(
title: '性别',
onPressed: () async {
await Get.bottomSheet(_sexBottomSheet());
setState(() {});
},
hintText: _sex,
isRequire: true,
),
BeeInputRow(
title: '手机号码',
controller: _phoneController,
hintText: '13742494159',
isRequire: true,
),
BeeInputRow(
title: '身份证号',
controller: _codeController,
hintText: 'hintText',
isRequire: true,
),
BeeInputRow(
title: '紧急联系人',
controller: _emergencyContactController,
hintText: 'hintText'),
BeeInputRow(
title: '紧急联系人电话',
controller: _emergencyPhoneController,
hintText: 'hintText'),
BeeInputRow(
title: '通讯地址(含诉讼送达地址)',
controller: _addressController,
hintText: 'hintText'),
BeeInputRow(
title: '工作单位',
controller: _workUnitController,
hintText: 'hintText'),
IdentifyCardPicker.front((file) => () {}),
IdentifyCardPicker.back((file) => () {}),
].sepWidget(separate: 24.w.heightBox),
),
bottomNavi: BottomButton(
onPressed: () {},
child: '下一步'.text.size(32.sp).bold.color(ktextPrimary).make()),
);
}
Widget _sexBottomSheet() {
return CupertinoActionSheet(
title:
'选择性别'.text.size(32.sp).bold.color(ktextPrimary).isIntrinsic.make(),
cancelButton: TextButton(
onPressed: () => Get.back(),
child: '取消'.text.size(28.sp).color(ktextSubColor).isIntrinsic.make()),
actions: [
CupertinoActionSheetAction(
onPressed: () {
_sex = '';
Get.back();
},
child: ''.text.size(30.sp).color(ktextPrimary).isIntrinsic.make()),
CupertinoActionSheetAction(
onPressed: () {
_sex = '';
Get.back();
},
child: ''.text.size(30.sp).color(ktextPrimary).isIntrinsic.make())
],
);
}
}

@ -1,10 +1,12 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/ui/profile/house/supplement_information_page.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/card_bottom_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class TenantHouseListPage extends StatefulWidget {
@ -70,7 +72,13 @@ class _TenantHouseListPageState extends State<TenantHouseListPage> {
Widget houseCard() {
var buttons = Row(
children: [CardBottomButton.yellow(text: '填写信息', onPressed: () {})],
children: [
CardBottomButton.yellow(
text: '填写信息',
onPressed: () {
Get.to(() => SupplementInformationPage());
})
],
);
var bottom = Row(
children: [

@ -1,19 +1,63 @@
import 'dart:io';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/widget/picker/bee_image_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class IdentifyCardPicker {
static front() {
class IdentifyCardPicker extends StatefulWidget {
static Widget front(Function(File? file) onChange) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'上传身份证正面'.text.size(28.sp).color(ktextPrimary).make(),
24.w.heightBox,
Container(
width: 350.w,
height: 220.w,
IdentifyCardPicker(
onChange: onChange,
path: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
)
],
);
}
static Widget back(Function(File? file) onChange) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'上传身份证背面'.text.size(28.sp).color(ktextPrimary).make(),
24.w.heightBox,
IdentifyCardPicker(
onChange: onChange, path: R.ASSETS_IMAGES_PLACEHOLDER_WEBP)
],
);
}
final Function(File? file) onChange;
final String path;
IdentifyCardPicker({Key? key, required this.onChange, required this.path})
: super(key: key);
@override
_IdentifyCardPickerState createState() => _IdentifyCardPickerState();
}
class _IdentifyCardPickerState extends State<IdentifyCardPicker> {
File? _file;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () async {
_file = await BeeImagePicker.pick(title: '选择身份证照片');
setState(() {});
widget.onChange(_file);
},
child: Container(
width: 350.w,
height: 220.w,
child: _file != null ? Image.file(_file!) : Image.asset(widget.path),
),
);
}
}

Loading…
Cancel
Save