Skip to content
Merged
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
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

2 changes: 1 addition & 1 deletion packages/camera/camera/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Camera Plugin

<?code-excerpt path-base="excerpts/packages/camera_example"?>
<?code-excerpt path-base="example/lib"?>

[![pub package](https://img.shields.io/pub/v/camera.svg)](https://pub.dev/packages/camera)

Expand Down
15 changes: 0 additions & 15 deletions packages/camera/camera/example/build.excerpt.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions packages/file_selector/file_selector/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# file_selector

<?code-excerpt path-base="excerpts/packages/file_selector_example"?>
<?code-excerpt path-base="example/lib"?>

[![pub package](https://img.shields.io/pub/v/file_selector.svg)](https://pub.dartlang.org/packages/file_selector)

Expand Down Expand Up @@ -36,7 +36,7 @@ Please also take a look at our [example][example] app.
#### Open a single file

<?code-excerpt "open_image_page.dart (SingleOpen)"?>
``` dart
```dart
const XTypeGroup typeGroup = XTypeGroup(
label: 'images',
extensions: <String>['jpg', 'png'],
Expand All @@ -48,7 +48,7 @@ final XFile? file =
#### Open multiple files at once

<?code-excerpt "open_multiple_images_page.dart (MultiOpen)"?>
``` dart
```dart
const XTypeGroup jpgsTypeGroup = XTypeGroup(
label: 'JPEGs',
extensions: <String>['jpg', 'jpeg'],
Expand Down
15 changes: 0 additions & 15 deletions packages/file_selector/file_selector/example/build.excerpt.yaml

This file was deleted.

133 changes: 66 additions & 67 deletions packages/flutter_adaptive_scaffold/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?code-excerpt path-base="excerpts/packages/flutter_adaptive_scaffold_example"?>
<?code-excerpt path-base="example/lib"?>

# Adaptive Scaffold

Expand Down Expand Up @@ -35,75 +35,74 @@ animation should use AdaptiveLayout.

<?code-excerpt "adaptive_scaffold_demo.dart (Example)"?>
```dart
@override
Widget build(BuildContext context) {
// Define the children to display within the body at different breakpoints.
final List<Widget> children = <Widget>[
for (int i = 0; i < 10; i++)
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
color: const Color.fromARGB(255, 255, 201, 197),
height: 400,
),
)
];

return AdaptiveScaffold(
// An option to override the default breakpoints used for small, medium,
// and large.
smallBreakpoint: const WidthPlatformBreakpoint(end: 700),
mediumBreakpoint: const WidthPlatformBreakpoint(begin: 700, end: 1000),
largeBreakpoint: const WidthPlatformBreakpoint(begin: 1000),
useDrawer: false,
selectedIndex: _selectedTab,
onSelectedIndexChange: (int index) {
setState(() {
_selectedTab = index;
});
},
destinations: const <NavigationDestination>[
NavigationDestination(
icon: Icon(Icons.inbox_outlined),
selectedIcon: Icon(Icons.inbox),
label: 'Inbox',
),
NavigationDestination(
icon: Icon(Icons.article_outlined),
selectedIcon: Icon(Icons.article),
label: 'Articles',
),
NavigationDestination(
icon: Icon(Icons.chat_outlined),
selectedIcon: Icon(Icons.chat),
label: 'Chat',
),
NavigationDestination(
icon: Icon(Icons.video_call_outlined),
selectedIcon: Icon(Icons.video_call),
label: 'Video',
),
NavigationDestination(
icon: Icon(Icons.home_outlined),
selectedIcon: Icon(Icons.home),
label: 'Inbox',
@override
Widget build(BuildContext context) {
// Define the children to display within the body at different breakpoints.
final List<Widget> children = <Widget>[
for (int i = 0; i < 10; i++)
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
color: const Color.fromARGB(255, 255, 201, 197),
height: 400,
),
],
body: (_) => GridView.count(crossAxisCount: 2, children: children),
smallBody: (_) => ListView.builder(
itemCount: children.length,
itemBuilder: (_, int idx) => children[idx],
)
];

return AdaptiveScaffold(
// An option to override the default breakpoints used for small, medium,
// and large.
smallBreakpoint: const WidthPlatformBreakpoint(end: 700),
mediumBreakpoint: const WidthPlatformBreakpoint(begin: 700, end: 1000),
largeBreakpoint: const WidthPlatformBreakpoint(begin: 1000),
useDrawer: false,
selectedIndex: _selectedTab,
onSelectedIndexChange: (int index) {
setState(() {
_selectedTab = index;
});
},
destinations: const <NavigationDestination>[
NavigationDestination(
icon: Icon(Icons.inbox_outlined),
selectedIcon: Icon(Icons.inbox),
label: 'Inbox',
),
NavigationDestination(
icon: Icon(Icons.article_outlined),
selectedIcon: Icon(Icons.article),
label: 'Articles',
),
NavigationDestination(
icon: Icon(Icons.chat_outlined),
selectedIcon: Icon(Icons.chat),
label: 'Chat',
),
NavigationDestination(
icon: Icon(Icons.video_call_outlined),
selectedIcon: Icon(Icons.video_call),
label: 'Video',
),
// Define a default secondaryBody.
secondaryBody: (_) => Container(
color: const Color.fromARGB(255, 234, 158, 192),
NavigationDestination(
icon: Icon(Icons.home_outlined),
selectedIcon: Icon(Icons.home),
label: 'Inbox',
),
// Override the default secondaryBody during the smallBreakpoint to be
// empty. Must use AdaptiveScaffold.emptyBuilder to ensure it is properly
// overridden.
smallSecondaryBody: AdaptiveScaffold.emptyBuilder,
);
}
],
body: (_) => GridView.count(crossAxisCount: 2, children: children),
smallBody: (_) => ListView.builder(
itemCount: children.length,
itemBuilder: (_, int idx) => children[idx],
),
// Define a default secondaryBody.
secondaryBody: (_) => Container(
color: const Color.fromARGB(255, 234, 158, 192),
),
// Override the default secondaryBody during the smallBreakpoint to be
// empty. Must use AdaptiveScaffold.emptyBuilder to ensure it is properly
// overridden.
smallSecondaryBody: AdaptiveScaffold.emptyBuilder,
);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually we would version-bump this package so this README fix goes out, but this is so minor waiting for the next organic release is fine.

```

Expand Down
16 changes: 0 additions & 16 deletions packages/flutter_adaptive_scaffold/example/build.excerpt.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ class _MyHomePageState extends State<MyHomePage> {
smallSecondaryBody: AdaptiveScaffold.emptyBuilder,
);
}
// #enddocregion
// #enddocregion Example
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ const String _data = '''
''';

const String _notes = '''
# Shrink wrap demo
# Shrink wrap demo
---

## Overview

This example demonstrates how `MarkdownBody`'s `shrinkWrap` property works.

- If `shrinkWrap` is `true`, `MarkdownBody` will take the minimum height that
- If `shrinkWrap` is `true`, `MarkdownBody` will take the minimum height that
wraps its content.
- If `shrinkWrap` is `false`, `MarkdownBody` will expand to the maximum allowed
- If `shrinkWrap` is `false`, `MarkdownBody` will expand to the maximum allowed
height.
''';

Expand Down
6 changes: 2 additions & 4 deletions packages/google_identity_services_web/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<?code-excerpt path-base="excerpts/packages/google_identity_services_web_example"?>

# google_identity_services_web

A JS-interop layer for Google Identity's Sign In With Google SDK.
Expand Down Expand Up @@ -29,7 +27,7 @@ script tag [as recommended](https://developers.google.com/identity/gsi/web/guide
Place the `script` tag in the `<head>` of your site, next to the script tag that
loads `flutter.js`, so the browser can downloaded both in parallel:

<?code-excerpt "../../web/index-with-script-tag.html (script-tag)"?>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the path-base be changed to example so this doesn't need ../?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i mostly tried to do update mechanically, rather than optimize them, because when i changed them i was still trying to just prove to myself that the output wouldn't change. i'm very happy to study these more carefully and make them more useful, i'll do that shortly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i updated the two cases where we used ../ to have more reasonable path bases.

<?code-excerpt "example/web/index-with-script-tag.html (script-tag)"?>
```html
<head>
<!-- ··· -->
Expand All @@ -46,7 +44,7 @@ An alternative way, that downloads the SDK on demand, is to use the
**`loadWebSdk`** function provided by the library. A simple location to embed
this in a Flutter Web only app can be the `main.dart`:

<?code-excerpt "main.dart (use-loader)"?>
<?code-excerpt "example/lib/main.dart (use-loader)"?>
```dart
import 'package:google_identity_services_web/loader.dart' as gis;
// ···
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Google Maps for Flutter

<?code-excerpt path-base="excerpts/packages/google_maps_flutter_example"?>
<?code-excerpt path-base="example/lib"?>

[![pub package](https://img.shields.io/pub/v/google_maps_flutter.svg)](https://pub.dev/packages/google_maps_flutter)

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# google\_maps\_flutter\_android

<?code-excerpt path-base="excerpts/packages/google_maps_flutter_example"?>
<?code-excerpt path-base="example/lib"?>

The Android implementation of [`google_maps_flutter`][1].

Expand Down

This file was deleted.

6 changes: 3 additions & 3 deletions packages/image_picker/image_picker/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Image Picker plugin for Flutter
<?code-excerpt path-base="excerpts/packages/image_picker_example"?>
<?code-excerpt path-base="example/lib"?>

[![pub package](https://img.shields.io/pub/v/image_picker.svg)](https://pub.dev/packages/image_picker)

Expand Down Expand Up @@ -122,7 +122,7 @@ implementations allow delegating to a camera handler by setting a
`cameraDelegate` before using `image_picker`, such as in `main()`:

<?code-excerpt "readme_excerpts.dart (CameraDelegate)"?>
``` dart
```dart
import 'package:image_picker_platform_interface/image_picker_platform_interface.dart';
// ···
class MyCameraDelegate extends ImagePickerCameraDelegate {
Expand Down Expand Up @@ -167,7 +167,7 @@ add a filesystem access
### Example

<?code-excerpt "readme_excerpts.dart (Pick)"?>
``` dart
```dart
final ImagePicker picker = ImagePicker();
// Pick an image.
final XFile? image = await picker.pickImage(source: ImageSource.gallery);
Expand Down
15 changes: 0 additions & 15 deletions packages/image_picker/image_picker/example/build.excerpt.yaml

This file was deleted.

Loading