添加 隐藏输入框外部键盘

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

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

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

Loading…
Cancel
Save