Skip to content
Closed
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
40 changes: 20 additions & 20 deletions .idea/libraries/Dart_SDK.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion .idea/libraries/Flutter_Plugins.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Another Bother SDK library for Flutter.
Note: This branch does not include RJ-Go support on IOS.

## Android Min SDK
- Requires minSdkVersion 19
- Requires minSdkVersion 21

## iOS Info.plist

Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group 'com.rouninlabs.another_brother'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.7.22'
repositories {
google()
jcenter()
Expand Down Expand Up @@ -41,7 +41,7 @@ android {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
implementation 'com.brother.sdk:printer:4.6.1'
implementation 'com.brother.typeb:print:1.0.0'
Expand Down
10 changes: 6 additions & 4 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion flutter.compileSdkVersion

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

print(flutter)
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.rouninlabs.another_brother_example"
minSdkVersion 21 // Bummped to 21 as a result of Type B Sdk print Pdf
targetSdkVersion 28
minSdkVersion 21// Bummped to 21 as a result of Type B Sdk print Pdf
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -48,12 +49,13 @@ android {
signingConfig signingConfigs.debug
}
}
namespace 'com.rouninlabs.another_brother_example'
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
3 changes: 1 addition & 2 deletions example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rouninlabs.another_brother_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
4 changes: 2 additions & 2 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rouninlabs.another_brother_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
Expand All @@ -11,6 +10,7 @@
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
3 changes: 1 addition & 2 deletions example/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rouninlabs.another_brother_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 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,13 +1,13 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.7.22'
repositories {
google()
jcenter()
}

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

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
12 changes: 6 additions & 6 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
#Mon Aug 07 09:47:11 CST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 9 additions & 7 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class MyApp extends StatefulWidget {

class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
File _selectedImage = null;
File? _selectedImage;

ui.Image _imageToShow = null;
Uint8List _imageBytes = null;
ui.Image? _imageToShow;
Uint8List? _imageBytes;

@override
void initState() {
Expand Down Expand Up @@ -63,7 +63,7 @@ class _MyAppState extends State<MyApp> {
});
}

Future<PrinterStatus> printLabelTypeB() async {
Future<TbPrinterStatus> printLabelTypeB() async {

TbPrinterInfo printerInfo = TbPrinterInfo(
printerModel: TbModel.RJ_3035B,
Expand Down Expand Up @@ -177,6 +177,7 @@ class _MyAppState extends State<MyApp> {
success = await printer.endCommunication(timeoutMillis: 50000);
print("TypeB: Connection Closed? $success");

return printerStatus;
}

Future<ui.Image> loadImage(String assetPath) async {
Expand Down Expand Up @@ -205,7 +206,7 @@ class _MyAppState extends State<MyApp> {
var picture = await recorder.endRecording().toImage(300, 300);

_imageBytes = (await picture.toByteData(format: ImageByteFormat.png))
.buffer
!.buffer
.asUint8List();
setState(() {
//_imageToShow = picture;
Expand Down Expand Up @@ -515,6 +516,7 @@ class _MyAppState extends State<MyApp> {
}

*/
return status;
}

Future<PrinterStatus> printImageBluetooth() async {
Expand Down Expand Up @@ -644,10 +646,10 @@ class _MyAppState extends State<MyApp> {
child: Text('Running on: $_platformVersion\n'),
),
_selectedImage != null
? Image.file(_selectedImage)
? Image.file(_selectedImage!)
: Text("No Image Selected"),
_imageBytes != null
? Image.memory(_imageBytes)
? Image.memory(_imageBytes!)
: Text("No Image From Canvas"),
Row(
mainAxisAlignment: MainAxisAlignment.center,
Expand Down
Loading