Skip to content

Commit

Permalink
Merge branch 'main' into feature/#41-add-replace-where
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlooverenkoen committed Apr 20, 2021
2 parents 2171c33 + 803d369 commit b52a3e8
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
## [0.2.2] - 2021-04-20
### Added
- Disable logger colors on all except android devices

## [0.2.1] - 2021-04-12
### Added
- Extension function on null
Expand Down
3 changes: 3 additions & 0 deletions lib/src/util/environment/impl/os_info_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ class OsConfigInfo {
required this.isWeb,
});
}

final bool platformIsAndroid = Platform.isAndroid;
final bool platformIsIOS = Platform.isIOS;
3 changes: 3 additions & 0 deletions lib/src/util/environment/impl/os_info_stub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ class OsConfigInfo {
required this.isWeb,
});
}

final bool platformIsAndroid = false;
final bool platformIsIOS = false;
3 changes: 3 additions & 0 deletions lib/src/util/environment/os_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ class OsInfo {
/// Returns the [OsInfo] instance. Call [init] first!
static OsInfo get instance => _instance!;
}

final bool isDeviceAndroid = platformIsAndroid;
final bool isDeviceIOS = platformIsIOS;
13 changes: 7 additions & 6 deletions lib/src/util/logging/logging.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ class LoggingFactory {

static LogPrinter _makeLogPrinter() {
return OurPrettyPrinter(
methodCount: 0,
errorMethodCount: 5,
lineLength: 50,
colors: true,
printEmojis: true,
printTime: true);
methodCount: 0,
errorMethodCount: 5,
lineLength: 50,
colors: isDeviceAndroid,
printEmojis: true,
printTime: true,
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: icapps architecture components for flutter projects. Contains commo
homepage: https://github.com/icapps/flutter-icapps-architecture
repository: https://github.com/icapps/flutter-icapps-architecture

version: 0.2.1
version: 0.2.2

environment:
sdk: '>=2.12.0 <3.0.0'
Expand Down
6 changes: 6 additions & 0 deletions test/util/environment/os_config_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,11 @@ void main() {
expect(info.androidSdk, 0);
expect(info.iosVersion, 14.4);
});
test('IsDevice Android or IOS', () {
expect(isDeviceIOS, false);
expect(isDeviceAndroid, false);
expect(stub.platformIsAndroid, false);
expect(stub.platformIsIOS, false);
});
});
}

0 comments on commit b52a3e8

Please sign in to comment.