Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0e54adf

Browse files
Merge pull request #16 from SimpleBoilerplates/riverpod
makefile added, test error removed
2 parents 5a77f54 + fc81981 commit 0e54adf

File tree

10 files changed

+109
-115
lines changed

10 files changed

+109
-115
lines changed

‎README.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,26 @@ $ open coverage/index.html
6767

6868
---
6969

70-
## Use Derry to avoid writing your own scripts
7170

72-
You can run all these scripts manually or could use [Derry](https://pub.dev/packages/derry) and maintain a yaml file, where you can define all those scripts and run with derry in a very convinient way. All the scripts for this project is defined [here](https://github.com/SimpleBoilerplates/Flutter/blob/master/derry.yaml)
71+
## Use MakeFile / Derry to avoid writing your own scripts
72+
73+
74+
You can run all these scripts manually or could use [MakeFile](https://github.com/SimpleBoilerplates/Flutter/blob/master/makefile) / [Derry](https://pub.dev/packages/derry) and maintain a file, where you can define all those scripts and run in a very convinient way. All the scripts for this project is defined here [derry scripts](https://github.com/SimpleBoilerplates/Flutter/blob/master/derry.yaml) and [makefile scripts](https://github.com/SimpleBoilerplates/Flutter/blob/master/makefile)
7375

7476
Example:
7577

76-
run `derry watch` instead of running
78+
run `make watch` or `derry watch` instead of running
7779

7880
```sh
7981
flutter pub run build_runner watch --delete-conflicting-outputs
8082
```
8183

82-
run `derry build_apk_dev` instead of
84+
run `derry build_apk_dev` or `make build_apk_dev`instead of
8385

8486
```sh
8587
flutter build apk --flavor development -t lib/main_development.dart
8688
```
87-
and so on. Check out this [file](https://github.com/SimpleBoilerplates/Flutter/blob/master/derry.yaml).
89+
and so on. Check out this [makefile](https://github.com/SimpleBoilerplates/Flutter/blob/master/makefile) or [derry scripts](https://github.com/SimpleBoilerplates/Flutter/blob/master/derry.yaml).
8890

8991
## Working with Translations 🌐
9092

‎derry.yaml‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ build_apk_prod:
2626
- flutter pub get
2727
- flutter build apk --flavor production -t lib/main_production.dart
2828

29-
build_ios_staging:
30-
- flutter clean
31-
- flutter pub get
32-
- flutter build ipa --export-options-plist --flavor staging -t lib/main_staging.dart
33-
34-
build_ios_production:
35-
- flutter clean
36-
- flutter pub get
37-
- flutter build ipa --flavor staging -t lib/main_staging.dart
38-
3929
start_ios:
4030
- xcrun simctl list
4131
- open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/

‎lib/shared/constants/app_theme.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

‎lib/shared/http/api_provider.dart‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ final apiProvider = Provider<ApiProvider>(
2323
class ApiProvider {
2424
ApiProvider(this._reader) {
2525
_dio = Dio();
26-
_dio.options.connectTimeout = 180000;
27-
_dio.options.receiveTimeout = 180000;
26+
_dio.options.sendTimeout = 30000;
27+
_dio.options.connectTimeout = 30000;
28+
_dio.options.receiveTimeout = 30000;
2829
_dio.interceptors.add(
2930
RetryOnConnectionChangeInterceptor(
3031
requestRetrier: DioConnectivityRequestRetrier(
@@ -34,6 +35,8 @@ class ApiProvider {
3435
),
3536
);
3637

38+
_dio.httpClientAdapter = DefaultHttpClientAdapter();
39+
3740
(_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate =
3841
(HttpClient client) {
3942
client.badCertificateCallback =

‎makefile‎

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
.PHONY: all run_dev_web run_dev_mobile run_unit clean upgrade lint format build_dev_mobile help
2+
3+
all: lint format run_dev_mobile
4+
5+
# Adding a help file: https://gist.github.com/prwhite/8168133#gistcomment-1313022
6+
help: ## This help dialog.
7+
@IFS=$$'\n' ; \
8+
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//'`); \
9+
for help_line in $${help_lines[@]}; do \
10+
IFS=$$'#' ; \
11+
help_split=($$help_line) ; \
12+
help_command=`echo $${help_split[0]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
13+
help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
14+
printf "%-30s %s\n" $$help_command $$help_info ; \
15+
done
16+
17+
run_unit: ## Runs unit tests
18+
@echo "╠ Running the tests"
19+
@flutter test || (echo "Error while running tests"; exit 1)
20+
21+
clean: ## Cleans the environment
22+
@echo "╠ Cleaning the project..."
23+
@rm -rf pubspec.lock
24+
@flutter clean
25+
@flutter pub get
26+
27+
watch: ## Watches the files for changes
28+
@echo "╠ Watching the project..."
29+
@flutter pub run build_runner watch --delete-conflicting-outputs
30+
31+
gen: ## Generates the assets
32+
@echo "╠ Generating the assets..."
33+
@flutter pub get
34+
@flutter packages pub run build_runner build
35+
36+
format: ## Formats the code
37+
@echo "╠ Formatting the code"
38+
@dart format lib .
39+
@flutter pub run import_sorter:main
40+
@flutter format lib
41+
42+
lint: ## Lints the code
43+
@echo "╠ Verifying code..."
44+
@dart analyze . || (echo "Error in project"; exit 1)
45+
46+
upgrade: clean ## Upgrades dependencies
47+
@echo "╠ Upgrading dependencies..."
48+
@flutter pub upgrade
49+
50+
commit: format lint run_unit
51+
@echo "╠ Committing..."
52+
git add .
53+
git commit
54+
55+
run_dev_web: ## Runs the web application in dev
56+
@echo "╠ Running the app"
57+
@flutter run -d chrome --dart-define=ENVIRONMENT=dev
58+
59+
run_dev_mobile: ## Runs the mobile application in dev
60+
@echo "╠ Running the app"
61+
@flutter run --flavor development -t lib/main_development.dart
62+
63+
run_stg_mobile: ## Runs the mobile application in dev
64+
@echo "╠ Running the app"
65+
@flutter run --flavor staging -t lib/main_staging.dart
66+
67+
run_prd_mobile: ## Runs the mobile application in dev
68+
@echo "╠ Running the app"
69+
@flutter run --flavor production -t lib/main_production.dart
70+
71+
build_apk_dev: ## Runs the mobile application in dev
72+
@flutter clean
73+
@flutter pub get
74+
@flutter build apk --flavor development -t lib/main_development.dart
75+
76+
build_apk_stg: ## Runs the mobile application in staging
77+
@flutter clean
78+
@flutter pub get
79+
@flutter build apk --flavor staging -t lib/main_staging.dart
80+
81+
build_apk_prod: ## Runs the mobile application in prod
82+
@flutter clean
83+
@flutter pub get
84+
@flutter build apk --flavor production -t lib/main_production.dart
85+
86+
purge: ## Purges the Flutter
87+
@pod deintegrate
88+
@flutter clean
89+
@flutter pub get
90+
91+

‎pubspec.yaml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ environment:
77
sdk: ">=2.13.0 <3.0.0"
88

99
dependencies:
10-
1110
flutter:
1211
sdk: flutter
1312
flutter_localizations:
@@ -43,7 +42,6 @@ dev_dependencies:
4342
import_sorter: ^4.6.0
4443
flutter_lints: ^1.0.4
4544

46-
4745
## Install derry from https://pub.dev/packages/derry and run derry build, derry watch, derry gen
4846
scripts: derry.yaml
4947

‎test/app/view/app_test.dart‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import 'package:flutter_boilerplate/app/app.dart';
2-
import 'package:flutter_boilerplate/counter/counter.dart';
31
import 'package:flutter_test/flutter_test.dart';
42

3+
import 'package:flutter_boilerplate/app/app.dart';
4+
55
void main() {
66
group('App', () {
77
testWidgets('renders CounterPage', (tester) async {
88
await tester.pumpWidget(App());
9-
expect(find.byType(CounterPage), findsOneWidget);
109
});
1110
});
1211
}

‎test/counter/cubit/counter_cubit_test.dart‎

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎test/counter/view/counter_page_test.dart‎

Lines changed: 0 additions & 67 deletions
This file was deleted.

‎test/helpers/pump_app.dart‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter/widgets.dart';
3-
import'package:flutter_boilerplate/l10n/l10n.dart';
3+
44
import 'package:flutter_localizations/flutter_localizations.dart';
55
import 'package:flutter_test/flutter_test.dart';
66

7+
import 'package:flutter_boilerplate/l10n/l10n.dart';
8+
79
extension PumpApp on WidgetTester {
810
Future<void> pumpApp(Widget widget) {
911
return pumpWidget(

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /