@sentry/wizard 3.38.0 → 3.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/README.md +3 -3
  3. package/dist/e2e-tests/tests/flutter.test.d.ts +1 -0
  4. package/dist/e2e-tests/tests/flutter.test.js +190 -0
  5. package/dist/e2e-tests/tests/flutter.test.js.map +1 -0
  6. package/dist/e2e-tests/tests/nextjs.test.js +1 -1
  7. package/dist/e2e-tests/tests/nextjs.test.js.map +1 -1
  8. package/dist/e2e-tests/tests/nuxt-3.test.js +1 -1
  9. package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
  10. package/dist/e2e-tests/tests/nuxt-4.test.js +1 -1
  11. package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
  12. package/dist/e2e-tests/tests/remix.test.js +1 -2
  13. package/dist/e2e-tests/tests/remix.test.js.map +1 -1
  14. package/dist/e2e-tests/tests/sveltekit.test.js +17 -5
  15. package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
  16. package/dist/e2e-tests/utils/index.d.ts +22 -1
  17. package/dist/e2e-tests/utils/index.js +58 -3
  18. package/dist/e2e-tests/utils/index.js.map +1 -1
  19. package/dist/lib/Constants.d.ts +1 -0
  20. package/dist/lib/Constants.js +5 -0
  21. package/dist/lib/Constants.js.map +1 -1
  22. package/dist/package.json +1 -1
  23. package/dist/src/apple/apple-wizard.js +1 -1
  24. package/dist/src/apple/apple-wizard.js.map +1 -1
  25. package/dist/src/apple/xcode-manager.d.ts +4 -4
  26. package/dist/src/apple/xcode-manager.js.map +1 -1
  27. package/dist/src/flutter/code-tools.d.ts +17 -0
  28. package/dist/src/flutter/code-tools.js +263 -0
  29. package/dist/src/flutter/code-tools.js.map +1 -0
  30. package/dist/src/flutter/flutter-wizard.d.ts +2 -0
  31. package/dist/src/flutter/flutter-wizard.js +171 -0
  32. package/dist/src/flutter/flutter-wizard.js.map +1 -0
  33. package/dist/src/flutter/templates.d.ts +9 -0
  34. package/dist/src/flutter/templates.js +40 -0
  35. package/dist/src/flutter/templates.js.map +1 -0
  36. package/dist/src/nextjs/nextjs-wizard.js +3 -1
  37. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  38. package/dist/src/run.d.ts +1 -1
  39. package/dist/src/run.js +39 -32
  40. package/dist/src/run.js.map +1 -1
  41. package/dist/src/sourcemaps/sourcemaps-wizard.js +2 -3
  42. package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
  43. package/dist/src/telemetry.d.ts +2 -1
  44. package/dist/src/telemetry.js +1 -1
  45. package/dist/src/telemetry.js.map +1 -1
  46. package/dist/src/utils/clack-utils.d.ts +1 -1
  47. package/dist/src/utils/clack-utils.js +3 -3
  48. package/dist/src/utils/clack-utils.js.map +1 -1
  49. package/dist/src/utils/package-manager.d.ts +0 -1
  50. package/dist/src/utils/package-manager.js +9 -10
  51. package/dist/src/utils/package-manager.js.map +1 -1
  52. package/dist/test/flutter/code-tools.test.d.ts +1 -0
  53. package/dist/test/flutter/code-tools.test.js +84 -0
  54. package/dist/test/flutter/code-tools.test.js.map +1 -0
  55. package/dist/test/flutter/templates.test.d.ts +1 -0
  56. package/dist/test/flutter/templates.test.js +41 -0
  57. package/dist/test/flutter/templates.test.js.map +1 -0
  58. package/e2e-tests/README.md +5 -1
  59. package/e2e-tests/test-applications/flutter-test-app/.metadata +45 -0
  60. package/e2e-tests/test-applications/flutter-test-app/README.md +16 -0
  61. package/e2e-tests/test-applications/flutter-test-app/analysis_options.yaml +28 -0
  62. package/e2e-tests/test-applications/flutter-test-app/android/app/build.gradle +44 -0
  63. package/e2e-tests/test-applications/flutter-test-app/android/app/src/debug/AndroidManifest.xml +7 -0
  64. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/AndroidManifest.xml +45 -0
  65. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/kotlin/com/example/flutter_magic/MainActivity.kt +5 -0
  66. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/drawable/launch_background.xml +12 -0
  67. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/drawable-v21/launch_background.xml +12 -0
  68. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  69. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  70. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  71. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  72. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  73. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/values/styles.xml +18 -0
  74. package/e2e-tests/test-applications/flutter-test-app/android/app/src/main/res/values-night/styles.xml +18 -0
  75. package/e2e-tests/test-applications/flutter-test-app/android/app/src/profile/AndroidManifest.xml +7 -0
  76. package/e2e-tests/test-applications/flutter-test-app/android/build.gradle +18 -0
  77. package/e2e-tests/test-applications/flutter-test-app/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  78. package/e2e-tests/test-applications/flutter-test-app/android/gradle.properties +3 -0
  79. package/e2e-tests/test-applications/flutter-test-app/android/settings.gradle +25 -0
  80. package/e2e-tests/test-applications/flutter-test-app/lib/main.dart +125 -0
  81. package/e2e-tests/test-applications/flutter-test-app/linux/CMakeLists.txt +145 -0
  82. package/e2e-tests/test-applications/flutter-test-app/linux/flutter/CMakeLists.txt +88 -0
  83. package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugin_registrant.cc +11 -0
  84. package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugin_registrant.h +15 -0
  85. package/e2e-tests/test-applications/flutter-test-app/linux/flutter/generated_plugins.cmake +23 -0
  86. package/e2e-tests/test-applications/flutter-test-app/linux/main.cc +6 -0
  87. package/e2e-tests/test-applications/flutter-test-app/linux/my_application.cc +124 -0
  88. package/e2e-tests/test-applications/flutter-test-app/linux/my_application.h +18 -0
  89. package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/Flutter-Debug.xcconfig +2 -0
  90. package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/Flutter-Release.xcconfig +2 -0
  91. package/e2e-tests/test-applications/flutter-test-app/macos/Flutter/GeneratedPluginRegistrant.swift +10 -0
  92. package/e2e-tests/test-applications/flutter-test-app/macos/Podfile +43 -0
  93. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/AppDelegate.swift +9 -0
  94. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +68 -0
  95. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
  96. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png +0 -0
  97. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png +0 -0
  98. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png +0 -0
  99. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png +0 -0
  100. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png +0 -0
  101. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png +0 -0
  102. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Base.lproj/MainMenu.xib +343 -0
  103. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/AppInfo.xcconfig +14 -0
  104. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Debug.xcconfig +2 -0
  105. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Release.xcconfig +2 -0
  106. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Configs/Warnings.xcconfig +13 -0
  107. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/DebugProfile.entitlements +12 -0
  108. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Info.plist +32 -0
  109. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/MainFlutterWindow.swift +15 -0
  110. package/e2e-tests/test-applications/flutter-test-app/macos/Runner/Release.entitlements +8 -0
  111. package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/project.pbxproj +705 -0
  112. package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  113. package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +98 -0
  114. package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcworkspace/contents.xcworkspacedata +7 -0
  115. package/e2e-tests/test-applications/flutter-test-app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  116. package/e2e-tests/test-applications/flutter-test-app/macos/RunnerTests/RunnerTests.swift +12 -0
  117. package/e2e-tests/test-applications/flutter-test-app/pubspec.lock +213 -0
  118. package/e2e-tests/test-applications/flutter-test-app/pubspec.yaml +89 -0
  119. package/e2e-tests/test-applications/flutter-test-app/test/widget_test.dart +30 -0
  120. package/e2e-tests/test-applications/flutter-test-app/web/favicon.png +0 -0
  121. package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-192.png +0 -0
  122. package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-512.png +0 -0
  123. package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-maskable-192.png +0 -0
  124. package/e2e-tests/test-applications/flutter-test-app/web/icons/Icon-maskable-512.png +0 -0
  125. package/e2e-tests/test-applications/flutter-test-app/web/index.html +38 -0
  126. package/e2e-tests/test-applications/flutter-test-app/web/manifest.json +35 -0
  127. package/e2e-tests/test-applications/flutter-test-app/windows/CMakeLists.txt +108 -0
  128. package/e2e-tests/test-applications/flutter-test-app/windows/flutter/CMakeLists.txt +109 -0
  129. package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugin_registrant.cc +11 -0
  130. package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugin_registrant.h +15 -0
  131. package/e2e-tests/test-applications/flutter-test-app/windows/flutter/generated_plugins.cmake +23 -0
  132. package/e2e-tests/test-applications/flutter-test-app/windows/runner/CMakeLists.txt +40 -0
  133. package/e2e-tests/test-applications/flutter-test-app/windows/runner/Runner.rc +121 -0
  134. package/e2e-tests/test-applications/flutter-test-app/windows/runner/flutter_window.cpp +71 -0
  135. package/e2e-tests/test-applications/flutter-test-app/windows/runner/flutter_window.h +33 -0
  136. package/e2e-tests/test-applications/flutter-test-app/windows/runner/main.cpp +43 -0
  137. package/e2e-tests/test-applications/flutter-test-app/windows/runner/resource.h +16 -0
  138. package/e2e-tests/test-applications/flutter-test-app/windows/runner/resources/app_icon.ico +0 -0
  139. package/e2e-tests/test-applications/flutter-test-app/windows/runner/runner.exe.manifest +14 -0
  140. package/e2e-tests/test-applications/flutter-test-app/windows/runner/utils.cpp +65 -0
  141. package/e2e-tests/test-applications/flutter-test-app/windows/runner/utils.h +19 -0
  142. package/e2e-tests/test-applications/flutter-test-app/windows/runner/win32_window.cpp +288 -0
  143. package/e2e-tests/test-applications/flutter-test-app/windows/runner/win32_window.h +102 -0
  144. package/e2e-tests/test-applications/nextjs-test-app/package.json +1 -1
  145. package/e2e-tests/tests/flutter.test.ts +127 -0
  146. package/e2e-tests/tests/nextjs.test.ts +1 -1
  147. package/e2e-tests/tests/nuxt-3.test.ts +1 -1
  148. package/e2e-tests/tests/nuxt-4.test.ts +1 -1
  149. package/e2e-tests/tests/remix.test.ts +30 -19
  150. package/e2e-tests/tests/sveltekit.test.ts +79 -50
  151. package/e2e-tests/utils/index.ts +62 -2
  152. package/lib/Constants.ts +5 -0
  153. package/package.json +1 -1
  154. package/src/apple/apple-wizard.ts +1 -1
  155. package/src/apple/xcode-manager.ts +5 -5
  156. package/src/flutter/code-tools.ts +284 -0
  157. package/src/flutter/flutter-wizard.ts +164 -0
  158. package/src/flutter/templates.ts +90 -0
  159. package/src/nextjs/nextjs-wizard.ts +4 -1
  160. package/src/run.ts +7 -0
  161. package/src/sourcemaps/sourcemaps-wizard.ts +3 -7
  162. package/src/telemetry.ts +6 -2
  163. package/src/utils/clack-utils.ts +8 -5
  164. package/src/utils/package-manager.ts +8 -11
  165. package/test/flutter/code-tools.test.ts +212 -0
  166. package/test/flutter/templates.test.ts +100 -0
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //@ts-ignore
4
+ var code_tools_1 = require("../../src/flutter/code-tools");
5
+ //@ts-ignore
6
+ var templates_1 = require("../../src/flutter/templates");
7
+ describe('code-tools', function () {
8
+ var pubspec = "name: flutter_example\ndescription: An example flutter app.\nversion: 1.0.0\npublish_to: 'none' # Remove this line if you wish to publish to pub.dev\n\nenvironment:\n sdk: '>=2.17.0 <4.0.0'\n flutter: '>=3.0.0'\n\ndependencies:\n flutter:\n sdk: flutter\n\ndev_dependencies:\n flutter_lints: ^2.0.0\n";
9
+ var simpleRunApp = "import 'package:flutter/widgets.dart';\n\nvoid main() {\n runApp(const MyApp());\n}\n";
10
+ var asyncRunApp = "import 'package:flutter/widgets.dart';\n\nvoid main() {\n runApp(const MyApp());\n}\n";
11
+ var selectedFeaturesMap = {
12
+ tracing: true,
13
+ profiling: true,
14
+ };
15
+ var simpleRunAppPatched = "import 'package:flutter/widgets.dart';\nimport 'package:sentry_flutter/sentry_flutter.dart';\n\nFuture<void> main() async {\n ".concat((0, templates_1.initSnippet)('dsn', selectedFeaturesMap, 'const MyApp()'), "\n}\n");
16
+ var paramRunApp = "import 'package:flutter/widgets.dart';\n\nFuture<void> main() async {\n await someFunction();\n runApp(MyApp(param: SomeParam()));\n await anotherFunction();\n}\n";
17
+ var paramRunAppPatched = "import 'package:flutter/widgets.dart';\nimport 'package:sentry_flutter/sentry_flutter.dart';\n\nFuture<void> main() async {\n await someFunction();\n ".concat((0, templates_1.initSnippet)('dsn', selectedFeaturesMap, 'MyApp(param: SomeParam())'), "\n await anotherFunction();\n}\n");
18
+ var multilineRunApp = "import 'package:flutter/widgets.dart';\n\nvoid main() {\n runApp(\n MyApp(\n param: Param(),\n multi: Another(1),\n line: await bites(the: \"dust\"),\n ),\n );\n anotherFunction();\n}\n";
19
+ var multilineRunAppPatched = "import 'package:flutter/widgets.dart';\nimport 'package:sentry_flutter/sentry_flutter.dart';\n\nFuture<void> main() async {\n ".concat((0, templates_1.initSnippet)('dsn', selectedFeaturesMap, "\n MyApp(\n param: Param(),\n multi: Another(1),\n line: await bites(the: \"dust\"),\n ),\n "), "\n anotherFunction();\n}\n");
20
+ describe('patchMainContent', function () {
21
+ it('wraps simple runApp', function () {
22
+ expect((0, code_tools_1.patchMainContent)('dsn', simpleRunApp, selectedFeaturesMap)).toBe(simpleRunAppPatched);
23
+ });
24
+ it('wraps async runApp', function () {
25
+ expect((0, code_tools_1.patchMainContent)('dsn', asyncRunApp, selectedFeaturesMap)).toBe(simpleRunAppPatched);
26
+ });
27
+ it('wraps runApp with parameterized app', function () {
28
+ expect((0, code_tools_1.patchMainContent)('dsn', paramRunApp, selectedFeaturesMap)).toBe(paramRunAppPatched);
29
+ });
30
+ it('wraps multiline runApp', function () {
31
+ expect((0, code_tools_1.patchMainContent)('dsn', multilineRunApp, selectedFeaturesMap)).toBe(multilineRunAppPatched);
32
+ });
33
+ });
34
+ describe('pubspec', function () {
35
+ it('returns proper line index for dependencies', function () {
36
+ expect((0, code_tools_1.getDependenciesLocation)(pubspec)).toBe(pubspec.indexOf(' flutter:\n'));
37
+ });
38
+ it('returns proper line index for dev-dependencies', function () {
39
+ expect((0, code_tools_1.getDevDependenciesLocation)(pubspec)).toBe(pubspec.indexOf(' flutter_lints: ^2.0.0\n'));
40
+ });
41
+ });
42
+ describe('getLastImportLineLocation', function () {
43
+ it('returns proper line index', function () {
44
+ var code = "import 'foo:bar';\n" + "//<insert-location>\n" + "class X {}";
45
+ expect((0, code_tools_1.getLastImportLineLocation)(code)).toBe(code.indexOf('//<insert-location>'));
46
+ });
47
+ it('returns proper line index when alias import is used', function () {
48
+ var code = "import 'package:my_library/utils.dart' as utils;\n" +
49
+ "//<insert-location>\n" +
50
+ "class X {}";
51
+ expect((0, code_tools_1.getLastImportLineLocation)(code)).toBe(code.indexOf('//<insert-location>'));
52
+ });
53
+ it('returns proper line index when specific parts import is used', function () {
54
+ var code = "import 'dart:math' show pi, sin;\n" +
55
+ "//<insert-location>\n" +
56
+ "class X {}";
57
+ expect((0, code_tools_1.getLastImportLineLocation)(code)).toBe(code.indexOf('//<insert-location>'));
58
+ });
59
+ it('returns proper line index when hide import is used', function () {
60
+ var code = "import 'dart:math' hide Random;\n" +
61
+ "//<insert-location>\n" +
62
+ "class X {}";
63
+ expect((0, code_tools_1.getLastImportLineLocation)(code)).toBe(code.indexOf('//<insert-location>'));
64
+ });
65
+ it('returns proper line index when deferred import is used', function () {
66
+ var code = "import 'package:my_library/large_library.dart' deferred as largeLibrary;\n" +
67
+ "//<insert-location>\n" +
68
+ "class X {}";
69
+ expect((0, code_tools_1.getLastImportLineLocation)(code)).toBe(code.indexOf('//<insert-location>'));
70
+ });
71
+ it('returns proper line index when multiple imports (with newlines) are present', function () {
72
+ var code = "import 'foo:bar';\n" +
73
+ "import 'package:my_library/utils.dart' as utils;\n" +
74
+ "import 'dart:math' show pi, sin;\n" +
75
+ "import 'dart:math' hide Random;\n" +
76
+ "\n" +
77
+ "import 'package:my_library/large_library.dart' deferred as largeLibrary;\n" +
78
+ "//<insert-location>\n" +
79
+ "class X {}";
80
+ expect((0, code_tools_1.getLastImportLineLocation)(code)).toBe(code.indexOf('//<insert-location>'));
81
+ });
82
+ });
83
+ });
84
+ //# sourceMappingURL=code-tools.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-tools.test.js","sourceRoot":"","sources":["../../../test/flutter/code-tools.test.ts"],"names":[],"mappings":";;AAAA,YAAY;AACZ,2DAKsC;AACtC,YAAY;AACZ,yDAA0D;AAE1D,QAAQ,CAAC,YAAY,EAAE;IACrB,IAAM,OAAO,GAAG,qTAejB,CAAC;IAEA,IAAM,YAAY,GAAG,wFAKtB,CAAC;IAEA,IAAM,WAAW,GAAG,wFAKrB,CAAC;IAEA,IAAM,mBAAmB,GAAG;QAC1B,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,IAAI;KAChB,CAAC;IAEF,IAAM,mBAAmB,GAAG,yIAI1B,IAAA,uBAAW,EAAC,KAAK,EAAE,mBAAmB,EAAE,eAAe,CAAC,UAE3D,CAAC;IAEA,IAAM,WAAW,GAAG,uKAOrB,CAAC;IAEA,IAAM,kBAAkB,GAAG,kKAKzB,IAAA,uBAAW,EAAC,KAAK,EAAE,mBAAmB,EAAE,2BAA2B,CAAC,sCAGvE,CAAC;IAEA,IAAM,eAAe,GAAG,mNAYzB,CAAC;IAEA,IAAM,sBAAsB,GAAG,yIAI7B,IAAA,uBAAW,EACX,KAAK,EACL,mBAAmB,EACnB,oHAMD,CACA,gCAGF,CAAC;IAEA,QAAQ,CAAC,kBAAkB,EAAE;QAC3B,EAAE,CAAC,qBAAqB,EAAE;YACxB,MAAM,CAAC,IAAA,6BAAgB,EAAC,KAAK,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC,CAAC,IAAI,CACrE,mBAAmB,CACpB,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,oBAAoB,EAAE;YACvB,MAAM,CAAC,IAAA,6BAAgB,EAAC,KAAK,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC,IAAI,CACpE,mBAAmB,CACpB,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,EA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\n patchMainContent,\n getDependenciesLocation,\n getDevDependenciesLocation,\n getLastImportLineLocation,\n} from '../../src/flutter/code-tools';\n//@ts-ignore\nimport { initSnippet } from '../../src/flutter/templates';\n\ndescribe('code-tools', () => {\n const pubspec = `name: flutter_example\ndescription: An example flutter app.\nversion: 1.0.0\npublish_to: 'none' # Remove this line if you wish to publish to pub.dev\n\nenvironment:\n sdk: '>=2.17.0 <4.0.0'\n flutter: '>=3.0.0'\n\ndependencies:\n flutter:\n sdk: flutter\n\ndev_dependencies:\n flutter_lints: ^2.0.0\n`;\n\n const simpleRunApp = `import 'package:flutter/widgets.dart';\n\nvoid main() {\n runApp(const MyApp());\n}\n`;\n\n const asyncRunApp = `import 'package:flutter/widgets.dart';\n\nvoid main() {\n runApp(const MyApp());\n}\n`;\n\n const selectedFeaturesMap = {\n tracing: true,\n profiling: true,\n };\n\n const simpleRunAppPatched = `import 'package:flutter/widgets.dart';\nimport 'package:sentry_flutter/sentry_flutter.dart';\n\nFuture<void> main() async {\n ${initSnippet('dsn', selectedFeaturesMap, 'const MyApp()')}\n}\n`;\n\n const paramRunApp = `import 'package:flutter/widgets.dart';\n\nFuture<void> main() async {\n await someFunction();\n runApp(MyApp(param: SomeParam()));\n await anotherFunction();\n}\n`;\n\n const paramRunAppPatched = `import 'package:flutter/widgets.dart';\nimport 'package:sentry_flutter/sentry_flutter.dart';\n\nFuture<void> main() async {\n await someFunction();\n ${initSnippet('dsn', selectedFeaturesMap, 'MyApp(param: SomeParam())')}\n await anotherFunction();\n}\n`;\n\n const multilineRunApp = `import 'package:flutter/widgets.dart';\n\nvoid main() {\n runApp(\n MyApp(\n param: Param(),\n multi: Another(1),\n line: await bites(the: \"dust\"),\n ),\n );\n anotherFunction();\n}\n`;\n\n const multilineRunAppPatched = `import 'package:flutter/widgets.dart';\nimport 'package:sentry_flutter/sentry_flutter.dart';\n\nFuture<void> main() async {\n ${initSnippet(\n 'dsn',\n selectedFeaturesMap,\n `\n MyApp(\n param: Param(),\n multi: Another(1),\n line: await bites(the: \"dust\"),\n ),\n `,\n )}\n anotherFunction();\n}\n`;\n\n describe('patchMainContent', () => {\n it('wraps simple runApp', () => {\n expect(patchMainContent('dsn', simpleRunApp, selectedFeaturesMap)).toBe(\n simpleRunAppPatched,\n );\n });\n\n it('wraps async runApp', () => {\n expect(patchMainContent('dsn', asyncRunApp, selectedFeaturesMap)).toBe(\n simpleRunAppPatched,\n );\n });\n\n it('wraps runApp with parameterized app', () => {\n expect(patchMainContent('dsn', paramRunApp, selectedFeaturesMap)).toBe(\n paramRunAppPatched,\n );\n });\n\n it('wraps multiline runApp', () => {\n expect(\n patchMainContent('dsn', multilineRunApp, selectedFeaturesMap),\n ).toBe(multilineRunAppPatched);\n });\n });\n\n describe('pubspec', () => {\n it('returns proper line index for dependencies', () => {\n expect(getDependenciesLocation(pubspec)).toBe(\n pubspec.indexOf(' flutter:\\n'),\n );\n });\n\n it('returns proper line index for dev-dependencies', () => {\n expect(getDevDependenciesLocation(pubspec)).toBe(\n pubspec.indexOf(' flutter_lints: ^2.0.0\\n'),\n );\n });\n });\n\n describe('getLastImportLineLocation', () => {\n it('returns proper line index', () => {\n const code =\n `import 'foo:bar';\\n` + `//<insert-location>\\n` + `class X {}`;\n expect(getLastImportLineLocation(code)).toBe(\n code.indexOf('//<insert-location>'),\n );\n });\n\n it('returns proper line index when alias import is used', () => {\n const code =\n `import 'package:my_library/utils.dart' as utils;\\n` +\n `//<insert-location>\\n` +\n `class X {}`;\n expect(getLastImportLineLocation(code)).toBe(\n code.indexOf('//<insert-location>'),\n );\n });\n\n it('returns proper line index when specific parts import is used', () => {\n const code =\n `import 'dart:math' show pi, sin;\\n` +\n `//<insert-location>\\n` +\n `class X {}`;\n expect(getLastImportLineLocation(code)).toBe(\n code.indexOf('//<insert-location>'),\n );\n });\n\n it('returns proper line index when hide import is used', () => {\n const code =\n `import 'dart:math' hide Random;\\n` +\n `//<insert-location>\\n` +\n `class X {}`;\n expect(getLastImportLineLocation(code)).toBe(\n code.indexOf('//<insert-location>'),\n );\n });\n\n it('returns proper line index when deferred import is used', () => {\n const code =\n `import 'package:my_library/large_library.dart' deferred as largeLibrary;\\n` +\n `//<insert-location>\\n` +\n `class X {}`;\n expect(getLastImportLineLocation(code)).toBe(\n code.indexOf('//<insert-location>'),\n );\n });\n\n it('returns proper line index when multiple imports (with newlines) are present', () => {\n const code =\n `import 'foo:bar';\\n` +\n `import 'package:my_library/utils.dart' as utils;\\n` +\n `import 'dart:math' show pi, sin;\\n` +\n `import 'dart:math' hide Random;\\n` +\n `\\n` +\n `import 'package:my_library/large_library.dart' deferred as largeLibrary;\\n` +\n `//<insert-location>\\n` +\n `class X {}`;\n expect(getLastImportLineLocation(code)).toBe(\n code.indexOf('//<insert-location>'),\n );\n });\n });\n});\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var templates_1 = require("../../src/flutter/templates");
4
+ describe('Flutter code templates', function () {
5
+ describe('pubspec', function () {
6
+ it('generates pubspec with project and org', function () {
7
+ var template = (0, templates_1.pubspecOptions)('fixture-project', 'fixture-org');
8
+ expect(template).toMatchInlineSnapshot("\n \"sentry:\n upload_debug_symbols: true\n upload_source_maps: true\n project: fixture-project\n org: fixture-org\n \"\n ");
9
+ });
10
+ });
11
+ describe('sentry.properties', function () {
12
+ it('generates sentry.properties with token', function () {
13
+ var template = (0, templates_1.sentryProperties)('fixture-token');
14
+ expect(template).toMatchInlineSnapshot("\"auth_token=fixture-token\"");
15
+ });
16
+ });
17
+ describe('init', function () {
18
+ it('generates Sentry config with all features enabled', function () {
19
+ var template = (0, templates_1.initSnippet)('my-dsn', {
20
+ tracing: true,
21
+ profiling: true,
22
+ }, 'const MyApp()');
23
+ expect(template).toMatchInlineSnapshot("\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0;\n // The sampling rate for profiling is relative to tracesSampleRate\n // Setting to 1.0 will profile 100% of sampled transactions:\n options.profilesSampleRate = 1.0;\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n ");
24
+ });
25
+ it('generates Sentry config with profiling disabled', function () {
26
+ var template = (0, templates_1.initSnippet)('my-dsn', {
27
+ tracing: true,
28
+ profiling: false,
29
+ }, 'const MyApp()');
30
+ expect(template).toMatchInlineSnapshot("\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0;\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n ");
31
+ });
32
+ it('generates Sentry config with tracing disabled', function () {
33
+ var template = (0, templates_1.initSnippet)('my-dsn', {
34
+ tracing: false,
35
+ profiling: false,
36
+ }, 'const MyApp()');
37
+ expect(template).toMatchInlineSnapshot("\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n ");
38
+ });
39
+ });
40
+ });
41
+ //# sourceMappingURL=templates.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/flutter/templates.test.ts"],"names":[],"mappings":";;AAAA,yDAIqC;AAErC,QAAQ,CAAC,wBAAwB,EAAE;IACjC,QAAQ,CAAC,SAAS,EAAE;QAClB,EAAE,CAAC,wCAAwC,EAAE;YAC3C,IAAM,QAAQ,GAAG,IAAA,0BAAc,EAAC,iBAAiB,EAAE,aAAa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,CAAC","sourcesContent":["import {\n pubspecOptions,\n sentryProperties,\n initSnippet,\n} from '../../src/flutter/templates';\n\ndescribe('Flutter code templates', () => {\n describe('pubspec', () => {\n it('generates pubspec with project and org', () => {\n const template = pubspecOptions('fixture-project', 'fixture-org');\n expect(template).toMatchInlineSnapshot(`\n \"sentry:\n upload_debug_symbols: true\n upload_source_maps: true\n project: fixture-project\n org: fixture-org\n \"\n `);\n });\n });\n describe('sentry.properties', () => {\n it('generates sentry.properties with token', () => {\n const template = sentryProperties('fixture-token');\n expect(template).toMatchInlineSnapshot(`\"auth_token=fixture-token\"`);\n });\n });\n describe('init', () => {\n it('generates Sentry config with all features enabled', () => {\n const template = initSnippet(\n 'my-dsn',\n {\n tracing: true,\n profiling: true,\n },\n 'const MyApp()',\n );\n expect(template).toMatchInlineSnapshot(`\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0;\n // The sampling rate for profiling is relative to tracesSampleRate\n // Setting to 1.0 will profile 100% of sampled transactions:\n options.profilesSampleRate = 1.0;\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n `);\n });\n\n it('generates Sentry config with profiling disabled', () => {\n const template = initSnippet(\n 'my-dsn',\n {\n tracing: true,\n profiling: false,\n },\n 'const MyApp()',\n );\n expect(template).toMatchInlineSnapshot(`\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0;\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n `);\n });\n\n it('generates Sentry config with tracing disabled', () => {\n const template = initSnippet(\n 'my-dsn',\n {\n tracing: false,\n profiling: false,\n },\n 'const MyApp()',\n );\n expect(template).toMatchInlineSnapshot(`\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n `);\n });\n });\n});\n"]}
@@ -4,10 +4,12 @@
4
4
 
