添加 隐藏输入框外部键盘

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

@ -66,25 +66,36 @@ class MyApp extends StatelessWidget {
create: (context) => InspectionManageProvider()), create: (context) => InspectionManageProvider()),
ChangeNotifierProvider(create: (context) => AnouncementProvider()), ChangeNotifierProvider(create: (context) => AnouncementProvider()),
], ],
child: ScreenUtilInit( child: GestureDetector(
designSize: Size(750, 1334), onTap: () {
builder: () { //
return GetMaterialApp( //
title: '小蜜蜂管家', FocusScopeNode currentFocus = FocusScope.of(context);
home: SplashPage(), if (!currentFocus.hasPrimaryFocus &&
builder: BotToastInit(), currentFocus.focusedChild != null) {
navigatorObservers: [ FocusManager.instance.primaryFocus.unfocus();
BotToastNavigatorObserver(), }
], },
localizationsDelegates: [ child: ScreenUtilInit(
GlobalCupertinoLocalizations.delegate, designSize: Size(750, 1334),
GlobalMaterialLocalizations.delegate, builder: () {
GlobalWidgetsLocalizations.delegate, return GetMaterialApp(
], title: '小蜜蜂管家',
supportedLocales: [ home: SplashPage(),
const Locale('zh'), builder: BotToastInit(),
], navigatorObservers: [
); BotToastNavigatorObserver(),
})); ],
localizationsDelegates: [
GlobalCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: [
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