-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6ce067
commit 373e348
Showing
7 changed files
with
61 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
library impaktfull_architecture; | ||
|
||
/// A Calculator. | ||
class Calculator { | ||
/// Returns [value] plus 1. | ||
int addOne(int value) => value + 1; | ||
} | ||
// 3rd party packages | ||
export 'package:connectivity_plus/connectivity_plus.dart'; | ||
export 'package:device_info_plus/device_info_plus.dart'; | ||
export 'package:dio/dio.dart'; | ||
export 'package:get_it/get_it.dart'; | ||
export 'package:injectable/injectable.dart' hide test; | ||
export 'package:flutter_secure_storage/flutter_secure_storage.dart'; | ||
export 'package:flutter_svg/flutter_svg.dart'; | ||
export 'package:provider/provider.dart'; | ||
export 'package:shared_preferences/shared_preferences.dart'; | ||
export 'package:sprintf/sprintf.dart'; | ||
export 'package:synchronized/synchronized.dart'; | ||
export 'package:tuple/tuple.dart'; | ||
export 'package:url_launcher/url_launcher.dart'; | ||
export 'package:url_launcher/url_launcher_string.dart'; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:connectivity_plus/connectivity_plus.dart'; | ||
import 'package:device_info_plus/device_info_plus.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:flutter_secure_storage/flutter_secure_storage.dart'; | ||
import 'package:injectable/injectable.dart'; | ||
import 'package:shared_preferences/shared_preferences.dart'; | ||
|
||
Future<void> configureImpaktfullArchitecture(GetItHelper gh, | ||
{bool isWeb = kIsWeb}) async { | ||
await _register3rdPartyStorage(gh, isWeb: isWeb); | ||
} | ||
|
||
Future<void> _register3rdPartyStorage(GetItHelper gh, | ||
{required bool isWeb}) async { | ||
await gh.lazySingletonAsync<SharedPreferences>( | ||
() => SharedPreferences.getInstance(), | ||
preResolve: true, | ||
); | ||
gh.lazySingleton<Connectivity>(() => Connectivity()); | ||
gh.lazySingleton<DeviceInfoPlugin>(() => DeviceInfoPlugin()); | ||
gh.lazySingleton<FlutterSecureStorage>(() => const FlutterSecureStorage()); | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
import 'package:impaktfull_architecture/impaktfull_architecture.dart'; | ||
|
||
void main() { | ||
test('adds one to input values', () { | ||
final calculator = Calculator(); | ||
expect(calculator.addOne(2), 3); | ||
expect(calculator.addOne(-7), -6); | ||
expect(calculator.addOne(0), 1); | ||
}); | ||
test('no-op', () {}); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
fvm dart format . |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
fvm flutter packages get |