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

Commit 876ff51

Browse files
committed
Dart analysis
1 parent 65a8f86 commit 876ff51

12 files changed

+126
-85
lines changed

.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"android":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"macos":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"linux":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":false,"dependencies":[]}],"windows":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"web":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]}],"date_created":"2022-12-20 15:49:52.195478","version":"3.3.7"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"android":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"macos":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"linux":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":false,"dependencies":[]}],"windows":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"web":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]}],"date_created":"2022-12-20 15:53:54.182602","version":"3.3.7"}

dry_run.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
START=$(date +%s)
4+
flutter clean
5+
flutter pub get
6+
flutter test
7+
if [[ $? == 0 ]]; then
8+
flutter pub publish --dry-run
9+
else
10+
echo "FLUTTER TEST FAILED"
11+
fi
12+
END=$(date +%s)
13+
DIFF=$(echo "$END - $START" | bc)
14+
echo "It took $DIFF seconds"

example/.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"android":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"macos":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"linux":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":false,"dependencies":[]}],"windows":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"web":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]}],"date_created":"2022-12-20 15:49:52.469159","version":"3.3.7"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"android":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"macos":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"linux":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":false,"dependencies":[]}],"windows":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","native_build":true,"dependencies":[]}],"web":[{"name":"connectivity_plus","path":"/Users/ajaykumar/SDK/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-3.0.2/","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]}],"date_created":"2022-12-20 15:53:53.377289","version":"3.3.7"}

example/lib/main.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import 'package:connectivity_wrapper/connectivity_wrapper.dart';
22
import 'package:connectivity_wrapper_example/screens/menu_screen.dart';
33
import 'package:flutter/material.dart';
44

5-
void main() => runApp(MyApp());
5+
void main() => runApp(const MyApp());
66

