main.dart 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import 'dart:io';
  2. import 'package:douyin_demo/pages/recommend_page.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:shared_preferences/shared_preferences.dart';
  5. Future main() async {
  6. WidgetsFlutterBinding.ensureInitialized();
  7. final prefs = await SharedPreferences.getInstance();
  8. prefs.setBool("ifIOS", Platform.isIOS);
  9. prefs.setBool("ifPrd", false);
  10. prefs.setBool("ifReal_d", false);
  11. prefs.setString("urlPath_real_d", "192.168.0.8");
  12. prefs.setString("scheme_real_d", "http");
  13. prefs.setInt("ports_real_d", 5000);
  14. prefs.setString("urlPath_ios_d", "127.0.0.1");
  15. prefs.setString("scheme_ios_d", "http");
  16. prefs.setInt("ports_ios_d", 5000);
  17. prefs.setString("urlPath_and_d", "10.0.2.2");
  18. prefs.setString("scheme_and_d", "http");
  19. prefs.setInt("ports_and_d", 5000);
  20. prefs.setString("urlPath_p", "118.26.177.76");
  21. prefs.setString("scheme_p", "http");
  22. prefs.setInt("ports_p", 80);
  23. // prefs.setString("picServer", "http://www.guojio.com");
  24. runApp(MyApp());
  25. }
  26. class MyApp extends StatelessWidget {
  27. const MyApp({Key key}) : super(key: key);
  28. @override
  29. Widget build(BuildContext context) {
  30. return MaterialApp(
  31. title: "抖音",
  32. debugShowCheckedModeBanner: false,
  33. theme: ThemeData(primaryColor: Color(0xff121319)),
  34. home: RecommendPage(
  35. selIndex: 0,
  36. ),
  37. );
  38. }
  39. }