Skip to content

Commit 7f0eb5a

Browse files
committed
chore: taking care of minor warnings and removing obsolete methods
1 parent 95fe81d commit 7f0eb5a

File tree

4 files changed

+22
-62
lines changed

4 files changed

+22
-62
lines changed
Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,25 @@
11
class UserDataProfile {
2-
String _uuid;
3-
String _name;
4-
String _email;
2+
String uuid;
3+
String name;
4+
String email;
55

66
UserDataProfile({String uuid, String name, String email}) {
7-
this._uuid = uuid;
8-
this._name = name;
9-
this._email = email;
7+
this.uuid = uuid;
8+
this.name = name;
9+
this.email = email;
1010
}
1111

12-
String get uuid => _uuid;
13-
14-
set uuid(String uuid) => _uuid = uuid;
15-
16-
String get name => _name;
17-
18-
set name(String name) => _name = name;
19-
20-
String get email => _email;
21-
22-
set email(String email) => _email = email;
23-
2412
UserDataProfile.fromJson(Map<String, dynamic> json) {
25-
_uuid = json['uuid'];
26-
_name = json['name'];
27-
_email = json['email'];
13+
uuid = json['uuid'];
14+
name = json['name'];
15+
email = json['email'];
2816
}
2917

3018
Map<String, dynamic> toJson() {
3119
final Map<String, dynamic> data = new Map<String, dynamic>();
32-
data['uuid'] = this._uuid;
33-
data['name'] = this._name;
34-
data['email'] = this._email;
20+
data['uuid'] = this.uuid;
21+
data['name'] = this.name;
22+
data['email'] = this.email;
3523
return data;
3624
}
3725
}

lib/services/data.service_v1.dart

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ class DataServiceV1 extends GetxService {
6262
_listenerSet.add(id);
6363
}
6464

65-
_removeListener(Function callback) {
66-
_listeners.remove(callback);
67-
}
68-
6965
/// ----------------------------------------------------------
7066
/// Callback which is invoked each time that we are receiving
7167
/// a message from the server
@@ -76,19 +72,6 @@ class DataServiceV1 extends GetxService {
7672
});
7773
}
7874

79-
/// ----------------------------------------------------------
80-
/// Closes the WebSocket communication
81-
/// ----------------------------------------------------------
82-
_reset() {
83-
if (_channel != null) {
84-
if (_channel.sink != null) {
85-
_logger.d('Closing connection ...');
86-
_channel.sink.close();
87-
_connect();
88-
}
89-
}
90-
}
91-
9275
@override
9376
void onInit() {
9477
super.onInit();

lib/services/logging.service.dart

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'dart:convert';
2-
31
import 'package:logger/logger.dart';
42

53
class CustomFilter extends LogFilter {
@@ -14,13 +12,4 @@ class LoggingService extends Logger {
1412
Logger get logger {
1513
return Logger(filter: CustomFilter(), printer: PrefixPrinter(PrettyPrinter(colors: true, printEmojis: true, printTime: true)));
1614
}
17-
18-
String _stringifyMessage(dynamic message) {
19-
if (message is Map || message is Iterable) {
20-
var encoder = JsonEncoder.withIndent(null);
21-
return encoder.convert(message);
22-
} else {
23-
return message.toString();
24-
}
25-
}
2615
}

lib/view/home.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,25 @@ class HomeScreen extends StatelessWidget {
2525
style: TextStyle(fontSize: 24),
2626
),
2727
),
28-
FlatButton(
28+
TextButton(
2929
onPressed: () {
30-
// Get.to(() => DetailScreen());
31-
// print(dataService.fetchData());
3230
homeController.increment();
3331
},
3432
child: Text("count++"),
35-
color: Colors.black,
36-
textColor: Colors.white,
33+
style: TextButton.styleFrom(
34+
primary: Colors.white,
35+
backgroundColor: Colors.black,
36+
),
3737
),
38-
FlatButton(
38+
TextButton(
3939
onPressed: () {
40-
// print(dataService.fetchData());
41-
//homeController.increment();
4240
Get.to(() => DetailScreenV2());
4341
},
4442
child: Text("Go to details page"),
45-
color: Colors.red,
46-
textColor: Colors.white,
43+
style: TextButton.styleFrom(
44+
primary: Colors.white,
45+
backgroundColor: Colors.red,
46+
),
4747
),
4848
],
4949
),

0 commit comments

Comments
 (0)