添加 隐藏输入框外部键盘

隐藏 扫一扫按钮
hmxc
张萌 4 years ago
parent a95ddbc282
commit 237913b22f

@ -66,6 +66,16 @@ class MyApp extends StatelessWidget {
create: (context) => InspectionManageProvider()),
ChangeNotifierProvider(create: (context) => AnouncementProvider()),
],
child: GestureDetector(
onTap: () {
//
//
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus &&
currentFocus.focusedChild != null) {
FocusManager.instance.primaryFocus.unfocus();
}
},
child: ScreenUtilInit(
designSize: Size(750, 1334),
builder: () {
@ -85,6 +95,7 @@ class MyApp extends StatelessWidget {
const Locale('zh'),
],
);
}));
}),
));
}
}

@ -233,34 +233,34 @@ class _HomePageState extends State<HomePage> {
),
),
SizedBox(width: 15.w),
Container(
margin: EdgeInsets.only(top: 5.w, bottom: 5.w),
child: MaterialButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
//
height: double.infinity,
minWidth: 78.w,
padding: EdgeInsets.zero,
onPressed: () {
Get.to(() => ScanPage());
},
child: Column(children: [
Image.asset(
R.ASSETS_HOME_IC_SCAN_PNG,
height: 48.w,
width: 48.w,
),
Text(
'扫一扫',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 20.sp,
fontWeight: FontWeight.normal,
),
),
]),
),
),
// Container(
// margin: EdgeInsets.only(top: 5.w, bottom: 5.w),
// child: MaterialButton(
// materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
// //
// height: double.infinity,
// minWidth: 78.w,
// padding: EdgeInsets.zero,
// onPressed: () {
// Get.to(() => ScanPage());
// },
// child: Column(children: [
// Image.asset(
// R.ASSETS_HOME_IC_SCAN_PNG,
// height: 48.w,
// width: 48.w,
// ),
// Text(
// '扫一扫',
// style: TextStyle(
// color: AppStyle.primaryTextColor,
// fontSize: 20.sp,
// fontWeight: FontWeight.normal,
// ),
// ),
// ]),
// ),
// ),
Container(
margin: EdgeInsets.only(top: 5.w, bottom: 5.w),
child: AkuMaterialButton(

Loading…
Cancel
Save