flutter upgrade

fortenew
Rustem 2026-06-10 13:21:12 +05:00
parent 913170ce20
commit e1b6f7c2cb
30 changed files with 716 additions and 592 deletions

View File

@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties() def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties') def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) { 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') def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) { if (flutterVersionCode == null) {
flutterVersionCode = '4' flutterVersionCode = '4'
@ -21,20 +22,16 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0.4' 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 keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties') def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) { if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
} }
android { android {
compileSdkVersion 31 namespace "kz.com.aman.kassa"
compileSdkVersion 36
ndkVersion "28.2.13676358"
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
@ -46,7 +43,7 @@ android {
defaultConfig { defaultConfig {
applicationId "kz.com.aman.kassa" applicationId "kz.com.aman.kassa"
minSdkVersion 21 minSdkVersion flutter.minSdkVersion
targetSdkVersion 35 targetSdkVersion 35
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
@ -62,29 +59,24 @@ android {
storePassword keystoreProperties['storePassword'] storePassword keystoreProperties['storePassword']
} }
} }
buildTypes { buildTypes {
debug { debug {
shrinkResources false shrinkResources false
minifyEnabled false minifyEnabled false
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
defaultConfig {
minSdkVersion 24
}
} }
release { release {
shrinkResources false shrinkResources false
minifyEnabled false minifyEnabled false
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release signingConfig signingConfigs.release
} }
} }
compileOptions { compileOptions {
//coreLibraryDesugaringEnabled true sourceCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_1_8
} }
packagingOptions { packagingOptions {
@ -93,9 +85,8 @@ android {
} }
kotlinOptions { kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString() jvmTarget = JavaVersion.VERSION_17.toString()
} }
} }
flutter { flutter {
@ -103,7 +94,6 @@ flutter {
} }
dependencies { dependencies {
//coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.9'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
@ -111,15 +101,5 @@ dependencies {
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1' androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.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 group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
//implementation 'com.android.support:multidex:2.0.1'
//m4bank dependencies
} }

View File

@ -1,24 +1,18 @@
buildscript { buildscript {
ext.kotlin_version = '1.6.10' ext.kotlin_version = '2.2.20'
repositories { repositories {
google() google()
jcenter()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.5.0' classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }
allprojects { allprojects {
repositories { repositories {
google() google()
jcenter()
mavenCentral() mavenCentral()
} }
@ -37,13 +31,42 @@ subprojects {
project.evaluationDependsOn(':app') project.evaluationDependsOn(':app')
} }
task clean(type: Delete) { gradle.beforeProject { proj ->
delete rootProject.buildDir 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 { kotlinOptions {
jvmTarget = "1.8" jvmTarget = "17"
}
} }
} }

View File

@ -2,3 +2,8 @@ org.gradle.jvmargs=-Xmx1536M
android.enableR8=true android.enableR8=true
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=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

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists 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

View File

@ -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() repositories {
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') google()
if (pluginsFile.exists()) { mavenCentral()
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } gradlePluginPortal()
}
} }
plugins.each { name, path -> plugins {
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() id "dev.flutter.flutter-plugin-loader" version "1.0.0"
include ":$name" id "com.android.application" version "8.11.1" apply false
project(":$name").projectDir = pluginDirectory id "org.jetbrains.kotlin.android" version "2.2.20" apply false
} }
include ":app"

View File

@ -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/redux/store.dart';
import 'package:aman_kassa_flutter/views/login/login_view.dart'; import 'package:aman_kassa_flutter/views/login/login_view.dart';
import 'package:crypto/crypto.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/message.dart';
import 'package:aman_kassa_flutter/core/models/response.dart'; import 'package:aman_kassa_flutter/core/models/response.dart';
import 'package:aman_kassa_flutter/core/models/smena.dart'; import 'package:aman_kassa_flutter/core/models/smena.dart';

View File

@ -1,173 +1,30 @@
import 'dart:io'; import 'dart:async';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:aman_kassa_flutter/core/base/base_service.dart'; import 'package:aman_kassa_flutter/core/base/base_service.dart';
import 'package:bluetooth_print/bluetooth_print.dart'; import 'package:aman_kassa_flutter/core/models/bluetooth_device.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;
// Stub implementation bluetooth print disabled
class BluePrintService extends BaseService { 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; BluetoothDevice? _device;
Future<void> scan() async { 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> stopScan() async { Future<void> stopScan() async {}
if (isAndroid) {
await _bluetoothAndr.stopScan();
} else if (isIos) {
await _bluetoothIOS.stopScan();
}
}
Stream<List<BluetoothDevice>> get scanResult { Stream<List<BluetoothDevice>> get scanResult =>
if (isAndroid) Stream<List<BluetoothDevice>>.value([]);
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<bool> get isScanning => Stream<bool> get isScanning => Stream<bool>.value(false);
isAndroid ? _bluetoothAndr.isScanning : _bluetoothIOS.isScanning;
Stream<int> get state => isAndroid Stream<int> get state => Stream<int>.value(0);
? _bluetoothAndr.state
: _bluetoothIOS.state.asyncMap<int>((event) => event.index);
set device(BluetoothDevice device) => _device = device; set device(BluetoothDevice device) => _device = device;
Future<bool> connect() async { Future<bool> connect() async => false;
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;
// }
try { Future<bool> disconnect() async => true;
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> printBytes(Uint8List bytes, Future<bool> printBytes(Uint8List bytes,
{int chunkSizeBytes = 20, int queueSleepTimeMs = 20}) async { {int chunkSizeBytes = 20, int queueSleepTimeMs = 20}) async => false;
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);
}
} }

View File

@ -106,9 +106,8 @@ class MainApplication extends StatelessWidget {
), ),
builder: (context, child) => MaterialApp( builder: (context, child) => MaterialApp(
theme: ThemeData( theme: ThemeData(
backgroundColor: backgroundColor, colorScheme: ColorScheme.fromSeed(seedColor: primaryColor).copyWith(surface: backgroundColor),
primaryColor: primaryColor, primaryColor: primaryColor,
accentColor: yellowColor,
scaffoldBackgroundColor: Colors.white, scaffoldBackgroundColor: Colors.white,
// textTheme: GoogleFonts.latoTextTheme( // textTheme: GoogleFonts.latoTextTheme(
// Theme.of(context).textTheme, // Theme.of(context).textTheme,

View File

@ -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/constants/setting_const.dart';
import 'package:aman_kassa_flutter/redux/state/setting_state.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:meta/meta.dart';
import 'package:redux/redux.dart'; import 'package:redux/redux.dart';
import 'package:redux_thunk/redux_thunk.dart'; import 'package:redux_thunk/redux_thunk.dart';

View File

@ -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:aman_kassa_flutter/redux/constants/setting_const.dart';
import 'package:bluetooth_print/bluetooth_print_model.dart';
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
@immutable @immutable

View File

@ -120,15 +120,16 @@ class _BankSettingViewState extends State<BankSettingView> {
labelText: 'Пароль', hintText: "Введите пароль"), labelText: 'Пароль', hintText: "Введите пароль"),
), ),
verticalSpaceMedium, verticalSpaceMedium,
RaisedButton( ElevatedButton(
onPressed: () => this._saveData(context), onPressed: () => this._saveData(context),
child: Text( child: Text(
'Cохранить', 'Cохранить',
style: TextStyle(color: whiteColor, fontSize: 25.0), style: TextStyle(color: whiteColor, fontSize: 25.0),
), ),
color: primaryColor, style: ElevatedButton.styleFrom(
padding: backgroundColor: primaryColor,
const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0), padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0),
),
), ),
], ],

View File

@ -122,15 +122,16 @@ class _ForteSettingViewState extends State<ForteSettingView> {
labelText: 'Пароль', hintText: "Введите пароль"), labelText: 'Пароль', hintText: "Введите пароль"),
), ),
verticalSpaceMedium, verticalSpaceMedium,
RaisedButton( ElevatedButton(
onPressed: () => this._saveData(context), onPressed: () => this._saveData(context),
child: Text( child: Text(
'Cохранить', 'Cохранить',
style: TextStyle(color: whiteColor, fontSize: 25.0), style: TextStyle(color: whiteColor, fontSize: 25.0),
), ),
color: primaryColor, style: ElevatedButton.styleFrom(
padding: backgroundColor: primaryColor,
const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0), padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0),
),
), ),
], ],

View File

@ -171,13 +171,13 @@ class _BankViewState extends State<BankView> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
RaisedButton( ElevatedButton(
child: Text('Activity m4Bank'), onPressed: activity), child: Text('Activity m4Bank'), onPressed: activity),
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Text('version: $versionValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false), Text('version: $versionValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
RaisedButton( ElevatedButton(
child: Text('Version'), onPressed: version), child: Text('Version'), onPressed: version),
], ],
), ),
@ -185,7 +185,7 @@ class _BankViewState extends State<BankView> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Text('init: $initValue' , overflow: TextOverflow.clip, maxLines: 2, softWrap: false), Text('init: $initValue' , overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
RaisedButton( ElevatedButton(
child: Text('Init'), onPressed: initialize), child: Text('Init'), onPressed: initialize),
], ],
), ),
@ -193,7 +193,7 @@ class _BankViewState extends State<BankView> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Text('connection: $connectionValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false), Text('connection: $connectionValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
RaisedButton( ElevatedButton(
child: Text('Connect'), onPressed: connect), child: Text('Connect'), onPressed: connect),
], ],
), ),
@ -201,21 +201,21 @@ class _BankViewState extends State<BankView> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Text('auth: $authValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false), Text('auth: $authValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
RaisedButton(child: Text('Auth'), onPressed: auth), ElevatedButton(child: Text('Auth'), onPressed: auth),
], ],
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Text('cancel: $cancelValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false), Text('cancel: $cancelValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
RaisedButton(child: Text('Cancel'), onPressed: cancel), ElevatedButton(child: Text('Cancel'), onPressed: cancel),
], ],
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Text('shutdown: $shutdownValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false), Text('shutdown: $shutdownValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
RaisedButton( ElevatedButton(
child: Text('Shutdown'), onPressed: shutdown), child: Text('Shutdown'), onPressed: shutdown),
], ],
), ),
@ -223,7 +223,7 @@ class _BankViewState extends State<BankView> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Text('transaction: $transactionValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false), Text('transaction: $transactionValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
RaisedButton( ElevatedButton(
child: Text('Transaction'), onPressed: transaction), child: Text('Transaction'), onPressed: transaction),
], ],
), ),
@ -231,7 +231,7 @@ class _BankViewState extends State<BankView> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Text('get: $getValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false), Text('get: $getValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
RaisedButton( ElevatedButton(
child: Text('Get'), onPressed: get), child: Text('Get'), onPressed: get),
], ],
), ),
@ -239,7 +239,7 @@ class _BankViewState extends State<BankView> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Text('error: $errorValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false), Text('error: $errorValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
RaisedButton( ElevatedButton(
child: Text('Error'), onPressed: error), child: Text('Error'), onPressed: error),
], ],
), ),
@ -247,12 +247,12 @@ class _BankViewState extends State<BankView> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Text('error: $closeDayValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false), Text('error: $closeDayValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
RaisedButton( ElevatedButton(
child: Text('CloseDay'), onPressed: closeDay), child: Text('CloseDay'), onPressed: closeDay),
], ],
), ),
Text('pay: $payValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false), Text('pay: $payValue', overflow: TextOverflow.clip, maxLines: 2, softWrap: false),
RaisedButton(child: Text('Payment'), onPressed: pay), ElevatedButton(child: Text('Payment'), onPressed: pay),
], ],
), ),
), ),

View File

@ -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/views/payment/halyk_pos_service.dart';
import 'package:aman_kassa_flutter/widgets/fields/busy_button_icon.dart'; import 'package:aman_kassa_flutter/widgets/fields/busy_button_icon.dart';
import 'package:aman_kassa_flutter/widgets/loader/Dialogs.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:esc_pos_utils/esc_pos_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.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 'package:url_launcher/url_launcher.dart';
import '../../core/models/aman_dao.dart'; import '../../core/models/aman_dao.dart';
@ -401,7 +402,11 @@ class _MyFloatingActionButtonState extends State<MyFloatingActionButton> {
void shareFile() async { void shareFile() async {
try { 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) { } catch (e) {
print('error: $e'); print('error: $e');
} }

View File

@ -47,7 +47,7 @@ class _HistoryViewState extends State<HistoryView> {
appBar: AppBar( appBar: AppBar(
title: Text('История чеков'), title: Text('История чеков'),
actions: <Widget>[ actions: <Widget>[
FlatButton( TextButton(
child: Text( child: Text(
'Очистить', 'Очистить',
style: TextStyle( style: TextStyle(

View File

@ -168,7 +168,6 @@ class _HomeViewState extends State<HomeView> with WidgetsBindingObserver {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
titleSpacing: 5.0, titleSpacing: 5.0,
brightness: Brightness.light,
title: HeaderTitle(), title: HeaderTitle(),
actions: <Widget>[ actions: <Widget>[
PopupMenu( PopupMenu(

View File

@ -37,9 +37,8 @@ class CalculatorTab extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: RaisedButton( child: ElevatedButton(
padding: EdgeInsets.all(16.0), style: ElevatedButton.styleFrom(backgroundColor: redColor, padding: EdgeInsets.all(16.0)),
color: redColor,
child: Text( child: Text(
"возврат", "возврат",
style: buttonBigTitleTextStyle, style: buttonBigTitleTextStyle,
@ -52,9 +51,8 @@ class CalculatorTab extends StatelessWidget {
}), }),
), ),
Expanded( Expanded(
child: RaisedButton( child: ElevatedButton(
padding: EdgeInsets.all(16.0), style: ElevatedButton.styleFrom(backgroundColor: greenColor, padding: EdgeInsets.all(16.0)),
color: greenColor,
child: Text( child: Text(
"оплата", "оплата",
style: buttonBigTitleTextStyle, style: buttonBigTitleTextStyle,

View File

@ -72,9 +72,8 @@ class KassaTab extends StatelessWidget {
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.all(4.0), padding: const EdgeInsets.all(4.0),
child: RaisedButton( child: ElevatedButton(
padding: const EdgeInsets.all(8), style: ElevatedButton.styleFrom(backgroundColor: primaryColor, padding: const EdgeInsets.all(8)),
color: primaryColor,
child: Text( child: Text(
"Добавить", "Добавить",
style: buttonBigTitleTextStyle, style: buttonBigTitleTextStyle,
@ -88,9 +87,8 @@ class KassaTab extends StatelessWidget {
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.all(4.0), padding: const EdgeInsets.all(4.0),
child: RaisedButton( child: ElevatedButton(
padding: EdgeInsets.all(8), style: ElevatedButton.styleFrom(backgroundColor: greenColor, padding: EdgeInsets.all(8)),
color: greenColor,
child: Text( child: Text(
"Каталог", "Каталог",
style: buttonBigTitleTextStyle, style: buttonBigTitleTextStyle,
@ -135,9 +133,8 @@ class KassaTab extends StatelessWidget {
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.all(4.0), padding: const EdgeInsets.all(4.0),
child: RaisedButton( child: ElevatedButton(
padding: const EdgeInsets.all(8), style: ElevatedButton.styleFrom(backgroundColor: redColor, padding: const EdgeInsets.all(8)),
color: redColor,
child: Text( child: Text(
"возврат", "возврат",
style: buttonBigTitleTextStyle, style: buttonBigTitleTextStyle,
@ -153,9 +150,8 @@ class KassaTab extends StatelessWidget {
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.all(4.0), padding: const EdgeInsets.all(4.0),
child: RaisedButton( child: ElevatedButton(
padding: const EdgeInsets.all(8), style: ElevatedButton.styleFrom(backgroundColor: greenColor, padding: const EdgeInsets.all(8)),
color: greenColor,
child: Text( child: Text(
"оплата", "оплата",
style: buttonBigTitleTextStyle, style: buttonBigTitleTextStyle,

View File

@ -115,12 +115,12 @@ class CatalogBottomSheet extends StatelessWidget {
}, },
), ),
), ),
RaisedButton( ElevatedButton(
child: Text( child: Text(
'Отмена', 'Отмена',
style: buttonBigTitleTextStyle, style: buttonBigTitleTextStyle,
), ),
color: redColor, style: ElevatedButton.styleFrom(backgroundColor: redColor),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}), }),

View File

@ -90,7 +90,7 @@ class _ProductAddBottomSheetState extends State<ProductAddBottomSheet> {
child: ElevatedButton( child: ElevatedButton(
onPressed: _isSearching ? null : _searchByNtin, onPressed: _isSearching ? null : _searchByNtin,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: primaryColor, backgroundColor: primaryColor,
padding: EdgeInsets.symmetric(horizontal: 12), padding: EdgeInsets.symmetric(horizontal: 12),
), ),
child: _isSearching child: _isSearching

View File

@ -108,7 +108,6 @@ class _PaymentViewState extends State<PaymentView> {
}, },
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
brightness: Brightness.light,
backgroundColor: whiteColor, backgroundColor: whiteColor,
elevation: 0, elevation: 0,
leading: IconButton( leading: IconButton(

View File

@ -343,7 +343,6 @@ class _PaymentNfcViewState extends State<PaymentNfcView> {
}, },
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
brightness: Brightness.light,
backgroundColor: purpleColor, backgroundColor: purpleColor,
elevation: 0, elevation: 0,
leading: IconButton( leading: IconButton(

View File

@ -26,7 +26,7 @@ class _QrViewState extends State<QrView> {
), ),
body: Container( body: Container(
child: Center( child: Center(
child: QrImage( child: QrImageView(
data: widget.data.url!, data: widget.data.url!,
version: QrVersions.auto, version: QrVersions.auto,
size: 220.0, size: 220.0,

View File

@ -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/core/services/blue_print_service.dart';
import 'package:aman_kassa_flutter/redux/actions/setting_actions.dart'; import 'package:aman_kassa_flutter/redux/actions/setting_actions.dart';
import 'package:aman_kassa_flutter/redux/store.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/foundation.dart';
import 'package:flutter/material.dart' hide Image; import 'package:flutter/material.dart' hide Image;

View File

@ -76,15 +76,16 @@ class _SettingViewState extends State<SettingView> {
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
), ),
verticalSpaceMedium, verticalSpaceMedium,
RaisedButton( ElevatedButton(
onPressed: () => this._setPinCode(context), onPressed: () => this._setPinCode(context),
child: Text( child: Text(
'Cохранить настройки', 'Cохранить настройки',
style: TextStyle(color: whiteColor, fontSize: 20.0), style: TextStyle(color: whiteColor, fontSize: 20.0),
), ),
color: primaryColor, style: ElevatedButton.styleFrom(
padding: backgroundColor: primaryColor,
const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0), padding: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20.0),
),
), ),
], ],

View File

@ -153,8 +153,8 @@ class ProductListItem extends StatelessWidget {
actions: <Widget>[ actions: <Widget>[
Row( Row(
children: [ children: [
RaisedButton( ElevatedButton(
color: redColor, style: ElevatedButton.styleFrom(backgroundColor: redColor),
child: Text( child: Text(
'Отмена', 'Отмена',
style: TextStyle(fontSize: 18), style: TextStyle(fontSize: 18),
@ -166,8 +166,8 @@ class ProductListItem extends StatelessWidget {
SizedBox( SizedBox(
width: 5, width: 5,
), ),
RaisedButton( ElevatedButton(
color: primaryColor, style: ElevatedButton.styleFrom(backgroundColor: primaryColor),
child: Text( child: Text(
'Сохранить', 'Сохранить',
style: TextStyle(fontSize: 18), style: TextStyle(fontSize: 18),

View File

@ -23,20 +23,20 @@ class CalculatorButton extends StatelessWidget {
// width: 1.2, // width: 1.2,
// ), // ),
// ), // ),
child: FlatButton( child: TextButton(
onPressed: () => onTap(buttonText: text), 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( child: Text(
text, text,
style: TextStyle(fontSize: 25, fontWeight: FontWeight.w700, color: buildTextColor()), 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(),
))); )));
} }

View File

@ -58,14 +58,14 @@ class _DialogManagerState extends State<DialogManager> {
content: Text(request.description), content: Text(request.description),
actions: <Widget>[ actions: <Widget>[
if (isConfirmationDialog) if (isConfirmationDialog)
FlatButton( TextButton(
child: Text(request.cancelTitle!), child: Text(request.cancelTitle!),
onPressed: () { onPressed: () {
_dialogService _dialogService
.dialogComplete(DialogResponse(confirmed: false)); .dialogComplete(DialogResponse(confirmed: false));
}, },
), ),
FlatButton( TextButton(
child: Text(request.buttonTitle), child: Text(request.buttonTitle),
onPressed: () { onPressed: () {
_dialogService _dialogService
@ -129,8 +129,8 @@ class _DialogManagerState extends State<DialogManager> {
), ),
actions: <Widget>[ actions: <Widget>[
if (isConfirmationDialog) if (isConfirmationDialog)
RaisedButton( ElevatedButton(
color: redColor, style: ElevatedButton.styleFrom(backgroundColor: redColor),
child: Text( child: Text(
request.cancelTitle!, request.cancelTitle!,
style: TextStyle(fontSize: 18), style: TextStyle(fontSize: 18),
@ -143,8 +143,8 @@ class _DialogManagerState extends State<DialogManager> {
SizedBox( SizedBox(
width: 5, width: 5,
), ),
RaisedButton( ElevatedButton(
color: primaryColor, style: ElevatedButton.styleFrom(backgroundColor: primaryColor),
child: Text( child: Text(
request.buttonTitle, request.buttonTitle,
style: TextStyle(fontSize: 18), style: TextStyle(fontSize: 18),

File diff suppressed because it is too large Load Diff

View File

@ -23,26 +23,31 @@ dependencies:
google_fonts: ^3.0.1 google_fonts: ^3.0.1
material_design_icons_flutter: ^5.0.6996 material_design_icons_flutter: ^5.0.6996
intl: ^0.17.0 intl: ^0.17.0
barcode_scan2: ^4.2.1 barcode_scan2: ^4.7.2
device_info: ^2.0.3 device_info_plus: ^11.0.0
vocsy_esys_flutter_share: ^1.0.1 share_plus: ^10.0.0
auto_size_text: ^3.0.0 auto_size_text: ^3.0.0
url_launcher: ^6.1.5 url_launcher: ^6.1.5
qr_flutter: ^4.0.0 qr_flutter: ^4.0.0
mask_text_input_formatter: ^2.4.0 mask_text_input_formatter: ^2.4.0
flutter_screenutil: ^5.5.3+2 flutter_screenutil: ^5.9.3
shared_preferences: ^2.0.15 shared_preferences: ^2.0.15
flutter_lock_screen: ^2.0.1 flutter_lock_screen:
local_auth: ^2.1.2 path: local_packages/flutter_lock_screen
#local_auth: ^2.3.0
#esc_pos_bluetooth: ^0.4.1 #esc_pos_bluetooth: ^0.4.1
esc_pos_utils: ^1.1.0 esc_pos_utils: ^1.1.0
charset_converter: ^2.1.0 charset_converter: ^2.4.0
permission_handler: ^8.3.0 permission_handler: ^12.0.0
bluetooth_print:
path: ../bluetooth_print
flutter_blue: ^0.8.0
firebase_messaging: ^12.0.2 firebase_messaging: ^12.0.2
firebase_core: ^1.20.1 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: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter