picker box update

null_safety
小赖 4 years ago
parent fae4a1e9b9
commit 6ba9657e26

@ -48,28 +48,23 @@ class ASPickerBox extends StatelessWidget {
children: [ children: [
SizedBox( SizedBox(
height: 48.w, height: 48.w,
child: Row( child: NavigationToolbar(
crossAxisAlignment: CrossAxisAlignment.stretch, leading: _buildButton(
children: [
_buildButton(
title: '取消', title: '取消',
onPressed: () { onPressed: () => Navigator.pop(context),
Navigator.pop(context); ),
}), middle: Text(
Expanded(
child: Center(
child: Text(
title ?? '', title ?? '',
style: TextStyle( style: TextStyle(
color: kTextColor, color: kTextColor,
fontSize: 16.sp, fontSize: 16.sp,
), ),
), ),
trailing: _buildButton(
title: confirmString,
onPressed: onPressed,
), ),
), ),
_buildButton(title: confirmString, onPressed: onPressed),
],
),
), ),
ASDivider(), ASDivider(),
Expanded(child: child), Expanded(child: child),

@ -15,10 +15,12 @@ Future<File> camFile({double maxHeight = 3000, double maxWidth = 3000}) async {
return File(pickedFile.path); return File(pickedFile.path);
} }
Future<File> camView(BuildContext context, Future<File> camView(
{double maxHeight = 3000, BuildContext context, {
double maxHeight = 3000,
double maxWidth = 3000, double maxWidth = 3000,
@required String title}) async { @required String title,
}) async {
File file = await camFile(maxHeight: maxHeight, maxWidth: maxWidth); File file = await camFile(maxHeight: maxHeight, maxWidth: maxWidth);
if (file == null) return null; if (file == null) return null;
return await Navigator.push(context, PageRouteBuilder( return await Navigator.push(context, PageRouteBuilder(

Loading…
Cancel
Save