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

Commit a64de3c

Browse files
committed
Maintenance issues and suggestions[1.0.3]
- Bumping version number, so pub.dev can accept the package - Exposed `ConnectivityService` - Updated Example App
1 parent b8aeccb commit a64de3c

35 files changed

+483
-317
lines changed

CHANGELOG.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
## [1.0.3] - Maintenance issues and suggestions.
2+
3+
- Bumping version number, so pub.dev can accept the package
4+
- Exposed `ConnectivityWrapper` as an API
5+
16
## [1.0.2] - Health suggestions.
27

3-
* Health suggestions.
8+
- Health suggestions.
49

510
## [1.0.1] - Updated Connectivity Service.
611

7-
* Updated Connectivity Service.
12+
- Updated Connectivity Service.
813

914
## [1.0.1] - initial release.
1015

11-
* initial release.
16+
- Initial release.
17+

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ connectivity_wrapper
22

33
MIT
44

5-
Copyright 2019 Ajay Kumar
5+
Copyright 2020 Nonstop io Technologies Pvt Ltd
66

77
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
88

README.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,49 @@ This plugin allows Flutter apps provide feedback on your app when it's not conne
44

55
## Usage
66

7-
##STEP 1: Add the package to `pubspec.yaml`
8-
7+
###Add the package to `pubspec.yaml`
98

109
```yaml
1110
dependencies:
1211
flutter:
1312
sdk: flutter
1413
cupertino_icons: ^0.1.2
15-
connectivity_wrapper: 1.0.2
14+
connectivity_wrapper: 1.0.3
1615
```
1716
18-
##STEP 2: Import the package to main.dart
19-
17+
### Import the package to main.dart
2018
2119
```dart
2220
import 'package:connectivity_wrapper/connectivity_wrapper.dart';
2321
```
24-
##STEP 3: Wrap `MaterialApp/CupertinoApp` with `ConnectivityAppWrapper`
22+
23+
##Check if device is connected to internet or not
24+
25+
```dart
26+
...
27+
28+
onTap: () async {
29+
if (await ConnectivityWrapper.instance.isConnected) {
30+
showSnackBar(
31+
_scaffoldKey,
32+
title: "You Are Connected",
33+
color: Colors.green,
34+
);
35+
} else {
36+
showSnackBar(
37+
_scaffoldKey,
38+
title: "You Are Not Connected",
39+
);
40+
}
41+
},
42+
43+
...
44+
45+
```
46+
47+
##Create `Network` Aware Widgets
48+
49+
##STEP 1: Wrap `MaterialApp/CupertinoApp` with `ConnectivityAppWrapper`
2550

2651
```dart
2752
class MyApp extends StatelessWidget {
@@ -40,7 +65,7 @@ class MyApp extends StatelessWidget {
4065
}
4166
```
4267

43-
##STEP 4: The last step, Wrap your body widget with `ConnectivityWidgetWrapper`
68+
##STEP 2: The last step, Wrap your body widget with `ConnectivityWidgetWrapper`
4469

4570
```dart
4671

example/android/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ android {
3838

3939
defaultConfig {
4040
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41-
applicationId "com.nonstopio.connectivity_wrapper_example"
41+
applicationId "com.example.example"
4242
minSdkVersion 16
4343
targetSdkVersion 28
4444
versionCode flutterVersionCode.toInteger()

example/android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.nonstopio.connectivity_wrapper_example">
2+
package="com.example.example">
33
<!-- Flutter needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.nonstopio.connectivity_wrapper_example">
3-
2+
package="com.example.example">
43
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
54
calls FlutterMain.startInitialization(this); in its onCreate method.
65
In most cases you can leave this as-is, but you if you want to provide
76
additional functionality it is fine to subclass or reimplement
87
FlutterApplication and put your custom class here. -->
98
<application
109
android:name="io.flutter.app.FlutterApplication"
11-
android:label="connectivity_wrapper_example"
10+
android:label="example"
1211
android:icon="@mipmap/ic_launcher">
1312
<activity
1413
android:name=".MainActivity"
1514
android:launchMode="singleTop"
1615
android:theme="@style/LaunchTheme"
17-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
16+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1817
android:hardwareAccelerated="true"
1918
android:windowSoftInputMode="adjustResize">
20-
<!-- This keeps the window background of the activity showing
21-
until Flutter renders its first frame. It can be removed if
22-
there is no splash screen (such as the default splash screen
23-
defined in @style/LaunchTheme). -->
24-
<meta-data
25-
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
26-
android:value="true" />
2719
<intent-filter>
2820
<action android:name="android.intent.action.MAIN"/>
2921
<category android:name="android.intent.category.LAUNCHER"/>
3022
</intent-filter>
3123
</activity>
24+
<!-- Don't delete the meta-data below.
25+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
26+
<meta-data
27+
android:name="flutterEmbedding"
28+
android:value="2" />
3229
</application>
3330
</manifest>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.example.example
2+
3+
import androidx.annotation.NonNull;
4+
import io.flutter.embedding.android.FlutterActivity
5+
import io.flutter.embedding.engine.FlutterEngine
6+
import io.flutter.plugins.GeneratedPluginRegistrant
7+
8+
class MainActivity: FlutterActivity() {
9+
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
10+
GeneratedPluginRegistrant.registerWith(flutterEngine);
11+
}
12+
}

example/android/app/src/main/kotlin/com/nonstopio/connectivity_wrapper_example/MainActivity.kt

Lines changed: 0 additions & 13 deletions
This file was deleted.

example/android/app/src/profile/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.nonstopio.connectivity_wrapper_example">
2+
package="com.example.example">
33
<!-- Flutter needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->

example/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.2.71'
2+
ext.kotlin_version = '1.3.50'
33
repositories {
44
google()
55
jcenter()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.2.1'
9+
classpath 'com.android.tools.build:gradle:3.5.0'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}

example/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
org.gradle.jvmargs=-Xmx1536M
2-
2+
android.enableR8=true
33
android.useAndroidX=true
44
android.enableJetifier=true

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip

example/ios/.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
*.mode1v3
2+
*.mode2v3
3+
*.moved-aside
4+
*.pbxuser
5+
*.perspectivev3
6+
**/*sync/
7+
.sconsign.dblite
8+
.tags*
9+
**/.vagrant/
10+
**/DerivedData/
11+
Icon?
12+
**/Pods/
13+
**/.symlinks/
14+
profile
15+
xcuserdata
16+
**/.generated/
17+
Flutter/App.framework
18+
Flutter/Flutter.framework
19+
Flutter/Flutter.podspec
20+
Flutter/Generated.xcconfig
21+
Flutter/app.flx
22+
Flutter/app.zip
23+
Flutter/flutter_assets/
24+
Flutter/flutter_export_environment.sh
25+
ServiceDefinitions.json
26+
Runner/GeneratedPluginRegistrant.*
27+
28+
# Exceptions to above rules.
29+
!default.mode1v3
30+
!default.mode2v3
31+
!default.pbxuser
32+
!default.perspectivev3

example/ios/Flutter/Debug.xcconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
21
#include "Generated.xcconfig"

example/ios/Flutter/Release.xcconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
21
#include "Generated.xcconfig"

example/ios/Podfile

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)