This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void checkForCharlesProxy(Dio dio) { | |
| const charlesIp = | |
| String.fromEnvironment('CHARLES_PROXY_IP', defaultValue: null); | |
| if (charlesIp == null) return; | |
| debugPrint('#CharlesProxyEnabled'); | |
| (dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = | |
| (client) { | |
| client.findProxy = (uri) => "PROXY $charlesIp:8888;"; | |
| client.badCertificateCallback = | |
| (X509Certificate cert, String host, int port) => true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final workout = _currentWorkouts.findOrNull((it) => it.id == workoutId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final filtered = _currentChallenges | |
| .where((it) => it.categories.containsAll(filters)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension IterableExt<T> on Iterable<T> { | |
| bool containsAll(Iterable<T> list) { | |
| for (final item in list) { | |
| if (!contains(item)) return false; | |
| } | |
| return true; | |
| } | |
| T findOrNull(bool Function(T) where) => firstWhere(where, orElse: () => null); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| List<Widget> _avatars() => urls.mapIndexed((url, index) { | |
| final padding = _spaceBetween * index; | |
| return Positioned( | |
| top: 0.0, | |
| left: 0.0 + padding, | |
| child: Avatar( | |
| size: size, | |
| imageUrl: url, | |
| ), | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| yield state.copyWith( | |
| favorites: state.favorites.copy()..add(workoutId)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension ListExt<T> on List<T> { | |
| List<T> copy() => List.from(this, growable: true); | |
| List<Y> mapIndexed<Y>(Y Function(T, int) onMap) => | |
| asMap().entries.map((entry) => | |
| onMap(entry.value, entry.key)).toList(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| List<> filter(...) => list.where(...) | |
| .also((it) { | |
| _currentList = it; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| listener: (context, state) { | |
| state.dialogError?.let((it) => showErrorDialog(it, context)); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension KotlinExt<T> on T { | |
| A let<A>(A Function(T) f) => f(this); | |
| T also(void Function(T) f) { | |
| f(this); | |
| return this; | |
| } | |
| } |
NewerOlder