77
class MyApp extends StatelessWidget {
8+
const MyApp({Key key}) : super(key: key);
9+
810
@override
911
Widget build(BuildContext context) {
1012
return ConnectivityAppWrapper(
@@ -16,9 +18,9 @@ class MyApp extends StatelessWidget {
1618
home: MenuScreen(),
1719
builder: (buildContext, widget) {
1820
return ConnectivityWidgetWrapper(
19-
child: widget,
2021
disableInteraction: true,
2122
height: 80,
23+
child: widget,
2224
);
2325
},
2426
),

example/lib/screens/custom_offline_widget_screen.dart

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ import 'package:connectivity_wrapper_example/utils/ui_helper.dart';
44
import 'package:flutter/material.dart';
55

66
class CustomOfflineWidgetScreen extends StatelessWidget {
7+
const CustomOfflineWidgetScreen({Key key}) : super(key: key);
8+
79
@override
810
Widget build(BuildContext context) {
911
return Scaffold(
1012
appBar: AppBar(
11-
title: Text(Strings.example2),
13+
title: const Text(Strings.example2),
1214
),
1315
body: ConnectivityWidgetWrapper(
1416
disableInteraction: true,
15-
offlineWidget: OfflineWidget(),
17+
offlineWidget: const OfflineWidget(),
1618
child: ListView.builder(
1719
itemBuilder: (BuildContext context, int index) {
1820
return ListTile(
@@ -26,27 +28,27 @@ class CustomOfflineWidgetScreen extends StatelessWidget {
2628
}
2729

2830
class OfflineWidget extends StatelessWidget {
31+
const OfflineWidget({Key key}) : super(key: key);
32+
2933
@override
3034
Widget build(BuildContext context) {
31-
return Container(
32-
child: Column(
33-
mainAxisSize: MainAxisSize.min,
34-
crossAxisAlignment: CrossAxisAlignment.stretch,
35-
children: <Widget>[
36-
Image(
37-
height: 300,
38-
image: AssetImage('assets/dog.gif'),
39-
),
40-
PA5(),
41-
Center(
42-
child: Text(
43-
Strings.offlineMessage,
44-
style: TextStyle(color: Colors.white, fontSize: 30.0),
45-
),
35+
return Column(
36+
mainAxisSize: MainAxisSize.min,
37+
crossAxisAlignment: CrossAxisAlignment.stretch,
38+
children: const <Widget>[
39+
Image(
40+
height: 300,
41+
image: AssetImage('assets/dog.gif'),
42+
),
43+
PA5(),
44+
Center(
45+
child: Text(
46+
Strings.offlineMessage,
47+
style: TextStyle(color: Colors.white, fontSize: 30.0),
4648
),
47-
PA5(),
48-
],
49-
),
49+
),
50+
PA5(),
51+
],
5052
);
5153
}
5254
}

example/lib/screens/menu_screen.dart

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ import 'custom_offline_widget_screen.dart';
88
import 'network_aware_widget_screen.dart';
99

1010
class MenuScreen extends StatelessWidget {
11-
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
11+
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
12+
13+
MenuScreen({Key key}) : super(key: key);
1214

1315
@override
1416
Widget build(BuildContext context) {
1517
return Scaffold(
1618
key: _scaffoldKey,
1719
appBar: AppBar(
18-
title: Text("Connectivity Wrapper Example"),
20+
title: const Text("Connectivity Wrapper Example"),
1921
),
2022
body: ConnectivityScreenWrapper(
2123
disableInteraction: false,
@@ -25,28 +27,28 @@ class MenuScreen extends StatelessWidget {
2527
child: ListView(
2628
children: <Widget>[
2729
ListTile(
28-
title: Text(Strings.example1),
30+
title: const Text(Strings.example1),
2931
onTap: () async {
30-
AppRoutes.push(context, ScaffoldExampleScreen());
32+
AppRoutes.push(context, const ScaffoldExampleScreen());
3133
},
3234
),
33-
Divider(),
35+
const Divider(),
3436
ListTile(
35-
title: Text(Strings.example2),
37+
title: const Text(Strings.example2),
3638
onTap: () {
37-
AppRoutes.push(context, CustomOfflineWidgetScreen());
39+
AppRoutes.push(context, const CustomOfflineWidgetScreen());
3840
},
3941
),
40-
Divider(),
42+
const Divider(),
4143
ListTile(
42-
title: Text(Strings.example3),
44+
title: const Text(Strings.example3),
4345
onTap: () {
44-
AppRoutes.push(context, NetworkAwareWidgetScreen());
46+
AppRoutes.push(context, const NetworkAwareWidgetScreen());
4547
},
4648
),
47-
Divider(),
49+
const Divider(),
4850
ListTile(
49-
title: Text(Strings.example4),
51+
title: const Text(Strings.example4),
5052
onTap: () async {
5153
if (await ConnectivityWrapper.instance.isConnected) {
5254
showSnackBar(
@@ -62,7 +64,7 @@ class MenuScreen extends StatelessWidget {
6264
}
6365
},
6466
),
65-
Divider(),
67+
const Divider(),
6668
],
6769
),
6870
),

example/lib/screens/network_aware_widget_screen.dart

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,25 @@ import 'package:flutter/cupertino.dart';
55
import 'package:flutter/material.dart';
66

77
class NetworkAwareWidgetScreen extends StatelessWidget {
8+
const NetworkAwareWidgetScreen({Key key}) : super(key: key);
9+
810
@override
911
Widget build(BuildContext context) {
1012
return Scaffold(
1113
appBar: AppBar(
12-
title: Text(Strings.example3),
14+
title: const Text(Strings.example3),
1315
),
1416
body: ListView(
15-
padding: EdgeInsets.all(20.0),
17+
padding: const EdgeInsets.all(20.0),
1618
children: <Widget>[
17-
TextField(
19+
const TextField(
1820
decoration: InputDecoration(labelText: 'Email'),
1921
),
20-
PA5(),
21-
TextField(
22+
const PA5(),
23+
const TextField(
2224
decoration: InputDecoration(labelText: 'Password'),
2325
),
24-
PA5(),
26+
const PA5(),
2527
ConnectivityWidgetWrapper(
2628
stacked: false,
2729
offlineWidget: ElevatedButton(
@@ -33,7 +35,7 @@ class NetworkAwareWidgetScreen extends StatelessWidget {
3335
padding: const EdgeInsets.all(8.0),
3436
child: Row(
3537
mainAxisAlignment: MainAxisAlignment.center,
36-
children: <Widget>[
38+
children: const <Widget>[
3739
Text(
3840
"Connecting",
3941
style: TextStyle(
@@ -48,15 +50,15 @@ class NetworkAwareWidgetScreen extends StatelessWidget {
4850
),
4951
child: ElevatedButton(
5052
onPressed: () {},
51-
child: Text(
53+
style: ButtonStyle(
54+
backgroundColor: MaterialStateProperty.all<Color>(Colors.blue),
55+
),
56+
child: const Text(
5257
"Sign In",
5358
style: TextStyle(
5459
color: Colors.white,
5560
),
5661
),
57-
style: ButtonStyle(
58-
backgroundColor: MaterialStateProperty.all<Color>(Colors.blue),
59-
),
6062
),
6163
),
6264
],

example/lib/screens/scaffold_example_screen.dart

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import 'package:connectivity_wrapper_example/utils/ui_helper.dart';
44
import 'package:flutter/material.dart';
55

66
class ScaffoldExampleScreen extends StatefulWidget {
7+
const ScaffoldExampleScreen({Key key}) : super(key: key);
8+
79
@override
8-
_ScaffoldExampleScreenState createState() => _ScaffoldExampleScreenState();
10+
State<ScaffoldExampleScreen> createState() => _ScaffoldExampleScreenState();
911
}
1012

1113
class _ScaffoldExampleScreenState extends State<ScaffoldExampleScreen> {
@@ -24,7 +26,7 @@ class _ScaffoldExampleScreenState extends State<ScaffoldExampleScreen> {
2426
Widget build(BuildContext context) {
2527
return Scaffold(
2628
appBar: AppBar(
27-
title: Text(Strings.example1),
29+
title: const Text(Strings.example1),
2830
),
2931
body: ConnectivityWidgetWrapper(
3032
alignment: _alignment,
@@ -33,24 +35,27 @@ class _ScaffoldExampleScreenState extends State<ScaffoldExampleScreen> {
3335
height: _height,
3436
message: _message,
3537
messageStyle: _customMessage
36-
? TextStyle(
38+
? const TextStyle(
3739
color: Colors.white,
3840
fontSize: 40.0,
3941
)
4042
: null,
4143
child: ListView(
4244
children: <Widget>[
4345
CheckboxListTile(
44-
title: Text(Strings.customDecoration),
46+
title: const Text(Strings.customDecoration),
4547
value: _customDecoration,
4648
onChanged: (value) {
4749
setState(() {
4850
_customDecoration = value;
4951
if (_customDecoration) {
50-
_decoration = BoxDecoration(
52+
_decoration = const BoxDecoration(
5153
color: Colors.purple,
52-
gradient: new LinearGradient(
53-
colors: [Colors.red, Colors.cyan],
54+
gradient: LinearGradient(
55+
colors: [
56+
Colors.red,
57+
Colors.cyan,
58+
],
5459
),
5560
);
5661
} else {
@@ -59,10 +64,10 @@ class _ScaffoldExampleScreenState extends State<ScaffoldExampleScreen> {
5964
});
6065
},
6166
),
62-
Divider(),
63-
PA5(),
67+
const Divider(),
68+
const PA5(),
6469
CheckboxListTile(
65-
title: Text(Strings.customHeight),
70+
title: const Text(Strings.customHeight),
6671
value: _customHeight,
6772
onChanged: (value) {
6873
setState(() {
@@ -75,10 +80,10 @@ class _ScaffoldExampleScreenState extends State<ScaffoldExampleScreen> {
7580
});
7681
},
7782
),
78-
Divider(),
79-
PA5(),
83+
const Divider(),
84+
const PA5(),
8085
CheckboxListTile(
81-
title: Text(Strings.customMessage),
86+
title: const Text(Strings.customMessage),
8287
value: _customMessage,
8388
onChanged: (value) {
8489
setState(() {
@@ -91,52 +96,52 @@ class _ScaffoldExampleScreenState extends State<ScaffoldExampleScreen> {
9196
});
9297
},
9398
),
94-
Divider(),
95-
PA5(),
96-
ListTile(
99+
const Divider(),
100+
const PA5(),
101+
const ListTile(
97102
title: Text(Strings.customAlignment),
98103
),
99-
PA5(),
104+
const PA5(),
100105
IconButton(
101-
icon: Icon(Icons.arrow_upward),
106+
icon: const Icon(Icons.arrow_upward),
102107
onPressed: () {
103108
setState(() {
104109
_alignment = Alignment.topCenter;
105110
});
106111
},
107112
),
108-
Divider(),
109-
PA5(),
113+
const Divider(),
114+
const PA5(),
110115
IconButton(
111-
icon: Icon(Icons.center_focus_strong),
116+
icon: const Icon(Icons.center_focus_strong),
112117
onPressed: () {
113118
setState(() {
114119
_alignment = Alignment.center;
115120
});
116121
},
117122
),
118-
Divider(),
119-
PA5(),
123+
const Divider(),
124+
const PA5(),
120125
IconButton(
121-
icon: Icon(Icons.arrow_downward),
126+
icon: const Icon(Icons.arrow_downward),
122127
onPressed: () {
123128
setState(() {
124129
_alignment = Alignment.bottomCenter;
125130
});
126131
},
127132
),
128-
Divider(),
129-
PA5(),
133+
const Divider(),
134+
const PA5(),
130135
CheckboxListTile(
131-
title: Text(Strings.userInteraction),
136+
title: const Text(Strings.userInteraction),
132137
value: _disableInteraction,
133138
onChanged: (value) {
134139
setState(() {
135140
_disableInteraction = value;
136141
});
137142
},
138143
),
139-
PA5(),
144+
const PA5(),
140145
],
141146
),
142147
),

0 commit comments

Comments
 (0)