Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>13.0</string>
</dict>
</plist>
42 changes: 24 additions & 18 deletions examples/configurable_widget/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
3ABA07602CC99AAC003690EA /* ConfigurableWidgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 3ABA074E2CC99AAB003690EA /* ConfigurableWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
Expand Down Expand Up @@ -106,6 +107,7 @@
597C0A8859FF5FE53881B41E /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
8343A354E29ABB27FAA47F30 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
83DB0F8D7AA5CB93B210FE96 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -144,6 +146,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
046A1AF646EFE7C0B8E078B6 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -210,6 +213,7 @@
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
Expand Down Expand Up @@ -326,7 +330,6 @@
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3ABA07612CC99AAC003690EA /* Embed Foundation Extensions */,
D2258577D38C7C118A268941 /* [CP] Embed Pods Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
);
buildRules = (
Expand All @@ -336,6 +339,9 @@
3A273FFF2D62647200574BA7 /* PBXTargetDependency */,
);
name = Runner;
packageProductDependencies = (
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
);
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
Expand Down Expand Up @@ -376,6 +382,9 @@
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
packageReferences = (
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
);
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -478,23 +487,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
D2258577D38C7C118A268941 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
E8BBFC077CA9C00B509D3353 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -1176,6 +1168,20 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCLocalSwiftPackageReference section */
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
};
/* End XCLocalSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
isa = XCSwiftPackageProductDependency;
productName = FlutterGeneratedPluginSwiftPackage;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Prepare Flutter Framework Script"
scriptText = "/bin/sh &quot;$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh&quot; prepare&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
22 changes: 10 additions & 12 deletions examples/configurable_widget/lib/android_configuration_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class _AndroidConfigurationPageState extends State<AndroidConfigurationPage> {
_textEditingController.text = storedName ?? 'World';
_punctuation =
storedPunctuation != null && punctuations.contains(storedPunctuation)
? storedPunctuation
: punctuations.first;
? storedPunctuation
: punctuations.first;
_initialized = true;
});
}
Expand All @@ -59,9 +59,7 @@ class _AndroidConfigurationPageState extends State<AndroidConfigurationPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Configure widget'),
),
appBar: AppBar(title: const Text('Configure widget')),
body: _initialized
? ListView(
children: [
Expand All @@ -88,18 +86,18 @@ class _AndroidConfigurationPageState extends State<AndroidConfigurationPage> {
});
},
items: punctuations
.map((option) => DropdownMenuItem(
value: option,
child: Text(option),
))
.map(
(option) => DropdownMenuItem(
value: option,
child: Text(option),
),
)
.toList(),
),
),
],
)
: const Center(
child: CircularProgressIndicator(),
),
: const Center(child: CircularProgressIndicator()),
bottomNavigationBar: _initialized
? Container(
color: Theme.of(context).colorScheme.surface,
Expand Down
34 changes: 17 additions & 17 deletions examples/configurable_widget/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ Future<void> configureMain() async {
await HomeWidget.initiallyLaunchedFromHomeWidgetConfigure();

if (configuredWidgetId != null) {
return runApp(MaterialApp(
home: AndroidConfigurationPage(widgetId: configuredWidgetId)));
return runApp(
MaterialApp(
home: AndroidConfigurationPage(widgetId: configuredWidgetId),
),
);
}
}
return main();
Expand All @@ -44,10 +47,7 @@ Future<void> _initPunctuations() async {
// Needed for communication between the app and the widget
await HomeWidget.setAppGroupId('group.es.antonborri.configurableWidget');
// Save the punctuations to the widget
await HomeWidget.saveWidgetData(
'punctuations',
jsonEncode(punctuations),
);
await HomeWidget.saveWidgetData('punctuations', jsonEncode(punctuations));
}

class MainApp extends StatefulWidget {
Expand Down Expand Up @@ -79,12 +79,10 @@ class _MainAppState extends State<MainApp> {
int widgetId,
) async {
final name = await HomeWidget.getWidgetData<String>('name.$widgetId');
final punctuation =
await HomeWidget.getWidgetData<String>('punctuation.$widgetId');
return <String, dynamic>{
'name': name,
'punctuation': punctuation,
};
final punctuation = await HomeWidget.getWidgetData<String>(
'punctuation.$widgetId',
);
return <String, dynamic>{'name': name, 'punctuation': punctuation};
}

/// Loads pinned home screen widget instances (Android: per instance; iOS: per kind).
Expand All @@ -95,13 +93,15 @@ class _MainAppState extends State<MainApp> {
for (final w in installedWidgets) {
Map<String, dynamic>? configuration;
if (Platform.isAndroid && w.androidWidgetId != null) {
configuration =
await _androidConfigurationFromStorage(w.androidWidgetId!);
configuration = await _androidConfigurationFromStorage(
w.androidWidgetId!,
);
} else if (Platform.isIOS && w.configuration != null) {
configuration = Map<String, dynamic>.from(w.configuration!);
}
entries
.add(_InstalledWidgetEntry(info: w, configuration: configuration));
entries.add(
_InstalledWidgetEntry(info: w, configuration: configuration),
);
}
if (!mounted) return;
setState(() {
Expand Down Expand Up @@ -141,7 +141,7 @@ class _MainAppState extends State<MainApp> {
IconButton(
icon: const Icon(Icons.refresh),
onPressed: _getInstalledWidgets,
)
),
],
),
body: _installedWidgets.isEmpty
Expand Down
3 changes: 2 additions & 1 deletion examples/configurable_widget/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ publish_to: 'none'
version: 0.1.0

environment:
sdk: '>=3.5.0 <4.0.0'
sdk: '>=3.10.0 <4.0.0'
flutter: '>=3.38.1'

resolution: workspace

Expand Down
2 changes: 0 additions & 2 deletions examples/file_and_images/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>13.0</string>
</dict>
</plist>
Loading
Loading