Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Commit 4702029

Browse files
- made child compalsary for ConnectivityWidgetWrapper
- Resolve List<Widget> to List<Widget?> issue
1 parent 85cb1af commit 4702029

File tree

4 files changed

+56
-15
lines changed

4 files changed

+56
-15
lines changed

Diff for: example/ios/Podfile

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '9.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17+
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
22+
end
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24+
end
25+
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
30+
target 'Runner' do
31+
use_frameworks!
32+
use_modular_headers!
33+
34+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35+
end
36+
37+
post_install do |installer|
38+
installer.pods_project.targets.each do |target|
39+
flutter_additional_ios_build_settings(target)
40+
end
41+
end

Diff for: example/pubspec.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.5.0"
10+
version: "2.8.1"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
@@ -28,7 +28,7 @@ packages:
2828
name: charcode
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "1.2.0"
31+
version: "1.3.1"
3232
clock:
3333
dependency: transitive
3434
description:
@@ -87,7 +87,7 @@ packages:
8787
name: meta
8888
url: "https://pub.dartlang.org"
8989
source: hosted
90-
version: "1.3.0"
90+
version: "1.7.0"
9191
nested:
9292
dependency: transitive
9393
description:
@@ -120,7 +120,7 @@ packages:
120120
name: source_span
121121
url: "https://pub.dartlang.org"
122122
source: hosted
123-
version: "1.8.0"
123+
version: "1.8.1"
124124
stack_trace:
125125
dependency: transitive
126126
description:
@@ -155,7 +155,7 @@ packages:
155155
name: test_api
156156
url: "https://pub.dartlang.org"
157157
source: hosted
158-
version: "0.2.19"
158+
version: "0.4.2"
159159
typed_data:
160160
dependency: transitive
161161
description:

Diff for: lib/src/widgets/connectivity_widget_wrapper.dart

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import 'package:connectivity_wrapper/src/widgets/empty_container.dart';
1111

1212
class ConnectivityWidgetWrapper extends StatelessWidget {
1313
/// The [child] contained by the ConnectivityWidgetWrapper.
14-
final Widget? child;
14+
final Widget child;
1515

1616
/// The [offlineWidget] contained by the ConnectivityWidgetWrapper.
1717
final Widget? offlineWidget;
@@ -42,7 +42,7 @@ class ConnectivityWidgetWrapper extends StatelessWidget {
4242

4343
const ConnectivityWidgetWrapper({
4444
Key? key,
45-
this.child,
45+
required this.child,
4646
this.color,
4747
this.decoration,
4848
this.message,
@@ -97,7 +97,7 @@ class ConnectivityWidgetWrapper extends StatelessWidget {
9797

9898
if (stacked)
9999
return Stack(
100-
children: (<Widget?>[
100+
children: ([
101101
if (child != null) child,
102102
disableInteraction && _isOffline
103103
? Column(
@@ -114,9 +114,9 @@ class ConnectivityWidgetWrapper extends StatelessWidget {
114114
)
115115
: EmptyContainer(),
116116
_isOffline ? _finalOfflineWidget : EmptyContainer(),
117-
]) as List<Widget>,
117+
]) ,
118118
);
119119

120-
return _isOffline ? _finalOfflineWidget : child!;
120+
return _isOffline ? _finalOfflineWidget : child;
121121
}
122122
}

Diff for: pubspec.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ packages:
1414
name: async
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "2.5.0"
17+
version: "2.8.1"
1818
boolean_selector:
1919
dependency: transitive
2020
description:
@@ -35,7 +35,7 @@ packages:
3535
name: charcode
3636
url: "https://pub.dartlang.org"
3737
source: hosted
38-
version: "1.2.0"
38+
version: "1.3.1"
3939
clock:
4040
dependency: transitive
4141
description:
@@ -87,7 +87,7 @@ packages:
8787
name: meta
8888
url: "https://pub.dartlang.org"
8989
source: hosted
90-
version: "1.3.0"
90+
version: "1.7.0"
9191
nested:
9292
dependency: transitive
9393
description:
@@ -120,7 +120,7 @@ packages:
120120
name: source_span
121121
url: "https://pub.dartlang.org"
122122
source: hosted
123-
version: "1.8.0"
123+
version: "1.8.1"
124124
stack_trace:
125125
dependency: transitive
126126
description:
@@ -155,7 +155,7 @@ packages:
155155
name: test_api
156156
url: "https://pub.dartlang.org"
157157
source: hosted
158-
version: "0.2.19"
158+
version: "0.4.2"
159159
tint:
160160
dependency: transitive
161161
description:

0 commit comments

Comments
 (0)