1

Im learning to make android application with flutter and i seems to having problem with the emulator view that cut the display and it cannot go down any further.

Display on emulator

My Code is this

import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'LoginPage/login_screen.dart';

void main() {

  WidgetsFlutterBinding.ensureInitialized();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {

  final Future<FirebaseApp> _initialization = Firebase.initializeApp();


  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return FutureBuilder(
      future: _initialization,
      builder: (context, snapshot)
      {
        if(snapshot.connectionState == ConnectionState.waiting)
        {
          return const MaterialApp(
            home: Scaffold(
              body: Center(
                child: Text('Skolae Clone App is being initialized',
                style: TextStyle(
                  color: Colors.cyan,
                  fontSize: 38,
                  fontWeight: FontWeight.bold,
                  fontFamily: 'signatra'
                  ),
                ),
              ),
            ),
          );
        }
        else if(snapshot.hasError)
        {
          return const MaterialApp(
            home: Scaffold(
              body: Center(
                child: Text('An error has been occured',
                  style: TextStyle(
                      color: Colors.cyan,
                      fontSize: 40,
                      fontWeight: FontWeight.bold
                  ),
                ),
              ),
            ),
          );
        }
        return MaterialApp(
          debugShowCheckedModeBanner: false,
          title: 'Skolae Clone App',
          theme: ThemeData(
            scaffoldBackgroundColor: Colors.black,
            primarySwatch: Colors.blue,
          ),
          home: Login(),
        );
      }
    );
  }
}

I don't know what should i add to fix this problem, i search for other similiar problems like im facing but their code is a bit different

2
  • Try creating a new another emulator. Sep 21, 2022 at 10:14
  • This is working Fine in Real device.may be problem in your emulator change the emulator and then try Sep 21, 2022 at 11:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.