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

Commit 85cb1af

Browse files
committed
1.0.6
- Added textAlign in ConnectivityScreenWrapper i.e #6 - Added import_sorter
1 parent 35008f3 commit 85cb1af

15 files changed

+113
-28
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [1.0.6] - Maintenance issues and suggestions.
2+
3+
- Resolved [#6](https://github.com/ajaynonstopio/connectivity_wrapper/issues/6)
4+
15
## [1.0.5] - Maintenance issues and suggestions.
26

37
- Migrating to null safety and updated provider to: ^5.0.0 [#7](https://github.com/ajaynonstopio/connectivity_wrapper/issues/7)

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
[![](https://img.shields.io/badge/build-1.0.5-brightgreen)](https://github.com/ajaynonstopio/connectivity_wrapper)
1+
[![](https://img.shields.io/badge/build-1.0.6-brightgreen)](https://github.com/ajaynonstopio/connectivity_wrapper)
2+
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
23

34
# connectivity_wrapper
45

@@ -258,13 +259,15 @@ class NetworkAwareWidgetScreen extends StatelessWidget {
258259
whether you can reliably make a network connection. Always guard your app code
259260
against timeouts and errors that might come from the network layer.
260261

261-
## Getting Started
262+
262263

263-
This project is a starting point for a Dart
264-
[package](https://flutter.dev/developing-packages/),
265-
a library module containing code that can be shared easily across
266-
multiple Flutter or Dart projects.
264+
## Contributing
267265

268-
For help getting started with Flutter, view our
269-
[online documentation](https://flutter.dev/docs), which offers tutorials,
270-
samples, guidance on mobile development, and a full API reference.
266+
There are couple of ways in which you can contribute.
267+
- Propose any feature, enhancement
268+
- Report a bug
269+
- Fix a bug
270+
- Participate in a discussion and help in decision making
271+
- Write and improve some **documentation**. Documentation is super critical and its importance
272+
cannot be overstated!
273+
- Send in a Pull Request :-)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ packages:
4949
path: ".."
5050
relative: true
5151
source: path
52-
version: "1.0.5"
52+
version: "1.0.6"
5353
cupertino_icons:
5454
dependency: "direct main"
5555
description:

git_add_and_format_code.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
clear
3+
echo "Sort imports...."
4+
flutter pub run import_sorter:main
5+
echo "Formatting code with [flutter format]...."
6+
flutter format lib
7+
git add .
8+
echo "Done"
9+
git status
10+

lib/connectivity_wrapper.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
///
1111
library connectivity_wrapper;
1212

13+
// Dart imports:
1314
import 'dart:async';
1415
import 'dart:io';
1516

17+
// Project imports:
1618
import 'package:connectivity_wrapper/src/utils/constants.dart';
1719

1820
export 'package:connectivity_wrapper/src/widgets/connectivity_app_wrapper_widget.dart';

lib/src/providers/connectivity_provider.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
// Dart imports:
12
import 'dart:async';
23

3-
import 'package:connectivity_wrapper/connectivity_wrapper.dart';
4+
// Flutter imports:
45
import 'package:flutter/material.dart';
56

7+
// Project imports:
8+
import 'package:connectivity_wrapper/connectivity_wrapper.dart';
9+
610
/// [ConnectivityProvider] event ChangeNotifier class for ConnectivityStatus .
711
/// which extends [ChangeNotifier].
812

lib/src/utils/constants.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import 'package:connectivity_wrapper/src/widgets/connectivity_screen_wrapper.dart';
1+
// Flutter imports:
22
import 'package:flutter/cupertino.dart';
33
import 'package:flutter/material.dart';
44

5+
// Project imports:
6+
import 'package:connectivity_wrapper/src/widgets/connectivity_screen_wrapper.dart';
7+
58
/// More info on why default port is 53
69
/// here:
710
/// - https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

lib/src/widgets/connectivity_app_wrapper_widget.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
import 'package:connectivity_wrapper/connectivity_wrapper.dart';
2-
import 'package:connectivity_wrapper/src/providers/connectivity_provider.dart';
1+
// Flutter imports:
32
import 'package:flutter/material.dart';
3+
4+
// Package imports:
45
import 'package:provider/provider.dart';
56

7+
// Project imports:
8+
import 'package:connectivity_wrapper/connectivity_wrapper.dart';
9+
import 'package:connectivity_wrapper/src/providers/connectivity_provider.dart';
10+
611
///[ConnectivityAppWrapper] is a StatelessWidget.
712
813
class ConnectivityAppWrapper extends StatelessWidget {

lib/src/widgets/connectivity_screen_wrapper.dart

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
import 'package:connectivity_wrapper/connectivity_wrapper.dart';
2-
import 'package:connectivity_wrapper/src/utils/constants.dart';
1+
// Flutter imports:
32
import 'package:flutter/material.dart';
3+
4+
// Package imports:
45
import 'package:provider/provider.dart';
56

7+
// Project imports:
8+
import 'package:connectivity_wrapper/connectivity_wrapper.dart';
9+
import 'package:connectivity_wrapper/src/utils/constants.dart';
10+
611
enum PositionOnScreen {
712
TOP,
813
BOTTOM,
@@ -39,6 +44,9 @@ class ConnectivityScreenWrapper extends StatelessWidget {
3944
/// Disable the user interaction with child widget
4045
final Widget? disableWidget;
4146

47+
/// How the text should be aligned horizontally.
48+
final TextAlign? textAlign;
49+
4250
const ConnectivityScreenWrapper({
4351
Key? key,
4452
this.child,
@@ -47,6 +55,7 @@ class ConnectivityScreenWrapper extends StatelessWidget {
4755
this.message,
4856
this.messageStyle,
4957
this.height,
58+
this.textAlign,
5059
this.duration,
5160
this.positionOnScreen = PositionOnScreen.BOTTOM,
5261
this.disableInteraction = false,
@@ -64,7 +73,7 @@ class ConnectivityScreenWrapper extends StatelessWidget {
6473

6574
double _height = height ?? defaultHeight;
6675

67-
final Widget offlineWidget = AnimatedPositioned(
76+
final Widget _offlineWidget = AnimatedPositioned(
6877
top: positionOnScreen.top(_height, isOffline),
6978
bottom: positionOnScreen.bottom(_height, isOffline),
7079
child: AnimatedContainer(
@@ -76,6 +85,7 @@ class ConnectivityScreenWrapper extends StatelessWidget {
7685
child: Text(
7786
message ?? disconnectedMessage,
7887
style: messageStyle ?? defaultMessageStyle,
88+
textAlign: textAlign,
7989
),
8090
),
8191
duration: duration ?? Duration(milliseconds: 300),
@@ -87,10 +97,10 @@ class ConnectivityScreenWrapper extends StatelessWidget {
8797
absorbing: (disableInteraction && isOffline),
8898
child: Stack(
8999
children: (<Widget?>[
90-
child,
100+
if (child != null) child,
91101
if (disableInteraction && isOffline)
92102
if (disableWidget != null) disableWidget,
93-
offlineWidget,
103+
_offlineWidget,
94104
]) as List<Widget>,
95105
),
96106
);

0 commit comments

Comments
 (0)