Search
 
SCRIPT & CODE EXAMPLE
 

DART

dismiss keyboard flutter

// The correct way of closing the keyboard is

FocusScope.of(context).unfocus();
Comment

flutter tab view to dismiss keyboard

// main.dart
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        FocusScopeNode currentFocus = FocusScope.of(context);

        if (!currentFocus.hasPrimaryFocus) {
          currentFocus.unfocus();
        }
      },
      child: MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: MyHomePage(),
      ),
    );
  }
}
Comment

PREVIOUS NEXT
Code Example
Dart :: dart log to console 
Dart :: flutter snackbar shape 
Dart :: change hint text color flutter 
Dart :: flutter appbar trailing icon 
Dart :: dart continue 
Dart :: FirebaseOptions cannot be null when creating the default app 
Dart :: dart repeat function 
Dart :: circular elevated button flutter 
Dart :: borderradius.only flutter 
Dart :: dart parse boolean from string 
Dart :: flutter loading images over network 
Dart :: dart async vs async* 
Dart :: flutter snackbar margin 
Dart :: close drawer flutter 
Dart :: flutter check ios or android 
Dart :: Flutter Text size to fit 
Dart :: six_ft_apart 
Dart :: dart data class generator 
Dart :: create a validator in flutter 
Dart :: flutter status bar color 
Dart :: flutter listtile selected 
Dart :: dart sort list by date 
Dart :: dart switch case 
Dart :: cast variable dart 
Dart :: how to convert string into date format 
Dart :: dart terbary 
Dart :: how to print data types in dart 
Dart :: remove first and last character from string dart 
Dart :: int.parse flutter 
Dart :: upload a file to ec2 instance 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =