diff --git a/.metadata b/.metadata index 5835264..de745e4 100644 --- a/.metadata +++ b/.metadata @@ -1,11 +1,11 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled and should not be manually edited. +# This file should be version controlled. version: - revision: "8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f" - channel: "beta" + revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + channel: stable project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f - base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 - platform: android - create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f - base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 - platform: ios - create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f - base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 - platform: linux - create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f - base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 - platform: macos - create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f - base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 - platform: web - create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f - base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 - platform: windows - create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f - base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f + create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 + base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8 # User provided section diff --git a/android/app/build.gradle b/android/app/build.gradle index 99d37ab..33bfe01 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,9 +1,3 @@ -plugins { - id "com.android.application" - id "kotlin-android" - id "dev.flutter.flutter-gradle-plugin" -} - def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -12,6 +6,11 @@ if (localPropertiesFile.exists()) { } } +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -22,6 +21,10 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + android { namespace "com.example.skyforce_app" compileSdkVersion flutter.compileSdkVersion @@ -64,4 +67,6 @@ flutter { source '../..' } -dependencies {} +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/android/settings.gradle b/android/settings.gradle index 55c4ca8..44e62bc 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,20 +1,11 @@ -pluginManagement { - def flutterSdkPath = { - def properties = new Properties() - file("local.properties").withInputStream { properties.load(it) } - def flutterSdkPath = properties.getProperty("flutter.sdk") - assert flutterSdkPath != null, "flutter.sdk not set in local.properties" - return flutterSdkPath - } - settings.ext.flutterSdkPath = flutterSdkPath() +include ':app' - includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() - plugins { - id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false - } -} +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } -include ":app" - -apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle" +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index d788d2b..2fa5449 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -168,8 +168,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 331C8080294A63A400263BE5 = { diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 87131a0..e42adcb 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ const Home(), + }, + // debugShowCheckedModeBanner: false, + ); + } +} + +class Home extends StatefulWidget { + const Home({super.key}); + + @override + State createState() => _HomeState(); +} + +class _HomeState extends State { + bool _isLoading = false; + + @override + void initState() { + super.initState(); + dataLoadFunction(); + } + + dataLoadFunction() async { + setState(() { + _isLoading = true; + }); + await Future.delayed(const Duration(seconds: 5)); + setState(() { + _isLoading = false; + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Color.fromARGB(255, 1, 0, 56), + title: const Text('SkyForce'), + ), + body: _isLoading + ? const Loading() + : Loaded() + ); + } +} + +class Loading extends StatelessWidget { + const Loading({ + super.key, + }); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + SizedBox( + height: MediaQuery.of(context).size.height / 2, + ), + Align( + child: CircularProgressIndicator(), + ), + Align( + child: Text('Loading...'), + ), + SizedBox( + height: MediaQuery.of(context).size.height / 2 - 100, + ), + Align( + child: Text('Powered by Thunder Network'), + ) + ], + ); + } +} + +class Loaded extends StatelessWidget { + const Loaded({ + super.key, + }); + + @override + Widget build(BuildContext context) { + return SingleChildScrollView( + child: Center( + child: Column( + children: [ + Wrap( + children: [ + Padding( + padding: const EdgeInsets.all(16.0), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(40), + color: Color.fromARGB(255, 44, 44, 44), + ), + height: 300, + width: 300, + child: PieChart( + PieChartData( + sections: [ + PieChartSectionData( + value: 30, + color: Colors.red, + title: 'Red', + ), + PieChartSectionData( + value: 20, + color: Colors.blue, + title: 'Blue', + ), + ], + ), + ) + ), + ), + Padding( + padding: const EdgeInsets.all(16.0), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(40), + color: Color.fromARGB(255, 44, 44, 44), + ), + height: 300, + width: 300, + child: LineChart( + LineChartData( + lineBarsData: [ + LineChartBarData( + spots: [ + FlSpot(0, 1), + FlSpot(1, 3), + FlSpot(2, 2), + FlSpot(3, 5), + FlSpot(4, 4), + FlSpot(5, 6), + ], + ), + LineChartBarData( + color: Colors.red, + spots: [ + FlSpot(0, 0), + FlSpot(1, 1), + FlSpot(2, 2), + FlSpot(3, 3), + FlSpot(4, 4), + FlSpot(5, 5), + ], + ), + ], + ), + duration: Duration(milliseconds: 150), + curve: Curves.linear, + ) + ), + ), + ], + ), + ], ), ), ); diff --git a/lib/url_strategy_native.dart b/lib/url_strategy_native.dart new file mode 100644 index 0000000..86c9411 --- /dev/null +++ b/lib/url_strategy_native.dart @@ -0,0 +1,2 @@ +void urlConfig() { +} diff --git a/lib/url_strategy_web.dart.dart b/lib/url_strategy_web.dart.dart new file mode 100644 index 0000000..12e454d --- /dev/null +++ b/lib/url_strategy_web.dart.dart @@ -0,0 +1,5 @@ +import 'package:flutter_web_plugins/flutter_web_plugins.dart'; + +void urlConfig() { + setUrlStrategy(PathUrlStrategy()); +} diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index e71a16d..f6f23bf 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,6 +6,10 @@ #include "generated_plugin_registrant.h" +#include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 2e1de87..f16b4c3 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index cccf817..8236f57 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,6 +5,8 @@ import FlutterMacOS import Foundation +import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 84d9f54..d9855c7 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -227,7 +227,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 331C80D4294CF70F00263BE5 = { diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 1535fc4..49cacd8 100644 --- a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ =3.1.0-163.1.beta <4.0.0" + dart: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index 465f846..a66c233 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,14 +1,16 @@ name: skyforce_app -description: A new Flutter project. +description: Skyforce App. publish_to: 'none' version: 0.1.0 environment: - sdk: '>=3.1.0-163.1.beta <4.0.0' + sdk: ^3.0.0 dependencies: + fl_chart: ^0.63.0 flutter: sdk: flutter + url_launcher: ^6.1.12 dev_dependencies: flutter_test: diff --git a/web/index.html b/web/index.html index 3972443..17c8058 100644 --- a/web/index.html +++ b/web/index.html @@ -34,7 +34,7 @@ diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index ad1756c..e6c12d7 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -8,7 +8,7 @@ set(BINARY_NAME "skyforce_app") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. -cmake_policy(VERSION 3.14...3.25) +cmake_policy(SET CMP0063 NEW) # Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 8b6d468..4f78848 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,6 +6,9 @@ #include "generated_plugin_registrant.h" +#include void RegisterPlugins(flutter::PluginRegistry* registry) { + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index b93c4c3..88b22e5 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/windows/runner/flutter_window.cpp b/windows/runner/flutter_window.cpp index 955ee30..b25e363 100644 --- a/windows/runner/flutter_window.cpp +++ b/windows/runner/flutter_window.cpp @@ -31,11 +31,6 @@ bool FlutterWindow::OnCreate() { this->Show(); }); - // Flutter can complete the first frame before the "show window" callback is - // registered. The following call ensures a frame is pending to ensure the - // window is shown. It is a no-op if the first frame hasn't completed yet. - flutter_controller_->ForceRedraw(); - return true; }