Skip to content

Commit

Permalink
Add note for #10
Browse files Browse the repository at this point in the history
- #10
  • Loading branch information
mono0926 committed Oct 26, 2020
1 parent e47b857 commit ddf8ad5
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 18 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,32 @@ This is useful for preventing very destructive action is executed mistakenly.
iOS | Android
--- | ---
<img width="516" alt="n5" src="https://user-images.githubusercontent.com/1255062/77243713-712a4300-6c50-11ea-81d4-75d7961d9224.png"> | <img width="516" alt="n6" src="https://user-images.githubusercontent.com/1255062/77243714-71c2d980-6c50-11ea-8bed-aa6b4dfcba0a.png">

---

# FAQ

## The getter `modalBarrierDismissLabel` was called on null

`adaptive_dialog` uses Cupertino-style widgets internally on iOS, so `GlobalCupertinoLocalizations.delegate` is required under certain conditions.

```dart
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
class App extends StatelessWidget {
const App({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
//...
localizationsDelegates: const [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate, // This is required
],
);
}
}
```
6 changes: 6 additions & 0 deletions example/lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart' hide Router;
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:mono_kit/mono_kit.dart';
import 'package:provider/provider.dart';

Expand All @@ -17,6 +18,11 @@ class App extends StatelessWidget {
theme: lightTheme(),
darkTheme: darkTheme(),
onGenerateRoute: context.watch<Router>().onGenerateRoute,
localizationsDelegates: const [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
);
}
}
38 changes: 25 additions & 13 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.9.0"
version: "0.9.0+1"
animations:
dependency: transitive
description:
Expand Down Expand Up @@ -111,6 +111,11 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.2"
flutter_localizations:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
Expand Down Expand Up @@ -162,7 +167,7 @@ packages:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.7+11"
version: "0.6.7+12"
image_picker_platform_interface:
dependency: transitive
description:
Expand All @@ -177,6 +182,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3-nullsafety.1"
json_annotation:
dependency: transitive
description:
Expand Down Expand Up @@ -204,7 +216,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0-nullsafety.4"
mono_kit:
dependency: "direct main"
description:
Expand Down Expand Up @@ -246,7 +258,7 @@ packages:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.18"
version: "1.6.22"
path_provider_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -288,7 +300,7 @@ packages:
name: pedantic_mono
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0+2"
version: "1.10.0+3"
petitparser:
dependency: transitive
description:
Expand Down Expand Up @@ -377,7 +389,7 @@ packages:
name: sqflite
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1+1"
version: "1.3.1+2"
sqflite_common:
dependency: transitive
description:
Expand All @@ -391,7 +403,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.2"
version: "1.10.0-nullsafety.4"
state_notifier:
dependency: transitive
description:
Expand Down Expand Up @@ -468,14 +480,14 @@ packages:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "5.7.2"
version: "5.7.8"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+1"
version: "0.0.1+3"
url_launcher_macos:
dependency: transitive
description:
Expand All @@ -489,14 +501,14 @@ packages:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.8"
version: "1.0.9"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4+1"
version: "0.1.5"
url_launcher_windows:
dependency: transitive
description:
Expand Down Expand Up @@ -540,5 +552,5 @@ packages:
source: hosted
version: "4.5.1"
sdks:
dart: ">=2.10.0-110 <=2.11.0-186.0.dev"
flutter: ">=1.18.0-6.0.pre <2.0.0"
dart: ">=2.10.0-110 <=2.11.0-242.0.dev"
flutter: ">=1.22.0 <2.0.0"
2 changes: 2 additions & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
adaptive_dialog:
mono_kit: ^0.16.0-dev
provider:
Expand Down
8 changes: 4 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0-nullsafety.4"
path:
dependency: transitive
description:
Expand All @@ -94,7 +94,7 @@ packages:
name: pedantic_mono
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0+2"
version: "1.10.0+3"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -113,7 +113,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.2"
version: "1.10.0-nullsafety.4"
stream_channel:
dependency: transitive
description:
Expand Down Expand Up @@ -157,4 +157,4 @@ packages:
source: hosted
version: "2.1.0-nullsafety.3"
sdks:
dart: ">=2.10.0-110 <=2.11.0-186.0.dev"
dart: ">=2.10.0-110 <=2.11.0-242.0.dev"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: adaptive_dialog
description: Show alert dialog or modal action sheet adaptively according to platform.
version: 0.9.0
version: 0.9.0+1
homepage: https://github.com/mono0926/adaptive_dialog
environment:
sdk: ">=2.6.0 <3.0.0"
Expand Down

0 comments on commit ddf8ad5

Please sign in to comment.