5
5
  ```
6
6
  test-applications/
7
+ |---- flutter-test-app/
7
8
  |---- nextjs-test-app/
8
9
  |---- remix-test-app/
9
10
  |---- sveltekit-test-app/
10
11
  tests/
12
+ |---- flutter.test.ts
11
13
  |---- nextjs.test.ts
12
14
  |---- remix.test.ts
13
15
  |---- sveltekit.test.ts
@@ -37,6 +39,8 @@ tests/
37
39
  - `checkIfRunsOnDevMode` - Checks if the test project runs on dev mode successfully.
38
40
  - `checkIfRunsOnProdMode` - Checks if the test project runs on prod mode successfully.
39
41
 
42
+ - `checkIfFlutterBuilds` - Checks if the Flutter (Web) test project builds successfully.
43
+ - `checkSentryProperties` - Checks if the Flutter `sentry.properties` file contains the auth token
40
44
 
41
45
  #### `WizardTestEnv`
42
46
 
@@ -52,7 +56,7 @@ Tests can be run locally from the root of the project with:
52
56
 
53
57
  To run a specific test application
54
58
 
55
- `yarn test:e2e [Remix | NextJS | SvelteKit]`
59
+ `yarn test:e2e [Flutter | Remix | NextJS | SvelteKit]`
56
60
 
57
61
  ## Writing Tests
58
62
 
@@ -0,0 +1,45 @@
1
+ # This file tracks properties of this Flutter project.
2
+ # Used by Flutter tool to assess capabilities and perform upgrades etc.
3
+ #
4
+ # This file should be version controlled and should not be manually edited.
5
+
6
+ version:
7
+ revision: "dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668"
8
+ channel: "stable"
9
+
10
+ project_type: app
11
+
12
+ # Tracks metadata for the flutter migrate command
13
+ migration:
14
+ platforms:
15
+ - platform: root
16
+ create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
17
+ base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
18
+ - platform: android
19
+ create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
20
+ base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
21
+ - platform: ios
22
+ create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
23
+ base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
24
+ - platform: linux
25
+ create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
26
+ base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
27
+ - platform: macos
28
+ create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
29
+ base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
30
+ - platform: web
31
+ create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
32
+ base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
33
+ - platform: windows
34
+ create_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
35
+ base_revision: dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668
36
+
37
+ # User provided section
38
+
39
+ # List of Local paths (relative to this file) that should be
40
+ # ignored by the migrate tool.
41
+ #
42
+ # Files that are not part of the templates will be ignored by default.
43
+ unmanaged_files:
44
+ - 'lib/main.dart'
45
+ - 'ios/Runner.xcodeproj/project.pbxproj'
@@ -0,0 +1,16 @@
1
+ # flutter_magic
2
+
3
+ A new Flutter project.
4
+
5
+ ## Getting Started
6
+
7
+ This project is a starting point for a Flutter application.
8
+
9
+ A few resources to get you started if this is your first Flutter project:
10
+
11
+ - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12
+ - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13
+
14
+ For help getting started with Flutter development, view the
15
+ [online documentation](https://docs.flutter.dev/), which offers tutorials,
16
+ samples, guidance on mobile development, and a full API reference.
@@ -0,0 +1,28 @@
1
+ # This file configures the analyzer, which statically analyzes Dart code to
2
+ # check for errors, warnings, and lints.
3
+ #
4
+ # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5
+ # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6
+ # invoked from the command line by running `flutter analyze`.
7
+
8
+ # The following line activates a set of recommended lints for Flutter apps,
9
+ # packages, and plugins designed to encourage good coding practices.
10
+ include: package:flutter_lints/flutter.yaml
11
+
12
+ linter:
13
+ # The lint rules applied to this project can be customized in the
14
+ # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15
+ # included above or to enable additional rules. A list of all available lints
16
+ # and their documentation is published at https://dart.dev/lints.
17
+ #
18
+ # Instead of disabling a lint rule for the entire project in the
19
+ # section below, it can also be suppressed for a single line of code
20
+ # or a specific dart file by using the `// ignore: name_of_lint` and
21
+ # `// ignore_for_file: name_of_lint` syntax on the line or in the file
22
+ # producing the lint.
23
+ rules:
24
+ # avoid_print: false # Uncomment to disable the `avoid_print` rule
25
+ # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26
+
27
+ # Additional information about this file can be found at
28
+ # https://dart.dev/guides/language/analysis-options
@@ -0,0 +1,44 @@
1
+ plugins {
2
+ id "com.android.application"
3
+ id "kotlin-android"
4
+ // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5
+ id "dev.flutter.flutter-gradle-plugin"
6
+ }
7
+
8
+ android {
9
+ namespace = "com.example.flutter_magic"
10
+ compileSdk = flutter.compileSdkVersion
11
+ ndkVersion = flutter.ndkVersion
12
+
13
+ compileOptions {
14
+ sourceCompatibility = JavaVersion.VERSION_1_8
15
+ targetCompatibility = JavaVersion.VERSION_1_8
16
+ }
17
+
18
+ kotlinOptions {
19
+ jvmTarget = JavaVersion.VERSION_1_8
20
+ }
21
+
22
+ defaultConfig {
23
+ // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24
+ applicationId = "com.example.flutter_magic"
25
+ // You can update the following values to match your application needs.
26
+ // For more information, see: https://flutter.dev/to/review-gradle-config.
27
+ minSdk = flutter.minSdkVersion
28
+ targetSdk = flutter.targetSdkVersion
29
+ versionCode = flutter.versionCode
30
+ versionName = flutter.versionName
31
+ }
32
+
33
+ buildTypes {
34
+ release {
35
+ // TODO: Add your own signing config for the release build.
36
+ // Signing with the debug keys for now, so `flutter run --release` works.
37
+ signingConfig = signingConfigs.debug
38
+ }
39
+ }
40
+ }
41
+
42
+ flutter {
43
+ source = "../.."
44
+ }
@@ -0,0 +1,7 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ <!-- The INTERNET permission is required for development. Specifically,
3
+ the Flutter tool needs it to communicate with the running application
4
+ to allow setting breakpoints, to provide hot reload, etc.
5
+ -->
6
+ <uses-permission android:name="android.permission.INTERNET"/>
7
+ </manifest>
@@ -0,0 +1,45 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ <application
3
+ android:label="flutter_magic"
4
+ android:name="${applicationName}"
5
+ android:icon="@mipmap/ic_launcher">
6
+ <activity
7
+ android:name=".MainActivity"
8
+ android:exported="true"
9
+ android:launchMode="singleTop"
10
+ android:taskAffinity=""
11
+ android:theme="@style/LaunchTheme"
12
+ android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
13
+ android:hardwareAccelerated="true"
14
+ android:windowSoftInputMode="adjustResize">
15
+ <!-- Specifies an Android theme to apply to this Activity as soon as
16
+ the Android process has started. This theme is visible to the user
17
+ while the Flutter UI initializes. After that, this theme continues
18
+ to determine the Window background behind the Flutter UI. -->
19
+ <meta-data
20
+ android:name="io.flutter.embedding.android.NormalTheme"
21
+ android:resource="@style/NormalTheme"
22
+ />
23
+ <intent-filter>
24
+ <action android:name="android.intent.action.MAIN"/>
25
+ <category android:name="android.intent.category.LAUNCHER"/>
26
+ </intent-filter>
27
+ </activity>
28
+ <!-- Don't delete the meta-data below.
29
+ This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
30
+ <meta-data
31
+ android:name="flutterEmbedding"
32
+ android:value="2" />
33
+ </application>
34
+ <!-- Required to query activities that can process text, see:
35
+ https://developer.android.com/training/package-visibility and
36
+ https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
37
+
38
+ In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
39
+ <queries>
40
+ <intent>
41
+ <action android:name="android.intent.action.PROCESS_TEXT"/>
42
+ <data android:mimeType="text/plain"/>
43
+ </intent>
44
+ </queries>
45
+ </manifest>
@@ -0,0 +1,5 @@
1
+ package com.example.flutter_magic
2
+
3
+ import io.flutter.embedding.android.FlutterActivity
4
+
5
+ class MainActivity: FlutterActivity()
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Modify this file to customize your launch splash screen -->
3
+ <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4
+ <item android:drawable="@android:color/white" />
5
+
6
+ <!-- You can insert your own image assets here -->
7
+ <!-- <item>
8
+ <bitmap
9
+ android:gravity="center"
10
+ android:src="@mipmap/launch_image" />
11
+ </item> -->
12
+ </layer-list>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Modify this file to customize your launch splash screen -->
3
+ <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4
+ <item android:drawable="?android:colorBackground" />
5
+
6
+ <!-- You can insert your own image assets here -->
7
+ <!-- <item>
8
+ <bitmap
9
+ android:gravity="center"
10
+ android:src="@mipmap/launch_image" />
11
+ </item> -->
12
+ </layer-list>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <resources>
3
+ <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
4
+ <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
5
+ <!-- Show a splash screen on the activity. Automatically removed when
6
+ the Flutter engine draws its first frame -->
7
+ <item name="android:windowBackground">@drawable/launch_background</item>
8
+ </style>
9
+ <!-- Theme applied to the Android Window as soon as the process has started.
10
+ This theme determines the color of the Android Window while your
11
+ Flutter UI initializes, as well as behind your Flutter UI while its
12
+ running.
13
+
14
+ This Theme is only used starting with V2 of Flutter's Android embedding. -->
15
+ <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
16
+ <item name="android:windowBackground">?android:colorBackground</item>
17
+ </style>
18
+ </resources>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <resources>
3
+ <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
4
+ <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
5
+ <!-- Show a splash screen on the activity. Automatically removed when
6
+ the Flutter engine draws its first frame -->
7
+ <item name="android:windowBackground">@drawable/launch_background</item>
8
+ </style>
9
+ <!-- Theme applied to the Android Window as soon as the process has started.
10
+ This theme determines the color of the Android Window while your
11
+ Flutter UI initializes, as well as behind your Flutter UI while its
12
+ running.
13
+
14
+ This Theme is only used starting with V2 of Flutter's Android embedding. -->
15
+ <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
16
+ <item name="android:windowBackground">?android:colorBackground</item>
17
+ </style>
18
+ </resources>
@@ -0,0 +1,7 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ <!-- The INTERNET permission is required for development. Specifically,
3
+ the Flutter tool needs it to communicate with the running application
4
+ to allow setting breakpoints, to provide hot reload, etc.
5
+ -->
6
+ <uses-permission android:name="android.permission.INTERNET"/>
7
+ </manifest>
@@ -0,0 +1,18 @@
1
+ allprojects {
2
+ repositories {
3
+ google()
4
+ mavenCentral()
5
+ }
6
+ }
7
+
8
+ rootProject.buildDir = "../build"
9
+ subprojects {
10
+ project.buildDir = "${rootProject.buildDir}/${project.name}"
11
+ }
12
+ subprojects {
13
+ project.evaluationDependsOn(":app")
14
+ }
15
+
16
+ tasks.register("clean", Delete) {
17
+ delete rootProject.buildDir
18
+ }
@@ -0,0 +1,5 @@
1
+ distributionBase=GRADLE_USER_HOME
2
+ distributionPath=wrapper/dists
3
+ zipStoreBase=GRADLE_USER_HOME
4
+ zipStorePath=wrapper/dists
5
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
@@ -0,0 +1,3 @@
1
+ org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
2
+ android.useAndroidX=true
3
+ android.enableJetifier=true
@@ -0,0 +1,25 @@
1
+ pluginManagement {
2
+ def flutterSdkPath = {
3
+ def properties = new Properties()
4
+ file("local.properties").withInputStream { properties.load(it) }
5
+ def flutterSdkPath = properties.getProperty("flutter.sdk")
6
+ assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7
+ return flutterSdkPath
8
+ }()
9
+
10
+ includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11
+
12
+ repositories {
13
+ google()
14
+ mavenCentral()
15
+ gradlePluginPortal()
16
+ }
17
+ }
18
+
19
+ plugins {
20
+ id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21
+ id "com.android.application" version "8.1.0" apply false
22
+ id "org.jetbrains.kotlin.android" version "1.8.22" apply false
23
+ }
24
+
25
+ include ":app"