Skip to content

Commit

Permalink
canvas: wrap in OnyxSdkPenArea
Browse files Browse the repository at this point in the history
  • Loading branch information
adil192 committed Jan 9, 2023
1 parent 0f05e76 commit ff92508
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 11 deletions.
7 changes: 5 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ android {
applicationId "com.adilhanney.saber"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 18
minSdkVersion 23
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down Expand Up @@ -85,7 +85,10 @@ android {
}
}


packagingOptions {
pickFirst 'lib/*/libc++_shared.so'
pickFirst 'androidsupportmultidexversion.txt'
}
}

flutter {
Expand Down
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
android:allowBackup="false"
android:fullBackupContent="false"
android:launchMode="singleTask"
tools:targetApi="donut">
tools:targetApi="donut"
tools:replace="android:label,android:allowBackup">
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
7 changes: 7 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ allprojects {
repositories {
google()
mavenCentral()
maven {
url "https://jitpack.io"
}
maven {
url "http://repo.boox.com/repository/maven-public/"
allowInsecureProtocol true
}
}
}

Expand Down
19 changes: 11 additions & 8 deletions lib/components/canvas/canvas.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import 'package:flutter/material.dart';
import 'package:onyxsdk_pen/onyxsdk_pen_area.dart';
import 'package:saber/components/canvas/color_extensions.dart';
import 'package:saber/data/editor/editor_core_info.dart';
import 'package:saber/data/editor/page.dart';
Expand Down Expand Up @@ -45,14 +46,16 @@ class Canvas extends StatelessWidget {
)],
),
child: !placeholder ? ClipRect(
child: InnerCanvas(
key: innerCanvasKey,
pageIndex: pageIndex,
width: pageSize.width,
height: pageSize.height,
textEditing: textEditing,
coreInfo: coreInfo,
currentStroke: currentStroke,
child: OnyxSdkPenArea(
child: InnerCanvas(
key: innerCanvasKey,
pageIndex: pageIndex,
width: pageSize.width,
height: pageSize.height,
textEditing: textEditing,
coreInfo: coreInfo,
currentStroke: currentStroke,
),
),
) : SizedBox(
width: pageSize.width,
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
onyxsdk_pen:
dependency: "direct main"
description:
path: "packages/onyxsdk_pen"
relative: true
source: path
version: "0.0.1"
open_as_default:
dependency: "direct main"
description:
Expand Down
3 changes: 3 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ dependencies:

flutter_localized_locales: ^2.0.3

onyxsdk_pen:
path: packages/onyxsdk_pen

dev_dependencies:
test: ^1.21.4
flutter_test:
Expand Down

0 comments on commit ff92508

Please sign in to comment.