Skip to content

Instantly share code, notes, and snippets.

@alperefesahin
Created June 14, 2022 09:34
Show Gist options
  • Select an option

  • Save alperefesahin/bb9af899569f6f36948b4a02501b2e6e to your computer and use it in GitHub Desktop.

Select an option

Save alperefesahin/bb9af899569f6f36948b4a02501b2e6e to your computer and use it in GitHub Desktop.
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:sizer/sizer.dart';
import 'package:todo_list_riverpod/presentation/pages/home_page/home_page.dart';
class AppWidget extends StatelessWidget {
const AppWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Sizer(
builder: (context, orientation, deviceType) {
return Listener(
onPointerUp: (_) {
if (Platform.isIOS) {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) {
FocusManager.instance.primaryFocus!.unfocus();
}
}
},
child: const MaterialApp(
debugShowCheckedModeBanner: false,
home: HomePage(),
),
);
},
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment