Skip to content

Update to latest Android SDK and requirements #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.0.5
* Forked from Microsoft's dual_screen project
* Updated to latest Android, AGP, and Kotlin versions to support newer versions of Flutter
* Re-published on pub.dev as split_screen

## 1.0.4

* Updated AGP to 7 and kotlin to 1.7
Expand Down
27 changes: 0 additions & 27 deletions CONTRIBUTING.md

This file was deleted.

13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Flutter Dual Screen
# Flutter Split Screen

**note**
This project has been forked from the Microsoft DualScreen project in order to keep it up to date with the latest Flutter / Android requirements. The information below is otherwise unchanged, unless necessary.

This contains Microsoft's offerings to streamline foldable and dual-screen development using Flutter. This plugin will work on any platform, but only Android actually has foldable and dual screen devices.

Expand Down Expand Up @@ -73,9 +76,9 @@ Foldable and dual-screen devices have a hinge between the two moving parts of th

## Hinge angle API

To use this plugin, add `dual_screen` as a dependency in your pubspec.yaml file.
To use this plugin, add `split_screen` as a dependency in your pubspec.yaml file.

This will allow you to import DualScreenInfo `import 'package:dual_screen/dual_screen.dart';`
This will allow you to import DualScreenInfo `import 'package:split_screen/split_screen.dart';`

DualScreenInfo exposes 2 static properties:

Expand All @@ -85,7 +88,7 @@ DualScreenInfo exposes 2 static properties:
## Hinge angle example

```dart
import 'package:dual_screen/dual_screen.dart';
import 'package:split_screen/split_screen.dart';

DualScreenInfo.hingeAngleEvents.listen((double hingeAngle) {
print(hingeAngle);
Expand Down Expand Up @@ -128,4 +131,4 @@ Any use of third-party trademarks or logos are subject to those third-party's po

<!-- ## Special thanks -->

<!-- The [dual_screen](https://pub.dev/packages/dual_screen) package was previously owned by [Built to Roam](https://pub.dev/publishers/builttoroam.com/) and it initially offered a way to know if your app is running on a dual screen device and if it is spanned across both screens or not. We would like to thank [Nick Randolph](https://github.com/nickrandolph), [Michael Bui](https://github.com/MaikuB) and [Brett Lim](https://github.com/Brett09) for transferring ownership of `dual_screen` to Microsoft. -->
<!-- The [split_screen](https://pub.dev/packages/split_screen) package was previously owned by [Built to Roam](https://pub.dev/publishers/builttoroam.com/) and it initially offered a way to know if your app is running on a dual screen device and if it is spanned across both screens or not. We would like to thank [Nick Randolph](https://github.com/nickrandolph), [Michael Bui](https://github.com/MaikuB) and [Brett Lim](https://github.com/Brett09) for transferring ownership of `split_screen` to Microsoft. -->
13 changes: 0 additions & 13 deletions SUPPORT.md

This file was deleted.

18 changes: 14 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
group 'com.example.dual_screen'
group 'com.example.split_screen'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.7.21'
ext.kotlin_version = '1.9.22'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.7.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -25,7 +25,17 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 30
compileSdkVersion 35
namespace "com.microsoft.flutterdualscreen"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'dual_screen'
rootProject.name = 'split_screen'
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dual_screen">
>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private const val HINGE_ANGLE_CHANNEL_NAME = "com.microsoft.flutterdualscreen/hi
private const val HINGE_INFO_CHANNEL_NAME = "com.microsoft.flutterdualscreen/hinge_info"

/**
* Manages dual_screen event and method call channels (creates, registers, unregisters).
* Manages split_screen event and method call channels (creates, registers, unregisters).
*
* The two channels it manages:
* - Hinge angle: Event channel that emits a new double value for each hinge sensor angle change.
Expand Down
4 changes: 2 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dual_screen_example
# split_screen_example

Demonstrates how to use the dual_screen plugin.
Demonstrates how to use the split_screen plugin.

## Getting Started

Expand Down
19 changes: 15 additions & 4 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,28 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 31
compileSdkVersion 35

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

namespace "com.example.split_screen_example"

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.dual_screen_example"
minSdkVersion 16
targetSdkVersion 30
applicationId "com.example.split_screen_example"
minSdkVersion flutter.minSdkVersion
targetSdkVersion 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dual_screen_example">
package="com.example.split_screen_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
5 changes: 3 additions & 2 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dual_screen_example">
package="com.example.split_screen_example">
<application
android:label="dual_screen_example"
android:label="split_screen_example"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.dual_screen_example
package com.example.split_screen_example

import io.flutter.embedding.android.FlutterActivity

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.microsoft.flutterdualscreen.dual_screen_example
package com.microsoft.flutterdualscreen.split_screen_example

import io.flutter.embedding.android.FlutterActivity

Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dual_screen_example">
package="com.example.split_screen_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
6 changes: 3 additions & 3 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.7.21'
ext.kotlin_version = '1.9.22'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.7.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/// Licensed under the MIT License.

import 'package:flutter/material.dart';
import 'package:dual_screen/dual_screen.dart';
import 'package:split_screen/split_screen.dart';

void main() {
runApp(MyApp());
Expand Down
10 changes: 5 additions & 5 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: dual_screen_example
description: Demonstrates how to use the dual_screen plugin.
name: split_screen_example
description: Demonstrates how to use the split_screen plugin.
version: 1.0.0

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.12.0"

dependencies:
flutter:
sdk: flutter

dual_screen:
split_screen:
# When depending on this package from a real application you should use:
# dual_screen: ^x.y.z
# split_screen: ^x.y.z
# See https://dart.dev/tools/pub/dependencies#version-constraints
# The example app is bundled with the plugin so we use a path dependency on
# the parent directory to use the current plugin's version.
Expand Down
2 changes: 1 addition & 1 deletion example/test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:dual_screen_example/main.dart';
import 'package:split_screen_example/main.dart';

void main() {
const EventChannel hingeAngleChannel =
Expand Down
2 changes: 1 addition & 1 deletion lib/dual_screen.dart → lib/split_screen.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library dual_screen;
library split_screen;

export 'src/dual_screen_info.dart';
export 'src/two_pane.dart';
Expand Down
10 changes: 5 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: dual_screen
description: Foldable and dual-screen support, like the TwoPane widget and hinge angle sensor data.
version: 1.0.4
name: split_screen
description: Foldable and dual-screen support, like the TwoPane widget and hinge angle sensor data. Forked from the Microsoft dual_screen package.
version: 1.0.5
homepage: https://docs.microsoft.com/en-us/dual-screen/
repository: https://github.com/microsoft/flutter-dualscreen
repository: https://github.com/DeekFit/flutter-splitscreen

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.12.0"
flutter: ">=2.10.0"

dependencies:
Expand Down
2 changes: 1 addition & 1 deletion test/dual_screen_info_test.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// Copyright (c) Microsoft Corporation.
/// Licensed under the MIT License.

import 'package:dual_screen/dual_screen.dart';
import 'package:split_screen/split_screen.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';

Expand Down
2 changes: 1 addition & 1 deletion test/media_query_extension_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import 'dart:ui';

import 'package:dual_screen/dual_screen.dart';
import 'package:split_screen/split_screen.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';

Expand Down
2 changes: 1 addition & 1 deletion test/two_pane_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import 'dart:ui';

import 'package:dual_screen/dual_screen.dart';
import 'package:split_screen/split_screen.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down