Skip to content
This repository was archived by the owner on May 14, 2023. It is now read-only.

Commit ccc4b64

Browse files
committed
fixed issues
1 parent 94e5d7f commit ccc4b64

File tree

9 files changed

+234
-301
lines changed

9 files changed

+234
-301
lines changed

adaptive_breakpoints/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ repo.
2424
### Review
2525

2626
1. Make sure all the existing tests are passing by using the following command (from the root of the project): `$ flutter test test/`.
27-
1. Create a PR to merge the branch on your fork into `dart-code-viewer/master`.
27+
1. Create a PR to merge the branch on your fork into `adaptive_breakpoints/master`.
2828
1. Add `JoseAlba` as reviewer on the PR. I will take a look and add any comments. When the PR is ready to be merged, we will merge it and update the package.

adaptive_breakpoints/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The `adaptive_breakpoints` package for Flutter allows you to use the adaptive [b
66

77
This package provides the material breakpoint entries for adaptive/responsive development in Flutter.
88

9-
Firs, add the `adaptive_breakpoints` package to your pubspec dependencies.
9+
First, add the `adaptive_breakpoints` package to your pubspec dependencies.
1010

1111
To import `adaptive_breakpoints`:
1212

adaptive_breakpoints/example/lib/main.dart

+36-14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
15
import 'package:flutter/material.dart';
26
import 'package:adaptive_breakpoints/adaptive_breakpoints.dart';
37

@@ -10,39 +14,57 @@ class MyApp extends StatelessWidget {
1014
Widget build(BuildContext context) {
1115
return MaterialApp(
1216
home: Scaffold(
13-
body: AdaptiveContainer(
14-
windowLimit: AdaptiveWindow.m,
15-
child: SizedBox(
16-
height: 300,
17-
child: Text('Adaptive Container'),
18-
),
17+
body: Column(
18+
children: [
19+
AdaptiveContainer(
20+
windowLimit: AdaptiveWindowType.xs,
21+
child: Text('This is a extra small window'),
22+
),
23+
AdaptiveContainer(
24+
windowLimit: AdaptiveWindowType.s,
25+
child: Text('This is a small screen'),
26+
),
27+
AdaptiveContainer(
28+
windowLimit: AdaptiveWindowType.m,
29+
child: Text('This is a medium window'),
30+
),
31+
AdaptiveContainer(
32+
windowLimit: AdaptiveWindowType.l,
33+
child: Text('This is a large window'),
34+
),
35+
AdaptiveContainer(
36+
windowLimit: AdaptiveWindowType.xl,
37+
child: Text('This is a extra large window'),
38+
),
39+
],
1940
),
2041
),
2142
);
2243
}
2344
}
2445

46+
/// This example application demonstrates how to use
47+
/// [`adaptive_breakpoints`](https://pub.dev/packages/adaptive_breakpoints)
48+
/// within a simple Flutter app.
2549
class AdaptiveContainer extends StatelessWidget {
26-
final AdaptiveWindow windowLimit;
50+
final AdaptiveWindowType windowLimit;
2751
final Widget child;
2852

2953
const AdaptiveContainer({
3054
@required this.windowLimit,
31-
@required this.child,
32-
}) : assert(windowLimit != null),
33-
assert(child != null);
55+
this.child,
56+
}) : assert(windowLimit != null);
3457

3558
@override
3659
Widget build(BuildContext context) {
3760
return LayoutBuilder(
3861
builder: (BuildContext context, BoxConstraints constraints) {
39-
BreakpointSystemEntry entry =
40-
getBreakpointEntry(MediaQuery.of(context).size);
62+
BreakpointSystemEntry entry = getBreakpointEntry(context);
4163
if (entry.window == windowLimit) {
4264
return Container(
4365
constraints: BoxConstraints(
44-
maxWidth: entry.window.longestWidth,
45-
minWidth: entry.window.shortestWidth,
66+
minWidth: entry.window.widthRangeValues.start,
67+
maxWidth: entry.window.widthRangeValues.end,
4668
),
4769
width: MediaQuery.of(context).size.width - (entry.margins * 2),
4870
margin: EdgeInsets.symmetric(horizontal: entry.margins),

adaptive_breakpoints/example/pubspec.lock

+32-66
Original file line numberDiff line numberDiff line change
@@ -8,62 +8,55 @@ packages:
88
relative: true
99
source: path
1010
version: "0.0.1"
11-
archive:
12-
dependency: transitive
13-
description:
14-
name: archive
15-
url: "https://pub.dartlang.org"
16-
source: hosted
17-
version: "2.0.11"
18-
args:
19-
dependency: transitive
20-
description:
21-
name: args
22-
url: "https://pub.dartlang.org"
23-
source: hosted
24-
version: "1.5.2"
2511
async:
2612
dependency: transitive
2713
description:
2814
name: async
2915
url: "https://pub.dartlang.org"
3016
source: hosted
31-
version: "2.4.0"
17+
version: "2.5.0-nullsafety"
3218
boolean_selector:
3319
dependency: transitive
3420
description:
3521
name: boolean_selector
3622
url: "https://pub.dartlang.org"
3723
source: hosted
38-
version: "1.0.5"
24+
version: "2.1.0-nullsafety"
25+
characters:
26+
dependency: transitive
27+
description:
28+
name: characters
29+
url: "https://pub.dartlang.org"
30+
source: hosted
31+
version: "1.1.0-nullsafety.2"
3932
charcode:
4033
dependency: transitive
4134
description:
4235
name: charcode
4336
url: "https://pub.dartlang.org"
4437
source: hosted
45-
version: "1.1.2"
46-
collection:
38+
version: "1.2.0-nullsafety"
39+
clock:
4740
dependency: transitive
4841
description:
49-
name: collection
42+
name: clock
5043
url: "https://pub.dartlang.org"
5144
source: hosted
52-
version: "1.14.11"
53-
convert:
45+
version: "1.1.0-nullsafety"
46+
collection:
5447
dependency: transitive
5548
description:
56-
name: convert
49+
name: collection
5750
url: "https://pub.dartlang.org"
5851
source: hosted
59-
version: "2.1.1"
60-
crypto:
52+
version: "1.15.0-nullsafety.2"
53+
fake_async:
6154
dependency: transitive
6255
description:
63-
name: crypto
56+
name: fake_async
6457
url: "https://pub.dartlang.org"
6558
source: hosted
66-
version: "2.1.3"
59+
version: "1.1.0-nullsafety"
6760
flutter:
6861
dependency: "direct main"
6962
description: flutter
@@ -74,48 +67,27 @@ packages:
7467
description: flutter
7568
source: sdk
7669
version: "0.0.0"
77-
image:
78-
dependency: transitive
79-
description:
80-
name: image
81-
url: "https://pub.dartlang.org"
82-
source: hosted
83-
version: "2.1.4"
8470
matcher:
8571
dependency: transitive
8672
description:
8773
name: matcher
8874
url: "https://pub.dartlang.org"
8975
source: hosted
90-
version: "0.12.6"
76+
version: "0.12.10-nullsafety"
9177
meta:
9278
dependency: transitive
9379
description:
9480
name: meta
9581
url: "https://pub.dartlang.org"
9682
source: hosted
97-
version: "1.1.8"
83+
version: "1.3.0-nullsafety.2"
9884
path:
9985
dependency: transitive
10086
description:
10187
name: path
10288
url: "https://pub.dartlang.org"
10389
source: hosted
104-
version: "1.6.4"
105-
petitparser:
106-
dependency: transitive
107-
description:
108-
name: petitparser
109-
url: "https://pub.dartlang.org"
110-
source: hosted
111-
version: "2.4.0"
112-
quiver:
113-
dependency: transitive
114-
description:
115-
name: quiver
116-
url: "https://pub.dartlang.org"
117-
source: hosted
118-
version: "2.0.5"
90+
version: "1.8.0-nullsafety"
11991
sky_engine:
12092
dependency: transitive
12193
description: flutter
@@ -127,62 +99,56 @@ packages:
12799
name: source_span
128100
url: "https://pub.dartlang.org"
129101
source: hosted
130-
version: "1.5.5"
102+
version: "1.8.0-nullsafety"
131103
stack_trace:
132104
dependency: transitive
133105
description:
134106
name: stack_trace
135107
url: "https://pub.dartlang.org"
136108
source: hosted
137-
version: "1.9.3"
109+
version: "1.10.0-nullsafety"
138110
stream_channel:
139111
dependency: transitive
140112
description:
141113
name: stream_channel
142114
url: "https://pub.dartlang.org"
143115
source: hosted
144-
version: "2.0.0"
116+
version: "2.1.0-nullsafety"
145117
string_scanner:
146118
dependency: transitive
147119
description:
148120
name: string_scanner
149121
url: "https://pub.dartlang.org"
150122
source: hosted
151-
version: "1.0.5"
123+
version: "1.1.0-nullsafety"
152124
term_glyph:
153125
dependency: transitive
154126
description:
155127
name: term_glyph
156128
url: "https://pub.dartlang.org"
157129
source: hosted
158-
version: "1.1.0"
130+
version: "1.2.0-nullsafety"
159131
test_api:
160132
dependency: transitive
161133
description:
162134
name: test_api
163135
url: "https://pub.dartlang.org"
164136
source: hosted
165-
version: "0.2.15"
137+
version: "0.2.19-nullsafety"
166138
typed_data:
167139
dependency: transitive
168140
description:
169141
name: typed_data
170142
url: "https://pub.dartlang.org"
171143
source: hosted
172-
version: "1.1.6"
144+
version: "1.3.0-nullsafety.2"
173145
vector_math:
174146
dependency: transitive
175147
description:
176148
name: vector_math
177149
url: "https://pub.dartlang.org"
178150
source: hosted
179-
version: "2.0.8"
180-
xml:
181-
dependency: transitive
182-
description:
183-
name: xml
184-
url: "https://pub.dartlang.org"
185-
source: hosted
186-
version: "3.5.0"
151+
version: "2.1.0-nullsafety.2"
187152
sdks:
188-
dart: ">=2.7.0 <3.0.0"
153+
dart: ">=2.10.0-0.0.dev <2.10.0"
154+
flutter: ">=1.17.0 <2.0.0"
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
15
library adaptive_breakpoints;
26

37
export 'src/adaptive_breakpoints.dart';

0 commit comments

Comments
 (0)