picker box update

null_safety
小赖 4 years ago
parent fae4a1e9b9
commit 6ba9657e26

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

@ -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 maxWidth = 3000, double maxHeight = 3000,
@required String title}) async { double maxWidth = 3000,
@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