content: import 'dart:io';
  
  import 'package:flutter/foundation.dart';
  import 'package:flutter/material.dart';
  import 'package:gdg_weather/page/city/CityWidget.dart';
  import 'package:gdg_weather/page/weather/WeatherWidget.dart';
  
  void main(){
    _setTargetPlatformForDesktop();
    setCustomErrorPage();
    runApp(MyApp());
  }
  
  void setCustomErrorPage(){
      ErrorWidget.builder = (FlutterErrorDetails flutterErrorDetails){
        print(flutterErrorDetails.toString());
        return Center(
          child: Text("Flutter 走神了"),
        );
      };
  }
  
  /// If the current platform is desktop, override the default platform to
  /// a supported platform (iOS for macOS, Android for Linux and Windows).
  /// Otherwise, do nothing.
  void _setTargetPlatformForDesktop() {
    TargetPlatform targetPlatform;
    if (Platform.isMacOS) {
      targetPlatform = TargetPlatform.iOS;
    } else if (Platform.isLinux || Platform.isWindows) {
      targetPlatform = TargetPlatform.android;
    }
    if (targetPlatform != null) {
      debugDefaultTargetPlatformOverride = targetPlatform;
    }
  
  }
  
  class MyApp extends StatelessWidget {
    // This widget is the root of your application.
    
    MyApp(){
  
    }
  
    @override
    Widget build(BuildContext context) {
  
      return MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          // This is the theme of your application.
          //
          // Try running your application with "flutter run". You'll see the
          // application has a blue toolbar. Then, without quitting the app, try
          // changing the primarySwatch below to Colors.green and then invoke
          // "hot reload" (press "r" in the console where you ran "flutter run",
          // or press Run > Flutter Hot Reload in IntelliJ). Notice that the
          // counter didn't reset back to zero; the application is not restarted.
          primarySwatch: Colors.blue,
        ),
        home: Scaffold(
          body: CityWidget(),
        ),
      );
    }
  }
  