Last active
February 23, 2022 03:29
-
-
Save Oshinowo/885a9a615096add7ea710a94b1310fcb to your computer and use it in GitHub Desktop.
import packages, initialize firebase asynchronously and make Google map run on Android platform surface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:firebase_core/firebase_core.dart'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_screenutil/flutter_screenutil.dart'; | |
import 'package:google_maps_flutter/google_maps_flutter.dart'; | |
import 'package:oshinowoa_firebase_gis/screens/home_screen.dart'; | |
void main() async { | |
WidgetsFlutterBinding.ensureInitialized(); | |
await Firebase.initializeApp(); | |
if (defaultTargetPlatform == TargetPlatform.android) { | |
AndroidGoogleMapsFlutter.useAndroidViewSurface = true; | |
} | |
runApp(const GisApp()); | |
} | |
class GisApp extends StatelessWidget { | |
const GisApp({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return ScreenUtilInit( | |
designSize: const Size(360, 690), | |
builder: () => MaterialApp( | |
debugShowCheckedModeBanner: false, | |
title: 'Gis App', | |
theme: ThemeData( | |
visualDensity: VisualDensity.adaptivePlatformDensity, | |
), | |
home: const HomeScreen(), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment