flutter upgrade
parent
913170ce20
commit
e1b6f7c2cb
|
|
@ -1,3 +1,9 @@
|
|||
plugins {
|
||||
id "com.android.application"
|
||||
id "kotlin-android"
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
}
|
||||
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
|
|
@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
|
|||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '4'
|
||||
|
|
@ -21,20 +22,16 @@ if (flutterVersionName == null) {
|
|||
flutterVersionName = '1.0.4'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
def keystoreProperties = new Properties()
|
||||
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
namespace "kz.com.aman.kassa"
|
||||
compileSdkVersion 36
|
||||
ndkVersion "28.2.13676358"
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
|
|
@ -46,7 +43,7 @@ android {
|
|||
|
||||
defaultConfig {
|
||||
applicationId "kz.com.aman.kassa"
|
||||
minSdkVersion 21
|
||||
minSdkVersion flutter.minSdkVersion
|
||||
targetSdkVersion 35
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
|
|
@ -62,29 +59,24 @@ android {
|
|||
storePassword keystoreProperties['storePassword']
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
shrinkResources false
|
||||
minifyEnabled false
|
||||
useProguard false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
defaultConfig {
|
||||
minSdkVersion 24
|
||||
}
|
||||
}
|
||||
release {
|
||||
shrinkResources false
|
||||
minifyEnabled false
|
||||
useProguard false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
//coreLibraryDesugaringEnabled true
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
|
|
@ -93,9 +85,8 @@ android {
|
|||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||
jvmTarget = JavaVersion.VERSION_17.toString()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
flutter {
|
||||
|
|
@ -103,7 +94,6 @@ flutter {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
//coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.9'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
|
|
@ -111,15 +101,5 @@ dependencies {
|
|||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test:runner:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
|
||||
|
||||
// https://mvnrepository.com/artifact/com.google.code.gson/gson
|
||||
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
|
||||
|
||||
|
||||
//implementation 'com.android.support:multidex:2.0.1'
|
||||
//m4bank dependencies
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,24 +1,18 @@
|
|||
buildscript {
|
||||
ext.kotlin_version = '1.6.10'
|
||||
ext.kotlin_version = '2.2.20'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
|
|
@ -37,13 +31,42 @@ subprojects {
|
|||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
gradle.beforeProject { proj ->
|
||||
proj.afterEvaluate {
|
||||
if (proj.plugins.hasPlugin("com.android.library")) {
|
||||
try {
|
||||
if (!proj.android.namespace) {
|
||||
def manifestFile = proj.file("src/main/AndroidManifest.xml")
|
||||
if (manifestFile.exists()) {
|
||||
def manifest = new groovy.xml.XmlSlurper().parse(manifestFile)
|
||||
def packageName = manifest.'@package'?.toString()
|
||||
if (packageName) {
|
||||
proj.android.namespace = packageName
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
// Force Java 17 for all Android subprojects to match global Kotlin JVM target 17
|
||||
if (proj.plugins.hasPlugin("com.android.library") || proj.plugins.hasPlugin("com.android.application")) {
|
||||
try {
|
||||
proj.android.compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.layout.buildDirectory
|
||||
}
|
||||
|
||||
allprojects {
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
jvmTarget = "17"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,3 +2,8 @@ org.gradle.jvmargs=-Xmx1536M
|
|||
android.enableR8=true
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
# This builtInKotlin flag was added automatically by Flutter migrator
|
||||
android.builtInKotlin=false
|
||||
# This newDsl flag was added automatically by Flutter migrator
|
||||
android.newDsl=false
|
||||
android.defaults.buildfeatures.buildconfig=true
|
||||
|
|
|
|||
|
|
@ -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-6.1.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-all.zip
|
||||
|
|
|
|||
|
|
@ -1,15 +1,25 @@
|
|||
include ':app'
|
||||
pluginManagement {
|
||||
def flutterSdkPath = {
|
||||
def properties = new Properties()
|
||||
file("local.properties").withInputStream { properties.load(it) }
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
return flutterSdkPath
|
||||
}()
|
||||
|
||||
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
def plugins = new Properties()
|
||||
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
|
||||
if (pluginsFile.exists()) {
|
||||
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins.each { name, path ->
|
||||
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
|
||||
include ":$name"
|
||||
project(":$name").projectDir = pluginDirectory
|
||||
plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version "8.11.1" apply false
|
||||
id "org.jetbrains.kotlin.android" version "2.2.20" apply false
|
||||
}
|
||||
|
||||
include ":app"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import 'package:aman_kassa_flutter/redux/state/user_state.dart';
|
|||
import 'package:aman_kassa_flutter/redux/store.dart';
|
||||
import 'package:aman_kassa_flutter/views/login/login_view.dart';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:device_info/device_info.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:aman_kassa_flutter/core/models/message.dart';
|
||||
import 'package:aman_kassa_flutter/core/models/response.dart';
|
||||
import 'package:aman_kassa_flutter/core/models/smena.dart';
|
||||
|
|
|
|||
|
|
@ -1,173 +1,30 @@
|
|||
import 'dart:io';
|
||||
import 'dart:async';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:aman_kassa_flutter/core/base/base_service.dart';
|
||||
import 'package:bluetooth_print/bluetooth_print.dart';
|
||||
import 'package:bluetooth_print/bluetooth_print_model.dart';
|
||||
import 'package:flutter_blue/flutter_blue.dart' as flutter_blue;
|
||||
import 'package:flutter_blue/gen/flutterblue.pb.dart' as proto;
|
||||
import 'package:aman_kassa_flutter/core/models/bluetooth_device.dart';
|
||||
|
||||
// Stub implementation — bluetooth print disabled
|
||||
class BluePrintService extends BaseService {
|
||||
final BluetoothPrint _bluetoothAndr = BluetoothPrint.instance;
|
||||
flutter_blue.BluetoothDevice? _bluetoothDeviceIOS;
|
||||
final flutter_blue.FlutterBlue _bluetoothIOS =
|
||||
flutter_blue.FlutterBlue.instance;
|
||||
|
||||
final bool isAndroid = Platform.isAndroid;
|
||||
final bool isIos = Platform.isIOS;
|
||||
// final bool isAndroid = false;
|
||||
// final bool isIos = true;
|
||||
|
||||
BluetoothDevice? _device;
|
||||
|
||||
Future<void> scan() async {
|
||||
if (isAndroid) {
|
||||
await _bluetoothAndr.startScan(timeout: Duration(seconds: 4));
|
||||
} else if (isIos) {
|
||||
await _bluetoothIOS.startScan(timeout: const Duration(seconds: 5));
|
||||
}
|
||||
}
|
||||
Future<void> scan() async {}
|
||||
|
||||
Future<void> stopScan() async {
|
||||
if (isAndroid) {
|
||||
await _bluetoothAndr.stopScan();
|
||||
} else if (isIos) {
|
||||
await _bluetoothIOS.stopScan();
|
||||
}
|
||||
}
|
||||
Future<void> stopScan() async {}
|
||||
|
||||
Stream<List<BluetoothDevice>> get scanResult {
|
||||
if (isAndroid)
|
||||
return _bluetoothAndr.scanResults;
|
||||
else
|
||||
return _bluetoothIOS.scanResults.asyncMap<List<BluetoothDevice>>(
|
||||
(event) =>
|
||||
Future.wait(event.toList().map((e) async => BluetoothDevice()
|
||||
..name = e.device.name
|
||||
..type = e.device.type.index
|
||||
..address = e.device.id.id)));
|
||||
}
|
||||
Stream<List<BluetoothDevice>> get scanResult =>
|
||||
Stream<List<BluetoothDevice>>.value([]);
|
||||
|
||||
Stream<bool> get isScanning =>
|
||||
isAndroid ? _bluetoothAndr.isScanning : _bluetoothIOS.isScanning;
|
||||
Stream<bool> get isScanning => Stream<bool>.value(false);
|
||||
|
||||
Stream<int> get state => isAndroid
|
||||
? _bluetoothAndr.state
|
||||
: _bluetoothIOS.state.asyncMap<int>((event) => event.index);
|
||||
Stream<int> get state => Stream<int>.value(0);
|
||||
|
||||
set device(BluetoothDevice device) => _device = device;
|
||||
|
||||
Future<bool> connect() async {
|
||||
bool response = false;
|
||||
if (_device == null) {
|
||||
response = false;
|
||||
} else {
|
||||
// try {
|
||||
// await _bluetoothAndr.connect(_device!);
|
||||
// await Future.delayed(Duration(seconds: 5));
|
||||
// response = true;
|
||||
// } catch (e) {
|
||||
// print('Error connect $e');
|
||||
// response = false;
|
||||
// }
|
||||
Future<bool> connect() async => false;
|
||||
|
||||
try {
|
||||
if (isAndroid) {
|
||||
await _bluetoothAndr.connect(_device!);
|
||||
} else if (isIos) {
|
||||
_bluetoothDeviceIOS = flutter_blue.BluetoothDevice.fromProto(
|
||||
proto.BluetoothDevice(
|
||||
name: _device?.name ?? '',
|
||||
remoteId: _device?.address ?? '',
|
||||
type: proto.BluetoothDevice_Type.valueOf(_device?.type ?? 0),
|
||||
),
|
||||
);
|
||||
final List<flutter_blue.BluetoothDevice> connectedDevices =
|
||||
await _bluetoothIOS.connectedDevices;
|
||||
final int deviceConnectedIndex = connectedDevices
|
||||
.indexWhere((flutter_blue.BluetoothDevice bluetoothDevice) {
|
||||
return bluetoothDevice.id == _bluetoothDeviceIOS?.id;
|
||||
});
|
||||
if (deviceConnectedIndex < 0) {
|
||||
await _bluetoothDeviceIOS?.connect();
|
||||
}
|
||||
}
|
||||
|
||||
response = true;
|
||||
_device?.connected = true;
|
||||
return Future<bool>.value(response);
|
||||
} on Exception catch (error) {
|
||||
print('$runtimeType - Error $error');
|
||||
response = false;
|
||||
_device?.connected = false;
|
||||
return Future<bool>.value(response);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<bool> disconnect() async {
|
||||
bool response = false;
|
||||
try {
|
||||
if (isAndroid) {
|
||||
await _bluetoothAndr.disconnect();
|
||||
} else if (isIos) {
|
||||
await _bluetoothDeviceIOS?.disconnect();
|
||||
}
|
||||
|
||||
print('disconnected');
|
||||
response = true;
|
||||
} catch (e) {
|
||||
print('Error $e');
|
||||
response = false;
|
||||
}
|
||||
return response;
|
||||
}
|
||||
Future<bool> disconnect() async => true;
|
||||
|
||||
Future<bool> printBytes(Uint8List bytes,
|
||||
{int chunkSizeBytes = 20, int queueSleepTimeMs = 20}) async {
|
||||
Map<String, dynamic> config = Map();
|
||||
final len = bytes.length;
|
||||
List<List<int>> chunks = [];
|
||||
for (var i = 0; i < len; i += chunkSizeBytes) {
|
||||
var end = (i + chunkSizeBytes < len) ? i + chunkSizeBytes : len;
|
||||
chunks.add(bytes.sublist(i, end));
|
||||
}
|
||||
|
||||
for (var i = 0; i < chunks.length; i += 1) {
|
||||
if (isAndroid) {
|
||||
await _printAndroid(chunks[i], config);
|
||||
} else if (isIos) {
|
||||
await _printIos(Uint8List.fromList(chunks[i]), config);
|
||||
}
|
||||
|
||||
await Future.delayed(Duration(milliseconds: queueSleepTimeMs));
|
||||
}
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<void> _printIos(Uint8List bytes,Map<String, dynamic> config) async {
|
||||
final List<flutter_blue.BluetoothService> bluetoothServices =
|
||||
await _bluetoothDeviceIOS?.discoverServices() ??
|
||||
<flutter_blue.BluetoothService>[];
|
||||
final flutter_blue.BluetoothService bluetoothService =
|
||||
bluetoothServices.firstWhere(
|
||||
(flutter_blue.BluetoothService service) => service.isPrimary,
|
||||
);
|
||||
final flutter_blue.BluetoothCharacteristic characteristic =
|
||||
bluetoothService.characteristics.firstWhere(
|
||||
(flutter_blue.BluetoothCharacteristic bluetoothCharacteristic) =>
|
||||
bluetoothCharacteristic.properties.write,
|
||||
);
|
||||
await characteristic.write(bytes, withoutResponse: true);
|
||||
}
|
||||
|
||||
Future<void> _printAndroid(List<int> chunk ,Map<String, dynamic> config) async {
|
||||
|
||||
|
||||
await _bluetoothAndr.rawBytes(config, chunk);
|
||||
}
|
||||
{int chunkSizeBytes = 20, int queueSleepTimeMs = 20}) async => false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,9 +106,8 @@ class MainApplication extends StatelessWidget {
|
|||
),
|
||||
builder: (context, child) => MaterialApp(
|
||||
theme: ThemeData(
|
||||
backgroundColor: backgroundColor,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: primaryColor).copyWith(surface: backgroundColor),
|
||||
primaryColor: primaryColor,
|
||||
accentColor: yellowColor,
|
||||
scaffoldBackgroundColor: Colors.white,
|
||||
// textTheme: GoogleFonts.latoTextTheme(
|
||||
// Theme.of(context).textTheme,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:aman_kassa_flutter/core/models/bluetooth_device.dart';
|
||||
import 'package:aman_kassa_flutter/redux/constants/setting_const.dart';
|
||||
import 'package:aman_kassa_flutter/redux/state/setting_state.dart';
|
||||
import 'package:bluetooth_print/bluetooth_print_model.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
import 'package:redux_thunk/redux_thunk.dart';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:aman_kassa_flutter/core/models/bluetooth_device.dart';
|
||||
import 'package:aman_kassa_flutter/redux/constants/setting_const.dart';
|
||||
import 'package:bluetooth_print/bluetooth_print_model.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
@immutable
|
||||
|
|
|
|||
|
|
@ -120,15 +120,16 @@ class _BankSettingViewState extends State<BankSettingView> {
|
|||
labelText: 'Пароль', hintText: "Введите пароль"),
|
||||
),
|
||||
verticalSpaceMedium,
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
onPressed: () => this._saveData(context),
|
||||
child: Text(
|
||||
'Cохранить',
|
||||
style: TextStyle(color: whiteColor, fontSize: 25.0),
|
||||
),
|
||||
color: primaryColor,
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: primaryColor,
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
|
|
|
|||
|
|
@ -122,15 +122,16 @@ class _ForteSettingViewState extends State<ForteSettingView> {
|
|||
labelText: 'Пароль', hintText: "Введите пароль"),
|
||||
),
|
||||
verticalSpaceMedium,
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
onPressed: () => this._saveData(context),
|
||||
child: Text(
|
||||
'Cохранить',
|
||||
style: TextStyle(color: whiteColor, fontSize: 25.0),
|
||||
),
|
||||
color: primaryColor,
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: primaryColor,
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
|
|
|
|||
|
|
@ -171,13 +171,13 @@ class _BankViewState extends State<BankView> {
|
|||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: Text('Activity m4Bank'), onPressed: activity),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Text('version: $versionValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: Text('Version'), onPressed: version),
|
||||
],
|
||||
),
|
||||
|
|
@ -185,7 +185,7 @@ class _BankViewState extends State<BankView> {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Text('init: $initValue' , overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: Text('Init'), onPressed: initialize),
|
||||
],
|
||||
),
|
||||
|
|
@ -193,7 +193,7 @@ class _BankViewState extends State<BankView> {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Text('connection: $connectionValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: Text('Connect'), onPressed: connect),
|
||||
],
|
||||
),
|
||||
|
|
@ -201,21 +201,21 @@ class _BankViewState extends State<BankView> {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Text('auth: $authValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
|
||||
RaisedButton(child: Text('Auth'), onPressed: auth),
|
||||
ElevatedButton(child: Text('Auth'), onPressed: auth),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Text('cancel: $cancelValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
|
||||
RaisedButton(child: Text('Cancel'), onPressed: cancel),
|
||||
ElevatedButton(child: Text('Cancel'), onPressed: cancel),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Text('shutdown: $shutdownValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: Text('Shutdown'), onPressed: shutdown),
|
||||
],
|
||||
),
|
||||
|
|
@ -223,7 +223,7 @@ class _BankViewState extends State<BankView> {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Text('transaction: $transactionValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: Text('Transaction'), onPressed: transaction),
|
||||
],
|
||||
),
|
||||
|
|
@ -231,7 +231,7 @@ class _BankViewState extends State<BankView> {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Text('get: $getValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: Text('Get'), onPressed: get),
|
||||
],
|
||||
),
|
||||
|
|
@ -239,7 +239,7 @@ class _BankViewState extends State<BankView> {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Text('error: $errorValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: Text('Error'), onPressed: error),
|
||||
],
|
||||
),
|
||||
|
|
@ -247,12 +247,12 @@ class _BankViewState extends State<BankView> {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Text('error: $closeDayValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: Text('CloseDay'), onPressed: closeDay),
|
||||
],
|
||||
),
|
||||
Text('pay: $payValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
|
||||
RaisedButton(child: Text('Payment'), onPressed: pay),
|
||||
ElevatedButton(child: Text('Payment'), onPressed: pay),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -26,12 +26,13 @@ import 'package:aman_kassa_flutter/views/settings/printer/PrinterTest.dart';
|
|||
import 'package:aman_kassa_flutter/views/payment/halyk_pos_service.dart';
|
||||
import 'package:aman_kassa_flutter/widgets/fields/busy_button_icon.dart';
|
||||
import 'package:aman_kassa_flutter/widgets/loader/Dialogs.dart';
|
||||
import 'package:bluetooth_print/bluetooth_print_model.dart';
|
||||
import 'package:aman_kassa_flutter/core/models/bluetooth_device.dart';
|
||||
import 'package:esc_pos_utils/esc_pos_utils.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
import 'package:vocsy_esys_flutter_share/vocsy_esys_flutter_share.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../core/models/aman_dao.dart';
|
||||
|
|
@ -401,7 +402,11 @@ class _MyFloatingActionButtonState extends State<MyFloatingActionButton> {
|
|||
|
||||
void shareFile() async {
|
||||
try {
|
||||
await Share.file('Aman Kassa', 'aman_kassa_check.png', base64Decode(widget.data.data!.base64Data!), 'image/png');
|
||||
final bytes = base64Decode(widget.data.data!.base64Data!);
|
||||
final tempDir = await getTemporaryDirectory();
|
||||
final file = File('${tempDir.path}/aman_kassa_check.png');
|
||||
await file.writeAsBytes(bytes);
|
||||
await Share.shareXFiles([XFile(file.path, mimeType: 'image/png')], subject: 'Aman Kassa');
|
||||
} catch (e) {
|
||||
print('error: $e');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class _HistoryViewState extends State<HistoryView> {
|
|||
appBar: AppBar(
|
||||
title: Text('История чеков'),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text(
|
||||
'Очистить',
|
||||
style: TextStyle(
|
||||
|
|
|
|||
|
|
@ -168,7 +168,6 @@ class _HomeViewState extends State<HomeView> with WidgetsBindingObserver {
|
|||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 5.0,
|
||||
brightness: Brightness.light,
|
||||
title: HeaderTitle(),
|
||||
actions: <Widget>[
|
||||
PopupMenu(
|
||||
|
|
|
|||
|
|
@ -37,9 +37,8 @@ class CalculatorTab extends StatelessWidget {
|
|||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: RaisedButton(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
color: redColor,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: redColor, padding: EdgeInsets.all(16.0)),
|
||||
child: Text(
|
||||
"возврат",
|
||||
style: buttonBigTitleTextStyle,
|
||||
|
|
@ -52,9 +51,8 @@ class CalculatorTab extends StatelessWidget {
|
|||
}),
|
||||
),
|
||||
Expanded(
|
||||
child: RaisedButton(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
color: greenColor,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: greenColor, padding: EdgeInsets.all(16.0)),
|
||||
child: Text(
|
||||
"оплата",
|
||||
style: buttonBigTitleTextStyle,
|
||||
|
|
|
|||
|
|
@ -72,9 +72,8 @@ class KassaTab extends StatelessWidget {
|
|||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: RaisedButton(
|
||||
padding: const EdgeInsets.all(8),
|
||||
color: primaryColor,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: primaryColor, padding: const EdgeInsets.all(8)),
|
||||
child: Text(
|
||||
"Добавить",
|
||||
style: buttonBigTitleTextStyle,
|
||||
|
|
@ -88,9 +87,8 @@ class KassaTab extends StatelessWidget {
|
|||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: RaisedButton(
|
||||
padding: EdgeInsets.all(8),
|
||||
color: greenColor,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: greenColor, padding: EdgeInsets.all(8)),
|
||||
child: Text(
|
||||
"Каталог",
|
||||
style: buttonBigTitleTextStyle,
|
||||
|
|
@ -135,9 +133,8 @@ class KassaTab extends StatelessWidget {
|
|||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: RaisedButton(
|
||||
padding: const EdgeInsets.all(8),
|
||||
color: redColor,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: redColor, padding: const EdgeInsets.all(8)),
|
||||
child: Text(
|
||||
"возврат",
|
||||
style: buttonBigTitleTextStyle,
|
||||
|
|
@ -153,9 +150,8 @@ class KassaTab extends StatelessWidget {
|
|||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: RaisedButton(
|
||||
padding: const EdgeInsets.all(8),
|
||||
color: greenColor,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: greenColor, padding: const EdgeInsets.all(8)),
|
||||
child: Text(
|
||||
"оплата",
|
||||
style: buttonBigTitleTextStyle,
|
||||
|
|
|
|||
|
|
@ -115,12 +115,12 @@ class CatalogBottomSheet extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
),
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
child: Text(
|
||||
'Отмена',
|
||||
style: buttonBigTitleTextStyle,
|
||||
),
|
||||
color: redColor,
|
||||
style: ElevatedButton.styleFrom(backgroundColor: redColor),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class _ProductAddBottomSheetState extends State<ProductAddBottomSheet> {
|
|||
child: ElevatedButton(
|
||||
onPressed: _isSearching ? null : _searchByNtin,
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: primaryColor,
|
||||
backgroundColor: primaryColor,
|
||||
padding: EdgeInsets.symmetric(horizontal: 12),
|
||||
),
|
||||
child: _isSearching
|
||||
|
|
|
|||
|
|
@ -108,7 +108,6 @@ class _PaymentViewState extends State<PaymentView> {
|
|||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
brightness: Brightness.light,
|
||||
backgroundColor: whiteColor,
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
|
|
|
|||
|
|
@ -343,7 +343,6 @@ class _PaymentNfcViewState extends State<PaymentNfcView> {
|
|||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
brightness: Brightness.light,
|
||||
backgroundColor: purpleColor,
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class _QrViewState extends State<QrView> {
|
|||
),
|
||||
body: Container(
|
||||
child: Center(
|
||||
child: QrImage(
|
||||
child: QrImageView(
|
||||
data: widget.data.url!,
|
||||
version: QrVersions.auto,
|
||||
size: 220.0,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import 'package:aman_kassa_flutter/core/logger.dart';
|
|||
import 'package:aman_kassa_flutter/core/services/blue_print_service.dart';
|
||||
import 'package:aman_kassa_flutter/redux/actions/setting_actions.dart';
|
||||
import 'package:aman_kassa_flutter/redux/store.dart';
|
||||
import 'package:bluetooth_print/bluetooth_print_model.dart';
|
||||
import 'package:aman_kassa_flutter/core/models/bluetooth_device.dart';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart' hide Image;
|
||||
|
|
|
|||
|
|
@ -76,15 +76,16 @@ class _SettingViewState extends State<SettingView> {
|
|||
keyboardType: TextInputType.number,
|
||||
),
|
||||
verticalSpaceMedium,
|
||||
RaisedButton(
|
||||
ElevatedButton(
|
||||
onPressed: () => this._setPinCode(context),
|
||||
child: Text(
|
||||
'Cохранить настройки',
|
||||
style: TextStyle(color: whiteColor, fontSize: 20.0),
|
||||
),
|
||||
color: primaryColor,
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: primaryColor,
|
||||
padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
|
|
|
|||
|
|
@ -153,8 +153,8 @@ class ProductListItem extends StatelessWidget {
|
|||
actions: <Widget>[
|
||||
Row(
|
||||
children: [
|
||||
RaisedButton(
|
||||
color: redColor,
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: redColor),
|
||||
child: Text(
|
||||
'Отмена',
|
||||
style: TextStyle(fontSize: 18),
|
||||
|
|
@ -166,8 +166,8 @@ class ProductListItem extends StatelessWidget {
|
|||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
RaisedButton(
|
||||
color: primaryColor,
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: primaryColor),
|
||||
child: Text(
|
||||
'Сохранить',
|
||||
style: TextStyle(fontSize: 18),
|
||||
|
|
|
|||
|
|
@ -23,20 +23,20 @@ class CalculatorButton extends StatelessWidget {
|
|||
// width: 1.2,
|
||||
// ),
|
||||
// ),
|
||||
child: FlatButton(
|
||||
child: TextButton(
|
||||
onPressed: () => onTap(buttonText: text),
|
||||
style: TextButton.styleFrom(
|
||||
padding: const EdgeInsets.all(20),
|
||||
backgroundColor: buildMainColor(),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(0),
|
||||
side: BorderSide(color: Colors.black),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(fontSize: 25, fontWeight: FontWeight.w700, color: buildTextColor()),
|
||||
),
|
||||
padding: const EdgeInsets.all(20),
|
||||
highlightColor: Colors.blueGrey[100],
|
||||
splashColor: Colors.blueAccent[100],
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(0),
|
||||
side: BorderSide(color: Colors.black)
|
||||
),
|
||||
color: buildMainColor(),
|
||||
)));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,14 +58,14 @@ class _DialogManagerState extends State<DialogManager> {
|
|||
content: Text(request.description),
|
||||
actions: <Widget>[
|
||||
if (isConfirmationDialog)
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text(request.cancelTitle!),
|
||||
onPressed: () {
|
||||
_dialogService
|
||||
.dialogComplete(DialogResponse(confirmed: false));
|
||||
},
|
||||
),
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text(request.buttonTitle),
|
||||
onPressed: () {
|
||||
_dialogService
|
||||
|
|
@ -129,8 +129,8 @@ class _DialogManagerState extends State<DialogManager> {
|
|||
),
|
||||
actions: <Widget>[
|
||||
if (isConfirmationDialog)
|
||||
RaisedButton(
|
||||
color: redColor,
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: redColor),
|
||||
child: Text(
|
||||
request.cancelTitle!,
|
||||
style: TextStyle(fontSize: 18),
|
||||
|
|
@ -143,8 +143,8 @@ class _DialogManagerState extends State<DialogManager> {
|
|||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
RaisedButton(
|
||||
color: primaryColor,
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: primaryColor),
|
||||
child: Text(
|
||||
request.buttonTitle,
|
||||
style: TextStyle(fontSize: 18),
|
||||
|
|
|
|||
822
pubspec.lock
822
pubspec.lock
File diff suppressed because it is too large
Load Diff
27
pubspec.yaml
27
pubspec.yaml
|
|
@ -23,26 +23,31 @@ dependencies:
|
|||
google_fonts: ^3.0.1
|
||||
material_design_icons_flutter: ^5.0.6996
|
||||
intl: ^0.17.0
|
||||
barcode_scan2: ^4.2.1
|
||||
device_info: ^2.0.3
|
||||
vocsy_esys_flutter_share: ^1.0.1
|
||||
barcode_scan2: ^4.7.2
|
||||
device_info_plus: ^11.0.0
|
||||
share_plus: ^10.0.0
|
||||
auto_size_text: ^3.0.0
|
||||
url_launcher: ^6.1.5
|
||||
qr_flutter: ^4.0.0
|
||||
mask_text_input_formatter: ^2.4.0
|
||||
flutter_screenutil: ^5.5.3+2
|
||||
flutter_screenutil: ^5.9.3
|
||||
shared_preferences: ^2.0.15
|
||||
flutter_lock_screen: ^2.0.1
|
||||
local_auth: ^2.1.2
|
||||
flutter_lock_screen:
|
||||
path: local_packages/flutter_lock_screen
|
||||
#local_auth: ^2.3.0
|
||||
#esc_pos_bluetooth: ^0.4.1
|
||||
esc_pos_utils: ^1.1.0
|
||||
charset_converter: ^2.1.0
|
||||
permission_handler: ^8.3.0
|
||||
bluetooth_print:
|
||||
path: ../bluetooth_print
|
||||
flutter_blue: ^0.8.0
|
||||
charset_converter: ^2.4.0
|
||||
permission_handler: ^12.0.0
|
||||
firebase_messaging: ^12.0.2
|
||||
firebase_core: ^1.20.1
|
||||
dependency_overrides:
|
||||
archive: ^4.0.0
|
||||
file: ^7.0.0
|
||||
material_design_icons_flutter:
|
||||
path: local_packages/material_design_icons_flutter
|
||||
firebase_core_platform_interface: 4.5.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
|
|
|||
Loading…
Reference in New Issue