main.dart 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. theme: ThemeData(primaryColor: Color(0xff121319)),
  33. home: RecommendPage(
  34. selIndex: 0,
  35. ),
  36. );
  37. }
  38. }