group_list
parent
9486186973
commit
17f730eebd
|
|
@ -15,6 +15,7 @@ class AuthResponse {
|
||||||
int? kassaId;
|
int? kassaId;
|
||||||
String? token;
|
String? token;
|
||||||
String? authAt;
|
String? authAt;
|
||||||
|
String? username;
|
||||||
int? shard;
|
int? shard;
|
||||||
String? message;
|
String? message;
|
||||||
bool? operation;
|
bool? operation;
|
||||||
|
|
@ -29,6 +30,7 @@ class AuthResponse {
|
||||||
authResponseBean.shard = cast<int>(map['shard']);
|
authResponseBean.shard = cast<int>(map['shard']);
|
||||||
authResponseBean.message = cast<String>(map['message']);
|
authResponseBean.message = cast<String>(map['message']);
|
||||||
authResponseBean.operation = map['operation'] as bool;
|
authResponseBean.operation = map['operation'] as bool;
|
||||||
|
authResponseBean.username = cast<String>(map['username']);
|
||||||
return authResponseBean;
|
return authResponseBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -42,6 +44,7 @@ class AuthResponse {
|
||||||
'shard': shard,
|
'shard': shard,
|
||||||
'message': message,
|
'message': message,
|
||||||
'operation': operation,
|
'operation': operation,
|
||||||
|
'username' : username
|
||||||
};
|
};
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
import 'package:satu/core/utils/utils_parse.dart';
|
||||||
|
|
||||||
|
class TransactionDao {
|
||||||
|
TransactionDao();
|
||||||
|
|
||||||
|
int? id;
|
||||||
|
double total = 0;
|
||||||
|
String contragentName = '';
|
||||||
|
String? number;
|
||||||
|
String? date;
|
||||||
|
String? day;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,73 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:logger/logger.dart';
|
||||||
|
import 'package:meta/meta.dart';
|
||||||
|
import 'package:redux/redux.dart';
|
||||||
|
import 'package:redux_thunk/redux_thunk.dart';
|
||||||
|
import 'package:satu/core/entity/category_entity.dart';
|
||||||
|
import 'package:satu/core/entity/goods_entity.dart';
|
||||||
|
import 'package:satu/core/entity/transaction_entity.dart';
|
||||||
|
import 'package:satu/core/entity/transaction_rec_entity.dart';
|
||||||
|
import 'package:satu/core/models/entity_data/transaction_data.dart';
|
||||||
|
import 'package:satu/core/models/flow/dao/product_dao.dart';
|
||||||
|
import 'package:satu/core/models/flow/dao/transaction_dao.dart';
|
||||||
|
import 'package:satu/core/models/flow/transaction_state.dart';
|
||||||
|
import 'package:satu/core/redux/state/journal_state.dart';
|
||||||
|
import 'package:satu/core/redux/state/sell_state.dart';
|
||||||
|
import 'package:satu/core/services/db_service.dart';
|
||||||
|
import 'package:satu/core/utils/locator.dart';
|
||||||
|
import 'package:satu/core/utils/logger.dart';
|
||||||
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
|
import '../store.dart';
|
||||||
|
|
||||||
|
@immutable
|
||||||
|
class SetJournalStateAction {
|
||||||
|
const SetJournalStateAction(this.journalState);
|
||||||
|
|
||||||
|
final JournalState journalState;
|
||||||
|
}
|
||||||
|
|
||||||
|
final Logger log = getLogger('SetJournalStateAction');
|
||||||
|
|
||||||
|
final DbService _dbService = locator<DbService>();
|
||||||
|
|
||||||
|
ThunkAction<AppState> navigateTab(int index) {
|
||||||
|
return (Store<AppState> store) async {
|
||||||
|
store.dispatch(SetJournalStateAction(JournalState(tabIndex: index)));
|
||||||
|
loadJournalData(store);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> loadJournalData(Store<AppState> store) async {
|
||||||
|
try {
|
||||||
|
log.i('loadJournalData');
|
||||||
|
final int? appCompanyId = store.state.userState!.auth!.companyId;
|
||||||
|
final int tabIndex = store.state.journalState?.tabIndex ?? 0;
|
||||||
|
final List<Map<String, dynamic>> set = await _dbService.queryRowsWithWhere(
|
||||||
|
transactionTableName,
|
||||||
|
'$transactionColumnAppCompanyId = ?'
|
||||||
|
' and $transactionColumnStatus = ?'
|
||||||
|
' and $transactionColumnType = ?',
|
||||||
|
[appCompanyId, transactionStatusFinish, transactionTypeSell],
|
||||||
|
orderBy: '$transactionColumnCreatedAt desc');
|
||||||
|
log.i(set.length);
|
||||||
|
final List<TransactionDao> list = [];
|
||||||
|
for (final Map<String, dynamic> map in set) {
|
||||||
|
final Transaction transaction = Transaction.fromMap(map);
|
||||||
|
final TransactionData data = TransactionData.fromMap(
|
||||||
|
jsonDecode(transaction.data!));
|
||||||
|
TransactionDao dao = TransactionDao();
|
||||||
|
dao.day = transaction.id.toString();
|
||||||
|
dao.id = transaction.id;
|
||||||
|
dao.contragentName = data.contragentName;
|
||||||
|
list.add(dao);
|
||||||
|
}
|
||||||
|
store.dispatch(SetJournalStateAction(JournalState(
|
||||||
|
items: list,
|
||||||
|
)));
|
||||||
|
} catch (e, stack)
|
||||||
|
{
|
||||||
|
log.e('loadSellData', e, stack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -9,7 +9,7 @@ import 'package:satu/core/entity/goods_entity.dart';
|
||||||
import 'package:satu/core/entity/transaction_entity.dart';
|
import 'package:satu/core/entity/transaction_entity.dart';
|
||||||
import 'package:satu/core/entity/transaction_rec_entity.dart';
|
import 'package:satu/core/entity/transaction_rec_entity.dart';
|
||||||
import 'package:satu/core/models/entity_data/transaction_data.dart';
|
import 'package:satu/core/models/entity_data/transaction_data.dart';
|
||||||
import 'package:satu/core/models/flow/product_dao.dart';
|
import 'package:satu/core/models/flow/dao/product_dao.dart';
|
||||||
import 'package:satu/core/models/flow/transaction_state.dart';
|
import 'package:satu/core/models/flow/transaction_state.dart';
|
||||||
import 'package:satu/core/redux/state/sell_state.dart';
|
import 'package:satu/core/redux/state/sell_state.dart';
|
||||||
import 'package:satu/core/services/db_service.dart';
|
import 'package:satu/core/services/db_service.dart';
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import '../store.dart';
|
||||||
@immutable
|
@immutable
|
||||||
class SetUserStateAction {
|
class SetUserStateAction {
|
||||||
final UserState userState;
|
final UserState userState;
|
||||||
|
|
||||||
SetUserStateAction(this.userState);
|
SetUserStateAction(this.userState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -23,19 +24,20 @@ final DialogService _dialogService = locator<DialogService>();
|
||||||
|
|
||||||
final DictionaryService _dictionaryService = locator<DictionaryService>();
|
final DictionaryService _dictionaryService = locator<DictionaryService>();
|
||||||
|
|
||||||
|
|
||||||
ThunkAction<AppState> authenticate(String email, String password) {
|
ThunkAction<AppState> authenticate(String email, String password) {
|
||||||
return (Store<AppState> store) async {
|
return (Store<AppState> store) async {
|
||||||
store.dispatch(SetUserStateAction(UserState(isLoading: true)));
|
store.dispatch(SetUserStateAction(UserState(isLoading: true)));
|
||||||
try {
|
try {
|
||||||
AuthResponse result = await _api.login(email, password);
|
final AuthResponse result = await _api.login(email, password);
|
||||||
if ( result.operation!) {
|
if (result.operation!) {
|
||||||
_api.token = result.token!;
|
_api.token = result.token!;
|
||||||
store.dispatch(SetUserStateAction(UserState(isLoading: false, auth: result)));
|
store.dispatch(
|
||||||
|
SetUserStateAction(UserState(isLoading: false, auth: result)));
|
||||||
_navigation.replace(mainViewRoute);
|
_navigation.replace(mainViewRoute);
|
||||||
_afterAuth(store);
|
_afterAuth(store);
|
||||||
} else {
|
} else {
|
||||||
_dialogService.showDialog(title: 'Внимание', buttonTitle: 'Ok', description: result.message!);
|
_dialogService.showDialog(
|
||||||
|
title: 'Внимание', buttonTitle: 'Ok', description: result.message!);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
|
|
@ -50,13 +52,15 @@ ThunkAction<AppState> authenticateByToken(String token) {
|
||||||
store.dispatch(SetUserStateAction(UserState(isLoading: true)));
|
store.dispatch(SetUserStateAction(UserState(isLoading: true)));
|
||||||
try {
|
try {
|
||||||
AuthResponse result = await _api.authorization(token);
|
AuthResponse result = await _api.authorization(token);
|
||||||
if ( result.operation!) {
|
if (result.operation!) {
|
||||||
_api.token = result.token!;
|
_api.token = result.token!;
|
||||||
store.dispatch(SetUserStateAction(UserState(isLoading: false, auth: result)));
|
store.dispatch(
|
||||||
|
SetUserStateAction(UserState(isLoading: false, auth: result)));
|
||||||
_navigation.replace(mainViewRoute);
|
_navigation.replace(mainViewRoute);
|
||||||
_afterAuth(store);
|
_afterAuth(store);
|
||||||
} else {
|
} else {
|
||||||
_dialogService.showDialog(title: 'Внимание', buttonTitle: 'Ok', description: result.message!);
|
_dialogService.showDialog(
|
||||||
|
title: 'Внимание', buttonTitle: 'Ok', description: result.message!);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
|
|
@ -69,8 +73,8 @@ ThunkAction<AppState> authenticateByToken(String token) {
|
||||||
Future<void> auth(Store<AppState> store) async {
|
Future<void> auth(Store<AppState> store) async {
|
||||||
store.dispatch(SetUserStateAction(UserState(isLoading: true)));
|
store.dispatch(SetUserStateAction(UserState(isLoading: true)));
|
||||||
try {
|
try {
|
||||||
UserState? state = store.state.userState;
|
UserState? state = store.state.userState;
|
||||||
if(state != null) {
|
if (state != null) {
|
||||||
if (state.auth?.operation == false) {
|
if (state.auth?.operation == false) {
|
||||||
_navigation.replace(loginViewRoute);
|
_navigation.replace(loginViewRoute);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -99,10 +103,12 @@ Future<void> logout(Store<AppState> store) async {
|
||||||
AuthResponse result = await _api.logout();
|
AuthResponse result = await _api.logout();
|
||||||
if (result.operation!) {
|
if (result.operation!) {
|
||||||
_api.token = null;
|
_api.token = null;
|
||||||
store.dispatch(SetUserStateAction(UserState(isLoading: false, auth: AuthResponse())));
|
store.dispatch(SetUserStateAction(
|
||||||
|
UserState(isLoading: false, auth: AuthResponse())));
|
||||||
_navigation.replace(loginViewRoute);
|
_navigation.replace(loginViewRoute);
|
||||||
} else {
|
} else {
|
||||||
_dialogService.showDialog(title: 'Внимание', buttonTitle: 'Ok', description: result.message!);
|
_dialogService.showDialog(
|
||||||
|
title: 'Внимание', buttonTitle: 'Ok', description: result.message!);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
|
|
@ -114,4 +120,3 @@ Future<void> logout(Store<AppState> store) async {
|
||||||
Future<void> _afterAuth(Store<AppState> store) async {
|
Future<void> _afterAuth(Store<AppState> store) async {
|
||||||
await _dictionaryService.refreshFull();
|
await _dictionaryService.refreshFull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
import 'package:satu/core/redux/actions/journal_actions.dart';
|
||||||
|
import 'package:satu/core/redux/actions/sell_actions.dart';
|
||||||
|
import 'package:satu/core/redux/actions/user_actions.dart';
|
||||||
|
import 'package:satu/core/redux/state/journal_state.dart';
|
||||||
|
import 'package:satu/core/redux/state/sell_state.dart';
|
||||||
|
import 'package:satu/core/redux/state/user_state.dart';
|
||||||
|
|
||||||
|
JournalState journalReducer(
|
||||||
|
JournalState prevState, SetJournalStateAction action) {
|
||||||
|
final JournalState payload = action.journalState;
|
||||||
|
return prevState.copyWith(items: payload.items, tabIndex: payload.tabIndex);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
import 'package:meta/meta.dart';
|
||||||
|
import 'package:satu/core/models/flow/dao/transaction_dao.dart';
|
||||||
|
|
||||||
|
|
||||||
|
@immutable
|
||||||
|
class JournalState {
|
||||||
|
const JournalState({this.items, this.tabIndex});
|
||||||
|
|
||||||
|
factory JournalState.initial() => const JournalState(items: [], tabIndex: 0);
|
||||||
|
|
||||||
|
final List<TransactionDao>? items;
|
||||||
|
final int? tabIndex;
|
||||||
|
|
||||||
|
JournalState copyWith({List<TransactionDao>? items, int? tabIndex}) {
|
||||||
|
return JournalState(
|
||||||
|
items: items ?? this.items, tabIndex: tabIndex ?? this.tabIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import 'package:meta/meta.dart';
|
import 'package:meta/meta.dart';
|
||||||
import 'package:satu/core/models/auth/auth_response.dart';
|
import 'package:satu/core/models/auth/auth_response.dart';
|
||||||
import 'package:satu/core/models/flow/product_dao.dart';
|
import 'package:satu/core/models/flow/dao/product_dao.dart';
|
||||||
import 'package:satu/core/models/flow/transaction_state.dart';
|
import 'package:satu/core/models/flow/transaction_state.dart';
|
||||||
|
|
||||||
@immutable
|
@immutable
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,22 @@
|
||||||
|
|
||||||
import 'package:meta/meta.dart';
|
import 'package:meta/meta.dart';
|
||||||
import 'package:redux/redux.dart';
|
import 'package:redux/redux.dart';
|
||||||
import 'package:redux_persist_flutter/redux_persist_flutter.dart';
|
import 'package:redux_persist_flutter/redux_persist_flutter.dart';
|
||||||
import 'package:redux_thunk/redux_thunk.dart';
|
import 'package:redux_thunk/redux_thunk.dart';
|
||||||
import 'package:redux_persist/redux_persist.dart';
|
import 'package:redux_persist/redux_persist.dart';
|
||||||
|
import 'package:satu/core/redux/actions/journal_actions.dart';
|
||||||
import 'package:satu/core/redux/actions/nav_actions.dart';
|
import 'package:satu/core/redux/actions/nav_actions.dart';
|
||||||
import 'package:satu/core/redux/actions/sell_actions.dart';
|
import 'package:satu/core/redux/actions/sell_actions.dart';
|
||||||
|
import 'package:satu/core/redux/reducers/journal_reducer.dart';
|
||||||
import 'package:satu/core/redux/reducers/nav_reducer.dart';
|
import 'package:satu/core/redux/reducers/nav_reducer.dart';
|
||||||
import 'package:satu/core/redux/reducers/sell_reducer.dart';
|
import 'package:satu/core/redux/reducers/sell_reducer.dart';
|
||||||
import 'package:satu/core/redux/reducers/user_reducer.dart';
|
import 'package:satu/core/redux/reducers/user_reducer.dart';
|
||||||
|
import 'package:satu/core/redux/state/journal_state.dart';
|
||||||
import 'package:satu/core/redux/state/nav_state.dart';
|
import 'package:satu/core/redux/state/nav_state.dart';
|
||||||
import 'package:satu/core/redux/state/sell_state.dart';
|
import 'package:satu/core/redux/state/sell_state.dart';
|
||||||
import 'package:satu/core/redux/state/user_state.dart';
|
import 'package:satu/core/redux/state/user_state.dart';
|
||||||
|
|
||||||
import 'actions/user_actions.dart';
|
import 'actions/user_actions.dart';
|
||||||
|
|
||||||
|
|
||||||
//reducer context
|
//reducer context
|
||||||
AppState appReducer(AppState state, dynamic action) {
|
AppState appReducer(AppState state, dynamic action) {
|
||||||
if (action is SetUserStateAction) {
|
if (action is SetUserStateAction) {
|
||||||
|
|
@ -26,10 +27,14 @@ AppState appReducer(AppState state, dynamic action) {
|
||||||
/** NavAction **/
|
/** NavAction **/
|
||||||
final NavState nextState = navReducer(state.navState!, action);
|
final NavState nextState = navReducer(state.navState!, action);
|
||||||
return state.copyWith(navState: nextState);
|
return state.copyWith(navState: nextState);
|
||||||
} else if (action is SetSellStateAction) {
|
} else if (action is SetSellStateAction) {
|
||||||
/** NavAction **/
|
/** NavAction **/
|
||||||
final SellState nextState = sellReducer(state.sellState!, action);
|
final SellState nextState = sellReducer(state.sellState!, action);
|
||||||
return state.copyWith(sellState: nextState);
|
return state.copyWith(sellState: nextState);
|
||||||
|
} else if (action is SetJournalStateAction) {
|
||||||
|
/** NavAction **/
|
||||||
|
final JournalState nextState = journalReducer(state.journalState!, action);
|
||||||
|
return state.copyWith(journalState: nextState);
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
@ -37,41 +42,44 @@ AppState appReducer(AppState state, dynamic action) {
|
||||||
//Main State
|
//Main State
|
||||||
@immutable
|
@immutable
|
||||||
class AppState {
|
class AppState {
|
||||||
final UserState? userState;
|
|
||||||
final NavState? navState;
|
|
||||||
final SellState? sellState;
|
|
||||||
|
|
||||||
|
|
||||||
const AppState({
|
const AppState({
|
||||||
this.userState,
|
this.userState,
|
||||||
this.navState,
|
this.navState,
|
||||||
this.sellState
|
this.sellState,
|
||||||
|
this.journalState,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final UserState? userState;
|
||||||
|
final NavState? navState;
|
||||||
|
final SellState? sellState;
|
||||||
|
final JournalState? journalState;
|
||||||
|
|
||||||
//stable work
|
//stable work
|
||||||
AppState copyWith({
|
AppState copyWith({
|
||||||
UserState? userState,
|
UserState? userState,
|
||||||
NavState? navState,
|
NavState? navState,
|
||||||
SellState? sellState,
|
SellState? sellState,
|
||||||
|
JournalState? journalState,
|
||||||
}) {
|
}) {
|
||||||
return AppState(
|
return AppState(
|
||||||
userState: userState ?? this.userState,
|
userState: userState ?? this.userState,
|
||||||
navState: navState ?? this.navState,
|
navState: navState ?? this.navState,
|
||||||
sellState: sellState ?? this.sellState
|
sellState: sellState ?? this.sellState,
|
||||||
|
journalState: journalState ?? this.journalState,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static AppState? fromJson(dynamic json){
|
static AppState? fromJson(dynamic json) {
|
||||||
return json !=null
|
return json != null
|
||||||
? AppState(
|
? AppState(
|
||||||
userState: UserState.fromJson(json['userState']),
|
userState: UserState.fromJson(json['userState']),
|
||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic toJson() {
|
dynamic toJson() {
|
||||||
return {
|
return {
|
||||||
"userState" : userState!.toJson(),
|
'userState': userState!.toJson(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -81,33 +89,37 @@ class Redux {
|
||||||
|
|
||||||
static Store<AppState>? get store {
|
static Store<AppState>? get store {
|
||||||
if (_store == null) {
|
if (_store == null) {
|
||||||
throw Exception("store is not initialized");
|
throw Exception('store is not initialized');
|
||||||
} else {
|
} else {
|
||||||
return _store;
|
return _store;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//blank function just for lint context
|
||||||
|
Future<void> blank() async {}
|
||||||
|
|
||||||
//initial context
|
//initial context
|
||||||
static Future<void> init() async {
|
static Future<void> init() async {
|
||||||
// Create Persistor
|
// Create Persistor
|
||||||
final persist = Persistor<AppState>(
|
final persist = Persistor<AppState>(
|
||||||
storage: FlutterStorage(), // Or use other engines
|
storage: FlutterStorage(), // Or use other engines
|
||||||
serializer: JsonSerializer<AppState>(AppState.fromJson), // Or use other serializers
|
serializer: JsonSerializer<AppState>(
|
||||||
|
AppState.fromJson), // Or use other serializers
|
||||||
);
|
);
|
||||||
|
|
||||||
final AppState? initialState = await persist.load();
|
final AppState? initialState = await persist.load();
|
||||||
final userStateInitial = UserState.initial(initialState?.userState);
|
final userStateInitial = UserState.initial(initialState?.userState);
|
||||||
final navStateInitial = NavState.initial();
|
final navStateInitial = NavState.initial();
|
||||||
final sellStateInitial = SellState.initial();
|
final sellStateInitial = SellState.initial();
|
||||||
|
final journalStateInitial = JournalState.initial();
|
||||||
|
|
||||||
_store = Store<AppState>(
|
_store = Store<AppState>(appReducer,
|
||||||
appReducer,
|
middleware: [thunkMiddleware, persist.createMiddleware()],
|
||||||
middleware: [thunkMiddleware, persist.createMiddleware() ],
|
initialState: AppState(
|
||||||
initialState: AppState(
|
|
||||||
userState: userStateInitial,
|
userState: userStateInitial,
|
||||||
navState: navStateInitial,
|
navState: navStateInitial,
|
||||||
sellState: sellStateInitial,
|
sellState: sellStateInitial,
|
||||||
)
|
journalState: journalStateInitial,
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import 'package:satu/core/entity/transaction_entity.dart';
|
||||||
import 'package:satu/core/models/entity_data/transaction_data.dart';
|
import 'package:satu/core/models/entity_data/transaction_data.dart';
|
||||||
import 'package:satu/core/models/flow/items_bean.dart';
|
import 'package:satu/core/models/flow/items_bean.dart';
|
||||||
import 'package:satu/core/models/flow/operator_bean.dart';
|
import 'package:satu/core/models/flow/operator_bean.dart';
|
||||||
import 'package:satu/core/models/flow/product_dao.dart';
|
import 'package:satu/core/models/flow/dao/product_dao.dart';
|
||||||
import 'package:satu/core/models/flow/sell_request.dart';
|
import 'package:satu/core/models/flow/sell_request.dart';
|
||||||
import 'package:satu/core/models/flow/sell_response.dart';
|
import 'package:satu/core/models/flow/sell_response.dart';
|
||||||
import 'package:satu/core/models/flow/transaction_state.dart';
|
import 'package:satu/core/models/flow/transaction_state.dart';
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'package:satu/core/services/api_service.dart';
|
||||||
import 'package:satu/core/services/navigator_service.dart';
|
import 'package:satu/core/services/navigator_service.dart';
|
||||||
import 'package:satu/core/utils/locator.dart';
|
import 'package:satu/core/utils/locator.dart';
|
||||||
import 'package:satu/routes/route_names.dart';
|
import 'package:satu/routes/route_names.dart';
|
||||||
|
import 'package:satu/shared/app_colors.dart';
|
||||||
|
|
||||||
|
|
||||||
class StartUpView extends StatefulWidget {
|
class StartUpView extends StatefulWidget {
|
||||||
|
|
@ -33,6 +34,7 @@ class _StartUpViewState extends State<StartUpView> {
|
||||||
converter: (store) => store.state.userState!,
|
converter: (store) => store.state.userState!,
|
||||||
builder: (context, userState) {
|
builder: (context, userState) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
backgroundColor: whiteColor,
|
||||||
body: Center(
|
body: Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
|
|
||||||
|
|
@ -1,219 +1,115 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
|
import 'package:grouped_list/grouped_list.dart';
|
||||||
|
import 'package:satu/core/models/flow/dao/transaction_dao.dart';
|
||||||
|
import 'package:satu/core/redux/actions/journal_actions.dart';
|
||||||
|
import 'package:satu/core/redux/state/journal_state.dart';
|
||||||
|
import 'package:satu/core/redux/store.dart';
|
||||||
|
import 'package:satu/shared/app_colors.dart';
|
||||||
import 'package:satu/widgets/bar/products_app_bar.dart';
|
import 'package:satu/widgets/bar/products_app_bar.dart';
|
||||||
import 'package:satu/widgets/buttons/option_pill.dart';
|
import 'package:satu/widgets/buttons/option_pill.dart';
|
||||||
import 'component/transaction_item.dart';
|
import 'component/transaction_item.dart';
|
||||||
|
|
||||||
|
|
||||||
class JournalView extends StatefulWidget {
|
class JournalView extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
_JournalViewState createState() => _JournalViewState();
|
_JournalViewState createState() => _JournalViewState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _JournalViewState extends State<JournalView> {
|
class _JournalViewState extends State<JournalView> {
|
||||||
|
|
||||||
int tabIndex = 0;
|
int tabIndex = 0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
Redux.store!.dispatch(loadJournalData);
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: ProductsAppBar(title: 'Журнал транзакции',),
|
appBar: const ProductsAppBar(
|
||||||
body: Padding(
|
title: 'Журнал транзакции',
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
),
|
||||||
child: Column(
|
body: StoreConnector<AppState, JournalState>(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
converter: (store) => store.state.journalState!,
|
||||||
children: [
|
builder: (context, snapshot) {
|
||||||
|
return Padding(
|
||||||
Padding(
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
padding: const EdgeInsets.all(8.0),
|
child: Column(
|
||||||
child: Row(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
children: [
|
||||||
children: [
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
OptionPill(
|
child: Row(
|
||||||
text: 'Все',
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
selected: tabIndex == 0,
|
children: [
|
||||||
onTap: () {
|
OptionPill(
|
||||||
setState(() {
|
text: 'Все',
|
||||||
tabIndex = 0;
|
selected: snapshot.tabIndex == 0,
|
||||||
});
|
onTap: () {
|
||||||
},
|
setState(() {
|
||||||
|
tabIndex = 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
OptionPill(
|
||||||
|
text: 'Приход',
|
||||||
|
selected: snapshot.tabIndex == 1,
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
tabIndex = 1;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
OptionPill(
|
||||||
|
text: 'Расход',
|
||||||
|
selected: snapshot.tabIndex == 2,
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
tabIndex = 2;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
OptionPill(
|
height: 16,
|
||||||
text: 'Приход',
|
|
||||||
selected: tabIndex == 1,
|
|
||||||
onTap: () {
|
|
||||||
setState(() {
|
|
||||||
tabIndex = 1;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
|
Expanded(
|
||||||
OptionPill(
|
child: GroupedListView<TransactionDao, String>(
|
||||||
text: 'Расход',
|
physics: const BouncingScrollPhysics(),
|
||||||
selected: tabIndex == 2,
|
elements: snapshot.items!,
|
||||||
onTap: () {
|
groupBy: (element) => element.day!,
|
||||||
setState(() {
|
groupSeparatorBuilder: (String groupByValue) => Text(
|
||||||
tabIndex = 2;
|
groupByValue,
|
||||||
});
|
style: const TextStyle(
|
||||||
},
|
color: textColor,
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
itemBuilder: (context, TransactionDao element) =>
|
||||||
|
TransactionItem(
|
||||||
|
fullName: 'Чек № ${element.number} 13:03:05',
|
||||||
|
status: element.contragentName,
|
||||||
|
amount: element.total.toString(),
|
||||||
|
received: true,
|
||||||
|
),
|
||||||
|
itemComparator: (item1, item2) =>
|
||||||
|
item1.day!.compareTo(item2.day!),
|
||||||
|
// optional
|
||||||
|
useStickyGroupSeparators: true,
|
||||||
|
// optional
|
||||||
|
floatingHeader: true,
|
||||||
|
// optional
|
||||||
|
order: GroupedListOrder.DESC, // optional
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
|
}),
|
||||||
SizedBox(
|
|
||||||
height: 16,
|
|
||||||
),
|
|
||||||
|
|
||||||
Expanded(
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
physics: BouncingScrollPhysics(),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
|
|
||||||
SizedBox(
|
|
||||||
height: 16,
|
|
||||||
),
|
|
||||||
|
|
||||||
Text(
|
|
||||||
'03/06/2020',
|
|
||||||
style: TextStyle(
|
|
||||||
//color: kGreyColor,
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
|
|
||||||
TransactionItem(
|
|
||||||
fullName: 'Чек № 52021 13:03:05',
|
|
||||||
status: 'Частное лицо',
|
|
||||||
amount: '2706.00',
|
|
||||||
received: true,
|
|
||||||
),
|
|
||||||
|
|
||||||
TransactionItem(
|
|
||||||
fullName: 'Чек № 52020 13:01:05',
|
|
||||||
status: 'ИП Иванов В.И.',
|
|
||||||
amount: '19000.63',
|
|
||||||
received: false,
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(
|
|
||||||
height: 16,
|
|
||||||
),
|
|
||||||
|
|
||||||
Divider(
|
|
||||||
//color: kPrimaryColor,
|
|
||||||
height: 1,
|
|
||||||
thickness: 1,
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(
|
|
||||||
height: 32,
|
|
||||||
),
|
|
||||||
|
|
||||||
Text(
|
|
||||||
'02/06/2020',
|
|
||||||
style: TextStyle(
|
|
||||||
//color: kGreyColor,
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
|
|
||||||
TransactionItem(
|
|
||||||
fullName: 'Чек № 5019 13:03:05',
|
|
||||||
status: 'Частное лицо',
|
|
||||||
amount: '114.00',
|
|
||||||
received: true,
|
|
||||||
),
|
|
||||||
|
|
||||||
TransactionItem(
|
|
||||||
fullName: 'Чек № 5019 13:03:05',
|
|
||||||
status: 'Частное лицо',
|
|
||||||
amount: '70.16',
|
|
||||||
received: true,
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(
|
|
||||||
height: 16,
|
|
||||||
),
|
|
||||||
|
|
||||||
Text(
|
|
||||||
'29/05/2020',
|
|
||||||
style: TextStyle(
|
|
||||||
//color: kGreyColor,
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
|
|
||||||
TransactionItem(
|
|
||||||
fullName: 'Чек № 5019 13:03:05',
|
|
||||||
status: 'Частное лицо',
|
|
||||||
amount: '44.50',
|
|
||||||
received: true,
|
|
||||||
),
|
|
||||||
|
|
||||||
TransactionItem(
|
|
||||||
fullName: 'Чек № 5019 13:03:05',
|
|
||||||
status: 'ТОО Рога и копыта',
|
|
||||||
amount: '85.50',
|
|
||||||
received: false,
|
|
||||||
),
|
|
||||||
|
|
||||||
TransactionItem(
|
|
||||||
fullName: 'Чек № 5019 13:03:05',
|
|
||||||
status: 'Частное лицо',
|
|
||||||
amount: '155.00',
|
|
||||||
received: true,
|
|
||||||
),
|
|
||||||
|
|
||||||
TransactionItem(
|
|
||||||
fullName: 'Чек № 5019 13:03:05',
|
|
||||||
status: 'Частное лицо',
|
|
||||||
amount: '23.50',
|
|
||||||
received: true,
|
|
||||||
),
|
|
||||||
|
|
||||||
TransactionItem(
|
|
||||||
fullName: 'Чек № 5019 13:03:05',
|
|
||||||
status: 'Частное лицо',
|
|
||||||
amount: '11.50',
|
|
||||||
received: true,
|
|
||||||
),
|
|
||||||
|
|
||||||
TransactionItem(
|
|
||||||
fullName: 'Чек № 5019 13:03:05',
|
|
||||||
status: 'Частное лицо',
|
|
||||||
amount: '36.00',
|
|
||||||
received: true,
|
|
||||||
),
|
|
||||||
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import 'package:flutter_redux/flutter_redux.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:redux/src/store.dart';
|
import 'package:redux/src/store.dart';
|
||||||
import 'package:satu/core/entity/goods_entity.dart';
|
import 'package:satu/core/entity/goods_entity.dart';
|
||||||
import 'package:satu/core/models/flow/product_dao.dart';
|
import 'package:satu/core/models/flow/dao/product_dao.dart';
|
||||||
import 'package:satu/core/redux/actions/sell_actions.dart';
|
import 'package:satu/core/redux/actions/sell_actions.dart';
|
||||||
import 'package:satu/core/redux/state/sell_state.dart';
|
import 'package:satu/core/redux/state/sell_state.dart';
|
||||||
import 'package:satu/core/redux/store.dart';
|
import 'package:satu/core/redux/store.dart';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import 'package:satu/core/models/flow/product_dao.dart';
|
import 'package:satu/core/models/flow/dao/product_dao.dart';
|
||||||
|
|
||||||
double sumProducts(List<ProductDao> list) {
|
double sumProducts(List<ProductDao> list) {
|
||||||
double result = 0.0;
|
double result = 0.0;
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ class BottomBar extends StatelessWidget {
|
||||||
active: selectedIndex == 1,
|
active: selectedIndex == 1,
|
||||||
onTap: () => onTap(1),
|
onTap: () => onTap(1),
|
||||||
svgFile: 'buy',
|
svgFile: 'buy',
|
||||||
|
disable: true,
|
||||||
),
|
),
|
||||||
BottomButton(
|
BottomButton(
|
||||||
active: selectedIndex == 2,
|
active: selectedIndex == 2,
|
||||||
|
|
@ -43,16 +44,18 @@ class BottomBar extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class BottomButton extends StatelessWidget {
|
class BottomButton extends StatelessWidget {
|
||||||
const BottomButton({
|
const BottomButton(
|
||||||
required this.svgFile,
|
{required this.svgFile,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
required this.active,
|
required this.active,
|
||||||
Key? key,
|
Key? key,
|
||||||
}) : super(key: key);
|
this.disable = false})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
final String svgFile;
|
final String svgFile;
|
||||||
final void Function() onTap;
|
final void Function() onTap;
|
||||||
final bool active;
|
final bool active;
|
||||||
|
final bool disable;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -73,14 +76,18 @@ class BottomButton extends StatelessWidget {
|
||||||
child: Material(
|
child: Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: onTap,
|
onTap: disable == true ? (){} : onTap,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
'assets/images/svg/$svgFile.svg',
|
'assets/images/svg/$svgFile.svg',
|
||||||
height: 30,
|
height: 30,
|
||||||
width: 30,
|
width: 30,
|
||||||
color: active ? primaryColor : placeholderColor,
|
color: disable
|
||||||
|
? disableColor
|
||||||
|
: active
|
||||||
|
? primaryColor
|
||||||
|
: placeholderColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:satu/core/redux/actions/nav_actions.dart';
|
import 'package:satu/core/redux/actions/nav_actions.dart';
|
||||||
import 'package:satu/core/redux/actions/user_actions.dart';
|
import 'package:satu/core/redux/actions/user_actions.dart';
|
||||||
|
import 'package:satu/core/redux/state/user_state.dart';
|
||||||
import 'package:satu/core/redux/store.dart';
|
import 'package:satu/core/redux/store.dart';
|
||||||
|
|
||||||
import 'package:satu/shared/app_colors.dart';
|
import 'package:satu/shared/app_colors.dart';
|
||||||
|
|
@ -31,7 +33,9 @@ class AppDrawer extends StatelessWidget {
|
||||||
Redux.store!.dispatch(navigateDrawer(WorkView));
|
Redux.store!.dispatch(navigateDrawer(WorkView));
|
||||||
}),
|
}),
|
||||||
_createDrawerItem(
|
_createDrawerItem(
|
||||||
svgFile: 'inventarization', text: 'Инвентаризация'),
|
svgFile: 'inventarization',
|
||||||
|
text: 'Инвентаризация',
|
||||||
|
disable: true),
|
||||||
_createDrawerSectionTitle(text: 'СПРАВОЧНИКИ'),
|
_createDrawerSectionTitle(text: 'СПРАВОЧНИКИ'),
|
||||||
_createDrawerItem(
|
_createDrawerItem(
|
||||||
svgFile: 'categories',
|
svgFile: 'categories',
|
||||||
|
|
@ -47,13 +51,18 @@ class AppDrawer extends StatelessWidget {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Redux.store!.dispatch(navigateDrawer(GoodsDictionaryView));
|
Redux.store!.dispatch(navigateDrawer(GoodsDictionaryView));
|
||||||
}),
|
}),
|
||||||
_createDrawerItem(svgFile: 'contragents', text: 'Контрагенты'),
|
_createDrawerItem(
|
||||||
|
svgFile: 'contragents', text: 'Контрагенты', disable: true),
|
||||||
_createDrawerSectionTitle(text: 'ИНФОРМАЦИЯ'),
|
_createDrawerSectionTitle(text: 'ИНФОРМАЦИЯ'),
|
||||||
_createDrawerItem(svgFile: 'question', text: 'Справочник'),
|
_createDrawerItem(
|
||||||
|
svgFile: 'question', text: 'Справочник', disable: true),
|
||||||
_createDrawerSectionTitle(text: 'ПРОЧЕЕ'),
|
_createDrawerSectionTitle(text: 'ПРОЧЕЕ'),
|
||||||
_createDrawerItem(svgFile: 'settings', text: 'Настройки'),
|
_createDrawerItem(
|
||||||
_createDrawerItem(svgFile: 'global', text: 'Перейти на сайт'),
|
svgFile: 'settings', text: 'Настройки', disable: true),
|
||||||
_createDrawerItem(svgFile: 'bug', text: 'Сообщить об ошибке'),
|
_createDrawerItem(
|
||||||
|
svgFile: 'global', text: 'Перейти на сайт', disable: true),
|
||||||
|
_createDrawerItem(
|
||||||
|
svgFile: 'bug', text: 'Сообщить об ошибке', disable: true),
|
||||||
_createDrawerItem(
|
_createDrawerItem(
|
||||||
svgFile: 'logout',
|
svgFile: 'logout',
|
||||||
text: 'Выйти из аккаунта',
|
text: 'Выйти из аккаунта',
|
||||||
|
|
@ -95,13 +104,18 @@ class AppDrawer extends StatelessWidget {
|
||||||
'assets/images/drawer/user.png')))),
|
'assets/images/drawer/user.png')))),
|
||||||
),
|
),
|
||||||
horizontalSpaceSmall,
|
horizontalSpaceSmall,
|
||||||
Column(
|
StoreConnector<AppState, UserState>(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
converter: (store) => store.state.userState!,
|
||||||
children: const [
|
builder: (context, snapshot) {
|
||||||
Text('Хайруллин Тимур',
|
return Column(
|
||||||
style: TextStyle(fontSize: 16.0)),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Text('Продавец', style: TextStyle(fontSize: 12)),
|
children: [
|
||||||
],
|
Text(snapshot.auth?.username ?? '',
|
||||||
|
style: TextStyle(fontSize: 16.0)),
|
||||||
|
Text('Продавец', style: TextStyle(fontSize: 12)),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
|
|
@ -114,7 +128,8 @@ class AppDrawer extends StatelessWidget {
|
||||||
IconData? icon,
|
IconData? icon,
|
||||||
String? svgFile,
|
String? svgFile,
|
||||||
GestureTapCallback? onTap,
|
GestureTapCallback? onTap,
|
||||||
bool isDanger = false}) {
|
bool isDanger = false,
|
||||||
|
bool disable = false}) {
|
||||||
return Container(
|
return Container(
|
||||||
decoration: const BoxDecoration(color: whiteColor),
|
decoration: const BoxDecoration(color: whiteColor),
|
||||||
child: Material(
|
child: Material(
|
||||||
|
|
@ -131,13 +146,21 @@ class AppDrawer extends StatelessWidget {
|
||||||
'assets/images/svg/$svgFile.svg',
|
'assets/images/svg/$svgFile.svg',
|
||||||
height: 20,
|
height: 20,
|
||||||
width: 20,
|
width: 20,
|
||||||
color: isDanger ? dangerColor : textColor,
|
color: disable
|
||||||
|
? disableColor
|
||||||
|
: isDanger
|
||||||
|
? dangerColor
|
||||||
|
: textColor,
|
||||||
),
|
),
|
||||||
if (icon != null)
|
if (icon != null)
|
||||||
Icon(
|
Icon(
|
||||||
icon,
|
icon,
|
||||||
size: 20.0,
|
size: 20.0,
|
||||||
color: isDanger ? dangerColor : textColor,
|
color: disable
|
||||||
|
? disableColor
|
||||||
|
: isDanger
|
||||||
|
? dangerColor
|
||||||
|
: textColor,
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
|
|
@ -145,7 +168,11 @@ class AppDrawer extends StatelessWidget {
|
||||||
text,
|
text,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color: isDanger ? dangerColor : textColor),
|
color: disable
|
||||||
|
? disableColor
|
||||||
|
: isDanger
|
||||||
|
? dangerColor
|
||||||
|
: textColor),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
||||||
21
pubspec.lock
21
pubspec.lock
|
|
@ -184,6 +184,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.2.0"
|
version: "7.2.0"
|
||||||
|
grouped_list:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: grouped_list
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.1.0"
|
||||||
html:
|
html:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -211,7 +218,7 @@ packages:
|
||||||
name: implicitly_animated_reorderable_list
|
name: implicitly_animated_reorderable_list
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.0"
|
version: "0.4.1"
|
||||||
intl:
|
intl:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
@ -239,7 +246,7 @@ packages:
|
||||||
name: logger
|
name: logger
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.1.0"
|
||||||
mask_text_input_formatter:
|
mask_text_input_formatter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
@ -309,7 +316,7 @@ packages:
|
||||||
name: path_provider
|
name: path_provider
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.2"
|
version: "2.0.3"
|
||||||
path_provider_linux:
|
path_provider_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -393,7 +400,7 @@ packages:
|
||||||
name: provider
|
name: provider
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.0"
|
version: "6.0.0"
|
||||||
qr:
|
qr:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -449,7 +456,7 @@ packages:
|
||||||
name: shared_preferences
|
name: shared_preferences
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.6"
|
version: "2.0.7"
|
||||||
shared_preferences_linux:
|
shared_preferences_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -503,14 +510,14 @@ packages:
|
||||||
name: sqflite
|
name: sqflite
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0+3"
|
version: "2.0.0+4"
|
||||||
sqflite_common:
|
sqflite_common:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: sqflite_common
|
name: sqflite_common
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0+2"
|
version: "2.0.1"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
13
pubspec.yaml
13
pubspec.yaml
|
|
@ -34,13 +34,13 @@ dependencies:
|
||||||
redux_persist: ^0.9.0
|
redux_persist: ^0.9.0
|
||||||
redux_persist_flutter: ^0.9.0
|
redux_persist_flutter: ^0.9.0
|
||||||
responsive_builder: ^0.4.1
|
responsive_builder: ^0.4.1
|
||||||
provider: ^5.0.0
|
provider: ^6.0.0
|
||||||
logger: ^1.0.0
|
logger: ^1.1.0
|
||||||
get_it: ^7.2.0
|
get_it: ^7.2.0
|
||||||
equatable: ^2.0.3
|
equatable: ^2.0.3
|
||||||
http: ^0.13.3
|
http: ^0.13.3
|
||||||
sqflite: ^2.0.0+3
|
sqflite: ^2.0.0+4
|
||||||
path_provider: ^2.0.2
|
path_provider: ^2.0.3
|
||||||
material_design_icons_flutter: 5.0.5955-rc.1
|
material_design_icons_flutter: 5.0.5955-rc.1
|
||||||
intl: ^0.17.0
|
intl: ^0.17.0
|
||||||
device_info: ^2.0.2
|
device_info: ^2.0.2
|
||||||
|
|
@ -49,14 +49,15 @@ dependencies:
|
||||||
qr_flutter: ^4.0.0
|
qr_flutter: ^4.0.0
|
||||||
mask_text_input_formatter: ^2.0.0
|
mask_text_input_formatter: ^2.0.0
|
||||||
flutter_screenutil: ^5.0.0+2
|
flutter_screenutil: ^5.0.0+2
|
||||||
shared_preferences: ^2.0.6
|
shared_preferences: ^2.0.7
|
||||||
material_floating_search_bar: ^0.3.4
|
material_floating_search_bar: ^0.3.4
|
||||||
implicitly_animated_reorderable_list: ^0.4.0
|
implicitly_animated_reorderable_list: ^0.4.1
|
||||||
uuid: ^3.0.4
|
uuid: ^3.0.4
|
||||||
charset_converter: ^2.0.0
|
charset_converter: ^2.0.0
|
||||||
ai_barcode: ^3.0.1
|
ai_barcode: ^3.0.1
|
||||||
permission_handler: ^8.1.4+2
|
permission_handler: ^8.1.4+2
|
||||||
flutter_svg: ^0.22.0
|
flutter_svg: ^0.22.0
|
||||||
|
grouped_list: ^4.1.0
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue