-
Notifications
You must be signed in to change notification settings - Fork 607
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace testbed/ with plugin examples (#913)
The testbed/ directory is a relic of a much earlier stage of desktop development, when maintaining apps was cumbersome (because they had to be recreated from scratch on a regular basis, before the template stabilized) and it was useful to have a desktop-enabled example handy for basic functionality like scrolling and typing that were still being implemented. This removes testbed/, and replaces it with standard in-package examples for the two remaining plugins (the other purpose of testbed). Each is created with `flutter create -t plugin .` with the following changes: - Removed all the template comments. - Removed the template-standard used of `flutter_lints` (as the repo uses flutter/plugins-based lints). - Added the copyright notice. - Changed the example Dart code: - `menubar`'s example is the counter app, but with the resize-on-launch logic taken from `testbed`. - `testbed`'s example is testbed's code, but with the keyboard and scrolling parts removed. - Changed the template-standard integration test to be a simple sanity check that calling the plugin works. - Removed the (new!) template-standard macOS native unit tests, since backfilling unit tests is out of scope here. The scaffolding is still in place in case we want to add some later. Having the standard example structure will make the plugins easier to maintain when we do need to touch them, and easier for people to find out how to use. Tangential change: - Updates the CI hosts since the macOS and Linux hosts that were there are deprecated.
- Loading branch information
1 parent
17d4710
commit 6c66ad2
Showing
153 changed files
with
4,871 additions
and
1,465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
migrate_working_dir/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks you configure in | ||
# VS Code which you may wish to be included in version control, so this line | ||
# is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
**/doc/api/ | ||
**/ios/Flutter/.last_build_id | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.packages | ||
.pub-cache/ | ||
.pub/ | ||
/build/ | ||
|
||
# Symbolication related | ||
app.*.symbols | ||
|
||
# Obfuscation related | ||
app.*.map.json | ||
|
||
# Android Studio will place build artifacts here | ||
/android/app/debug | ||
/android/app/profile | ||
/android/app/release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# menubar_example | ||
|
||
Demonstrates how to use the menubar plugin. | ||
|
||
## Getting Started | ||
|
||
This project is a starting point for a Flutter application. | ||
|
||
A few resources to get you started if this is your first Flutter project: | ||
|
||
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) | ||
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) | ||
|
||
For help getting started with Flutter development, view the | ||
[online documentation](https://docs.flutter.dev/), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. |
45 changes: 45 additions & 0 deletions
45
plugins/menubar/example/integration_test/plugin_integration_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2018 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
|
||
import 'package:menubar/menubar.dart'; | ||
|
||
void main() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
testWidgets('sanity check', (tester) async { | ||
expect( | ||
setApplicationMenu([ | ||
NativeSubmenu(label: 'Test', children: [ | ||
NativeMenuItem( | ||
label: '1', | ||
shortcut: LogicalKeySet( | ||
LogicalKeyboardKey.meta, LogicalKeyboardKey.keyA), | ||
onSelected: () {}), | ||
const NativeMenuDivider(), | ||
NativeSubmenu(label: 'Presets', children: [ | ||
NativeMenuItem( | ||
label: '2', | ||
shortcut: LogicalKeySet(LogicalKeyboardKey.meta, | ||
LogicalKeyboardKey.shift, LogicalKeyboardKey.keyB), | ||
onSelected: null), | ||
]) | ||
]), | ||
]), | ||
completes); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.