Skip to content

Commit

Permalink
Merge pull request #55 from boyan01/dev-nnbd
Browse files Browse the repository at this point in the history
migrating to null safe
  • Loading branch information
boyan01 committed Dec 15, 2020
2 parents 35f6467 + beb4334 commit 69b6586
Show file tree
Hide file tree
Showing 57 changed files with 1,360 additions and 851 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v1
with:
channel: 'stable'
channel: 'dev'
- run: flutter config --enable-web
- run: flutter pub get

Expand All @@ -30,4 +30,4 @@ jobs:
uses: codecov/codecov-action@v1.0.2
with:
token: ${{secrets.CODECOV_TOKEN}}
flags: unittests
flags: unittests
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [1.1.0-nullsafety.0]
* migrate to nullsafety.

## [1.0.5] - 2020/7/20
* Expose duration to `showSimpleNotification` [#46](https://github.com/boyan01/overlay_support/pull/46) by [Elvis Sun](https://github.com/elvisun)

Expand Down
11 changes: 11 additions & 0 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
18 changes: 18 additions & 0 deletions example/android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
32 changes: 32 additions & 0 deletions example/ios/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*

# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
7 changes: 4 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:overlay_support/overlay_support.dart';
import 'package:overlay_support_example/pages/page_main.dart';
import 'package:overlay_support_example/pages/page_with_ime.dart';

import 'pages/page_main.dart';
import 'pages/page_with_ime.dart';

void main() {
debugDefaultTargetPlatformOverride = TargetPlatform.android;
Expand Down Expand Up @@ -50,7 +51,7 @@ class _ExampleDrawerState extends State<_ExampleDrawer> {
color: Theme.of(context).primaryIconTheme.color,
progress: ProxyAnimation(kAlwaysDismissedAnimation)),
onPressed: () {
_scaffoldKey.currentState.openDrawer();
_scaffoldKey.currentState?.openDrawer();
}),
),
body: HomePage(),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/notification/custom_animation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class CustomAnimationToast extends StatelessWidget {

static final Tween<double> tweenOpacity = Tween<double>(begin: 0, end: 1);

const CustomAnimationToast({Key key, @required this.value}) : super(key: key);
const CustomAnimationToast({Key? key, required this.value}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand Down
6 changes: 3 additions & 3 deletions example/lib/notification/custom_notification.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class MessageNotification extends StatelessWidget {
final String message;

const MessageNotification({
Key key,
@required this.onReply,
@required this.message,
Key? key,
required this.onReply,
required this.message,
}) : super(key: key);

@override
Expand Down
2 changes: 1 addition & 1 deletion example/lib/notification/ios_toast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class IosStyleToast extends StatelessWidget {
Widget build(BuildContext context) {
return SafeArea(
child: DefaultTextStyle(
style: Theme.of(context).textTheme.bodyText2.copyWith(color: Colors.white),
style: Theme.of(context).textTheme.bodyText2!.copyWith(color: Colors.white),
child: Padding(
padding: const EdgeInsets.all(16),
child: Center(
Expand Down
14 changes: 7 additions & 7 deletions example/lib/pages/page_main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class HomePage extends StatelessWidget {
return FlatButton(
textColor: Colors.yellow,
onPressed: () {
OverlaySupportEntry.of(context).dismiss();
OverlaySupportEntry.of(context)!.dismiss();
},
child: Text('Dismiss'));
}),
Expand All @@ -57,7 +57,7 @@ class HomePage extends StatelessWidget {
return MessageNotification(
message: messages[3],
onReply: () {
OverlaySupportEntry.of(context).dismiss();
OverlaySupportEntry.of(context)!.dismiss();
toast('you checked this message');
},
);
Expand All @@ -74,7 +74,7 @@ class HomePage extends StatelessWidget {
return MessageNotification(
message: messages[i],
onReply: () {
OverlaySupportEntry.of(context).dismiss();
OverlaySupportEntry.of(context)!.dismiss();
toast('you checked this message');
},
);
Expand Down Expand Up @@ -121,13 +121,13 @@ class HomePage extends StatelessWidget {
return Container(
color: Color.lerp(Colors.transparent, Colors.black54, t),
child: FractionalTranslation(
translation: Offset.lerp(const Offset(0, -1), const Offset(0, 0), t),
translation: Offset.lerp(const Offset(0, -1), const Offset(0, 0), t)!,
child: Column(
children: <Widget>[
MessageNotification(
message: "Hello",
onReply: () {
OverlaySupportEntry.of(context).dismiss();
OverlaySupportEntry.of(context)!.dismiss();
},
key: ModalKey(const Object()),
),
Expand All @@ -150,7 +150,7 @@ class _Section extends StatelessWidget {

final List<Widget> children;

const _Section({Key key, @required this.title, @required this.children}) : super(key: key);
const _Section({Key? key, required this.title, required this.children}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand All @@ -171,7 +171,7 @@ class _Section extends StatelessWidget {
class _Title extends StatelessWidget {
final String title;

const _Title({Key key, @required this.title}) : super(key: key);
const _Title({Key? key, required this.title}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand Down
3 changes: 2 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: overlay_support_example
description: example for overlay_support library

version: 1.0.0+1
publish_to: none

environment:
sdk: ">=2.1.0 <3.0.0"
sdk: '>=2.12.0-0 <3.0.0'

dependencies:
flutter:
Expand Down
Binary file added example/web/favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/web/icons/Icon-192.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/web/icons/Icon-512.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions example/web/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "example",
"short_name": "example",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "A new Flutter project.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

0 comments on commit 69b6586

Please sign in to comment.