Skip to content

Commit 94985ea

Browse files
committed
chore: scaffolded plugin
0 parents  commit 94985ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2198
-0
lines changed

.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26+
/pubspec.lock
27+
**/doc/api/
28+
.dart_tool/
29+
.packages
30+
build/

.metadata

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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: "2524052335ec76bb03e04ede244b071f1b86d190"
8+
channel: "stable"
9+
10+
project_type: plugin
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 2524052335ec76bb03e04ede244b071f1b86d190
17+
base_revision: 2524052335ec76bb03e04ede244b071f1b86d190
18+
- platform: windows
19+
create_revision: 2524052335ec76bb03e04ede244b071f1b86d190
20+
base_revision: 2524052335ec76bb03e04ede244b071f1b86d190
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
* TODO: Describe initial release.

LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TODO: Add your license here.

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# windows_store
2+
3+
A new Flutter plugin project.
4+
5+
## Getting Started
6+
7+
This project is a starting point for a Flutter
8+
[plug-in package](https://flutter.dev/developing-packages/),
9+
a specialized package that includes platform-specific implementation code for
10+
Android and/or iOS.
11+
12+
For help getting started with Flutter development, view the
13+
[online documentation](https://flutter.dev/docs), which offers tutorials,
14+
samples, guidance on mobile development, and a full API reference.
15+

analysis_options.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
# Additional information about this file can be found at
4+
# https://dart.dev/guides/language/analysis-options

example/.gitignore

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
**/doc/api/
26+
**/ios/Flutter/.last_build_id
27+
.dart_tool/
28+
.flutter-plugins
29+
.flutter-plugins-dependencies
30+
.packages
31+
.pub-cache/
32+
.pub/
33+
/build/
34+
35+
# Symbolication related
36+
app.*.symbols
37+
38+
# Obfuscation related
39+
app.*.map.json
40+
41+
# Android Studio will place build artifacts here
42+
/android/app/debug
43+
/android/app/profile
44+
/android/app/release

example/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# windows_store_example
2+
3+
Demonstrates how to use the windows_store plugin.
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.

example/analysis_options.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// This is a basic Flutter integration test.
2+
//
3+
// Since integration tests run in a full Flutter application, they can interact
4+
// with the host side of a plugin implementation, unlike Dart unit tests.
5+
//
6+
// For more information about Flutter integration tests, please see
7+
// https://docs.flutter.dev/cookbook/testing/integration/introduction
8+
9+
10+
import 'package:flutter_test/flutter_test.dart';
11+
import 'package:integration_test/integration_test.dart';
12+
13+
import 'package:windows_store/windows_store.dart';
14+
15+
void main() {
16+
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
17+
18+
testWidgets('getPlatformVersion test', (WidgetTester tester) async {
19+
final WindowsStore plugin = WindowsStore();
20+
final String? version = await plugin.getPlatformVersion();
21+
// The version string depends on the host platform running the test, so
22+
// just assert that some non-empty string is returned.
23+
expect(version?.isNotEmpty, true);
24+
});
25+
}

example/lib/main.dart

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import 'package:flutter/material.dart';
2+
import 'dart:async';
3+
4+
import 'package:flutter/services.dart';
5+
import 'package:windows_store/windows_store.dart';
6+
7+
void main() {
8+
runApp(const MyApp());
9+
}
10+
11+
class MyApp extends StatefulWidget {
12+
const MyApp({super.key});
13+
14+
@override
15+
State<MyApp> createState() => _MyAppState();
16+
}
17+
18+
class _MyAppState extends State<MyApp> {
19+
String _platformVersion = 'Unknown';
20+
final _windowsStorePlugin = WindowsStore();
21+
22+
@override
23+
void initState() {
24+
super.initState();
25+
initPlatformState();
26+
}
27+
28+
// Platform messages are asynchronous, so we initialize in an async method.
29+
Future<void> initPlatformState() async {
30+
String platformVersion;
31+
// Platform messages may fail, so we use a try/catch PlatformException.
32+
// We also handle the message potentially returning null.
33+
try {
34+
platformVersion =
35+
await _windowsStorePlugin.getPlatformVersion() ?? 'Unknown platform version';
36+
} on PlatformException {
37+
platformVersion = 'Failed to get platform version.';
38+
}
39+
40+
// If the widget was removed from the tree while the asynchronous platform
41+
// message was in flight, we want to discard the reply rather than calling
42+
// setState to update our non-existent appearance.
43+
if (!mounted) return;
44+
45+
setState(() {
46+
_platformVersion = platformVersion;
47+
});
48+
}
49+
50+
@override
51+
Widget build(BuildContext context) {
52+
return MaterialApp(
53+
home: Scaffold(
54+
appBar: AppBar(
55+
title: const Text('Plugin example app'),
56+
),
57+
body: Center(
58+
child: Text('Running on: $_platformVersion\n'),
59+
),
60+
),
61+
);
62+
}
63+
}

0 commit comments

Comments
 (0)