Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jorge
2020-08-27 22:42:33 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b0e5f728ab991bd5a3a4a3f689a8e1422988b7ea
b0e5f728
1 parent
4713d0b7
added name GETX to developer.log method, avoid passing name GETX in every usage of the log method
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
24 deletions
lib/src/core/log.dart
lib/src/instance/get_instance.dart
lib/src/navigation/routes/observers/route_observer.dart
lib/src/state_manager/rx/rx_event.dart
lib/src/core/log.dart
View file @
b0e5f72
import
'package:flutter/foundation.dart'
;
import
'package:get/instance_manager.dart'
;
import
'dart:developer'
as
developer
;
typedef
LogWriterCallback
=
void
Function
(
String
text
,
{
@required
String
name
,
bool
isError
});
typedef
LogWriterCallback
=
void
Function
(
String
text
,
{
bool
isError
});
void
defaultLogWriterCallback
(
String
value
,
{
@required
String
name
,
bool
isError
=
false
})
{
if
(
isError
||
GetConfig
.
isLogEnable
)
developer
.
log
(
value
,
name:
name
);
void
defaultLogWriterCallback
(
String
value
,
{
bool
isError
=
false
})
{
if
(
isError
||
GetConfig
.
isLogEnable
)
developer
.
log
(
value
,
name:
'[GETX]'
);
}
...
...
lib/src/instance/get_instance.dart
View file @
b0e5f72
...
...
@@ -128,7 +128,7 @@ class GetInstance {
if
(
i
is
DisposableInterface
)
{
i
.
onStart
();
GetConfig
.
log
(
'
$key
has been initialized'
,
name:
'[GETX]'
);
GetConfig
.
log
(
'
$key
has been initialized'
);
}
}
...
...
@@ -173,7 +173,7 @@ class GetInstance {
if
(!
_factory
.
containsKey
(
key
))
throw
"
$S
not found. You need call put<
$S
>(
$S
()) before"
;
GetConfig
.
log
(
'
$S
instance was created at that time'
,
name:
'[GETX]'
);
GetConfig
.
log
(
'
$S
instance was created at that time'
);
S
_value
=
put
<
S
>(
_factory
[
key
].
builder
()
as
S
);
initDependencies
<
S
>(
name:
tag
);
...
...
@@ -217,8 +217,7 @@ class GetInstance {
return
queue
.
add
<
bool
>(()
async
{
if
(!
_singl
.
containsKey
(
newKey
))
{
GetConfig
.
log
(
'Instance
$newKey
already been removed.'
,
name:
'[GETX]'
,
isError:
true
);
GetConfig
.
log
(
'Instance
$newKey
already been removed.'
,
isError:
true
);
return
false
;
}
...
...
@@ -226,7 +225,6 @@ class GetInstance {
if
(
builder
.
permanent
&&
!
force
)
{
GetConfig
.
log
(
'[
$newKey
] has been marked as permanent, SmartManagement is not authorized to delete it.'
,
name:
'[GETX]'
,
isError:
true
);
return
false
;
}
...
...
@@ -237,14 +235,14 @@ class GetInstance {
}
if
(
i
is
DisposableInterface
)
{
await
i
.
onClose
();
GetConfig
.
log
(
'onClose of
$newKey
called'
,
name:
'[GETX]'
);
GetConfig
.
log
(
'onClose of
$newKey
called'
);
}
_singl
.
removeWhere
((
oldKey
,
value
)
=>
(
oldKey
==
newKey
));
if
(
_singl
.
containsKey
(
newKey
))
{
GetConfig
.
log
(
'error on remove object
$newKey
'
,
name:
'[GETX]'
,
isError:
true
);
GetConfig
.
log
(
'error on remove object
$newKey
'
,
isError:
true
);
}
else
{
GetConfig
.
log
(
'
$newKey
deleted from memory'
,
name:
'[GETX]'
);
GetConfig
.
log
(
'
$newKey
deleted from memory'
);
}
// _routesKey?.remove(key);
return
true
;
...
...
lib/src/navigation/routes/observers/route_observer.dart
View file @
b0e5f72
...
...
@@ -72,13 +72,13 @@ class GetObserver extends NavigatorObserver {
String
routeName
=
name
(
route
);
if
(
isSnackbar
)
{
GetConfig
.
log
(
"OPEN SNACKBAR
$routeName
"
,
name:
'[GETX]'
);
GetConfig
.
log
(
"OPEN SNACKBAR
$routeName
"
);
}
else
if
(
isBottomSheet
)
{
GetConfig
.
log
(
"OPEN
$routeName
"
,
name:
'[GETX]'
);
GetConfig
.
log
(
"OPEN
$routeName
"
);
}
else
if
(
isDialog
)
{
GetConfig
.
log
(
"OPEN
$routeName
"
,
name:
'[GETX]'
);
GetConfig
.
log
(
"OPEN
$routeName
"
);
}
else
if
(
isGetPageRoute
)
{
GetConfig
.
log
(
"GOING TO ROUTE
$routeName
"
,
name:
'[GETX]'
);
GetConfig
.
log
(
"GOING TO ROUTE
$routeName
"
);
}
GetConfig
.
currentRoute
=
routeName
;
...
...
@@ -107,13 +107,13 @@ class GetObserver extends NavigatorObserver {
String
routeName
=
name
(
route
);
if
(
isSnackbar
)
{
GetConfig
.
log
(
"CLOSE SNACKBAR
$routeName
"
,
name:
'[GETX]'
);
GetConfig
.
log
(
"CLOSE SNACKBAR
$routeName
"
);
}
else
if
(
isBottomSheet
)
{
GetConfig
.
log
(
"CLOSE
$routeName
"
,
name:
'[GETX]'
);
GetConfig
.
log
(
"CLOSE
$routeName
"
);
}
else
if
(
isDialog
)
{
GetConfig
.
log
(
"CLOSE
$routeName
"
,
name:
'[GETX]'
);
GetConfig
.
log
(
"CLOSE
$routeName
"
);
}
else
if
(
isGetPageRoute
)
{
GetConfig
.
log
(
"CLOSE TO ROUTE
$routeName
"
,
name:
'[GETX]'
);
GetConfig
.
log
(
"CLOSE TO ROUTE
$routeName
"
);
}
GetConfig
.
currentRoute
=
routeName
;
...
...
@@ -136,8 +136,8 @@ class GetObserver extends NavigatorObserver {
void
didReplace
({
Route
newRoute
,
Route
oldRoute
})
{
super
.
didReplace
(
newRoute:
newRoute
,
oldRoute:
oldRoute
);
GetConfig
.
log
(
"REPLACE ROUTE
${oldRoute?.settings?.name}
"
,
name:
'[GETX]'
);
GetConfig
.
log
(
"NEW ROUTE
${newRoute?.settings?.name}
"
,
name:
'[GETX]'
);
GetConfig
.
log
(
"REPLACE ROUTE
${oldRoute?.settings?.name}
"
);
GetConfig
.
log
(
"NEW ROUTE
${newRoute?.settings?.name}
"
);
GetConfig
.
currentRoute
=
name
(
newRoute
);
...
...
@@ -158,7 +158,7 @@ class GetObserver extends NavigatorObserver {
@override
void
didRemove
(
Route
route
,
Route
previousRoute
)
{
super
.
didRemove
(
route
,
previousRoute
);
GetConfig
.
log
(
"REMOVING ROUTE
${route?.settings?.name}
"
,
name:
'[GETX]'
);
GetConfig
.
log
(
"REMOVING ROUTE
${route?.settings?.name}
"
);
_routeSend
.
update
((
value
)
{
value
.
route
=
previousRoute
;
...
...
lib/src/state_manager/rx/rx_event.dart
View file @
b0e5f72
...
...
@@ -100,7 +100,7 @@ class Worker {
final
String
type
;
void
_message
()
{
GetConfig
.
log
(
'Worker
$type
disposed'
,
name:
'[Getx]'
);
GetConfig
.
log
(
'Worker
$type
disposed'
);
}
void
dispose
()
{
...
...
Please
register
or
login
to post a comment