mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-16 10:06:19 +00:00
Compare commits
6 Commits
power_clam
...
web_issue
Author | SHA1 | Date | |
---|---|---|---|
8b1099c683 | |||
b802a6130d | |||
73ab6f3d05 | |||
bc53605114 | |||
29a2e9285b | |||
5d10b2a35b |
@ -31,7 +31,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
|
||||
////////////////////////////// forget password //////////////////////////////////
|
||||
final TextEditingController forgetEmailController = TextEditingController();
|
||||
final TextEditingController forgetPasswordController = TextEditingController();
|
||||
final TextEditingController forgetPasswordController =
|
||||
TextEditingController();
|
||||
final TextEditingController forgetOtp = TextEditingController();
|
||||
final forgetFormKey = GlobalKey<FormState>();
|
||||
final forgetEmailKey = GlobalKey<FormState>();
|
||||
@ -48,7 +49,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
return;
|
||||
}
|
||||
_remainingTime = 1;
|
||||
add(UpdateTimerEvent(remainingTime: _remainingTime, isButtonEnabled: false));
|
||||
add(UpdateTimerEvent(
|
||||
remainingTime: _remainingTime, isButtonEnabled: false));
|
||||
try {
|
||||
forgetEmailValidate = '';
|
||||
_remainingTime = (await AuthenticationAPI.sendOtp(
|
||||
@ -84,7 +86,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
_timer?.cancel();
|
||||
add(const UpdateTimerEvent(remainingTime: 0, isButtonEnabled: true));
|
||||
} else {
|
||||
add(UpdateTimerEvent(remainingTime: _remainingTime, isButtonEnabled: false));
|
||||
add(UpdateTimerEvent(
|
||||
remainingTime: _remainingTime, isButtonEnabled: false));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -94,21 +97,25 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
emit(const TimerState(isButtonEnabled: true, remainingTime: 0));
|
||||
}
|
||||
|
||||
Future<void> changePassword(ChangePasswordEvent event, Emitter<AuthState> emit) async {
|
||||
Future<void> changePassword(
|
||||
ChangePasswordEvent event, Emitter<AuthState> emit) async {
|
||||
emit(LoadingForgetState());
|
||||
try {
|
||||
var response = await AuthenticationAPI.verifyOtp(
|
||||
email: forgetEmailController.text, otpCode: forgetOtp.text);
|
||||
if (response == true) {
|
||||
await AuthenticationAPI.forgetPassword(
|
||||
password: forgetPasswordController.text, email: forgetEmailController.text);
|
||||
otpCode: forgetOtp.text,
|
||||
password: forgetPasswordController.text,
|
||||
email: forgetEmailController.text);
|
||||
_timer?.cancel();
|
||||
emit(const TimerState(isButtonEnabled: true, remainingTime: 0));
|
||||
emit(SuccessForgetState());
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
final errorData = e.response!.data;
|
||||
String errorMessage = errorData['error']['message'] ?? 'something went wrong';
|
||||
String errorMessage =
|
||||
errorData['error']['message'] ?? 'something went wrong';
|
||||
validate = errorMessage;
|
||||
emit(AuthInitialState());
|
||||
}
|
||||
@ -122,7 +129,9 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
}
|
||||
|
||||
void _onUpdateTimer(UpdateTimerEvent event, Emitter<AuthState> emit) {
|
||||
emit(TimerState(isButtonEnabled: event.isButtonEnabled, remainingTime: event.remainingTime));
|
||||
emit(TimerState(
|
||||
isButtonEnabled: event.isButtonEnabled,
|
||||
remainingTime: event.remainingTime));
|
||||
}
|
||||
|
||||
///////////////////////////////////// login /////////////////////////////////////
|
||||
@ -154,7 +163,9 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
|
||||
token = await AuthenticationAPI.loginWithEmail(
|
||||
model: LoginWithEmailModel(
|
||||
email: event.username, password: event.password, regionUuid: event.regionUuid),
|
||||
email: event.username,
|
||||
password: event.password,
|
||||
regionUuid: event.regionUuid),
|
||||
);
|
||||
} catch (failure) {
|
||||
validate = 'Invalid Credentials!';
|
||||
@ -164,7 +175,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
|
||||
if (token.accessTokenIsNotEmpty) {
|
||||
FlutterSecureStorage storage = const FlutterSecureStorage();
|
||||
await storage.write(key: Token.loginAccessTokenKey, value: token.accessToken);
|
||||
await storage.write(
|
||||
key: Token.loginAccessTokenKey, value: token.accessToken);
|
||||
const FlutterSecureStorage().write(
|
||||
key: UserModel.userUuidKey,
|
||||
value: Token.decodeToken(token.accessToken)['uuid'].toString());
|
||||
@ -322,12 +334,14 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
static Future<String> getTokenAndValidate() async {
|
||||
try {
|
||||
const storage = FlutterSecureStorage();
|
||||
final firstLaunch =
|
||||
await SharedPreferencesHelper.readBoolFromSP(StringsManager.firstLaunch) ?? true;
|
||||
final firstLaunch = await SharedPreferencesHelper.readBoolFromSP(
|
||||
StringsManager.firstLaunch) ??
|
||||
true;
|
||||
if (firstLaunch) {
|
||||
storage.deleteAll();
|
||||
}
|
||||
await SharedPreferencesHelper.saveBoolToSP(StringsManager.firstLaunch, false);
|
||||
await SharedPreferencesHelper.saveBoolToSP(
|
||||
StringsManager.firstLaunch, false);
|
||||
final value = await storage.read(key: Token.loginAccessTokenKey) ?? '';
|
||||
if (value.isEmpty) {
|
||||
return 'Token not found';
|
||||
@ -380,7 +394,9 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
final String formattedTime = [
|
||||
if (days > 0) '${days}d', // Append 'd' for days
|
||||
if (days > 0 || hours > 0)
|
||||
hours.toString().padLeft(2, '0'), // Show hours if there are days or hours
|
||||
hours
|
||||
.toString()
|
||||
.padLeft(2, '0'), // Show hours if there are days or hours
|
||||
minutes.toString().padLeft(2, '0'),
|
||||
seconds.toString().padLeft(2, '0'),
|
||||
].join(':');
|
||||
|
@ -131,7 +131,10 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
child: Row(
|
||||
children: [
|
||||
if (widget.withCheckBox) _buildSelectAllCheckbox(),
|
||||
...widget.headers.map((header) => _buildTableHeaderCell(header)),
|
||||
...List.generate(widget.headers.length, (index) {
|
||||
return _buildTableHeaderCell(widget.headers[index], index);
|
||||
})
|
||||
//...widget.headers.map((header) => _buildTableHeaderCell(header)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -224,7 +227,7 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTableHeaderCell(String title) {
|
||||
Widget _buildTableHeaderCell(String title, int index) {
|
||||
return Expanded(
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
@ -235,7 +238,7 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
constraints: const BoxConstraints.expand(height: 40),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4),
|
||||
padding: EdgeInsets.symmetric(horizontal: index == widget.headers.length - 1 ? 12 : 8.0, vertical: 4),
|
||||
child: Text(
|
||||
title,
|
||||
style: context.textTheme.titleSmall!.copyWith(
|
||||
|
@ -1,6 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
@ -431,7 +431,10 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
height: 350,
|
||||
width: 350,
|
||||
child: Column(
|
||||
@ -544,7 +547,10 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
height: 350,
|
||||
width: 350,
|
||||
child: Column(
|
||||
@ -589,14 +595,14 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
||||
TextButton(
|
||||
child: const Text('Cancel'),
|
||||
onPressed: () {
|
||||
Navigator.of(context) .pop();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
child: const Text('OK'),
|
||||
onPressed: () {
|
||||
final selectedDateTime = DateTime(selectedYear);
|
||||
Navigator.of(context).pop(selectedDateTime);
|
||||
Navigator.of(context).pop(selectedDateTime);
|
||||
},
|
||||
),
|
||||
],
|
||||
@ -624,9 +630,12 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
height: 350,
|
||||
width: 350,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
@ -702,7 +711,7 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
||||
return;
|
||||
}
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
emit(SmartPowerLoading());
|
||||
emit(FakeState());
|
||||
});
|
||||
// Use the selected picker
|
||||
await dateSelector(event.context).then((newDate) {
|
||||
@ -718,13 +727,12 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
||||
// formattedDate = newDate.toString();
|
||||
});
|
||||
emit(FilterRecordsState(filteredRecords: energyDataList));
|
||||
|
||||
}
|
||||
|
||||
List<EnergyData> energyDataList = [];
|
||||
void _filterRecordsByDate(
|
||||
FilterRecordsByDateEvent event, Emitter<SmartPowerState> emit) {
|
||||
emit(SmartPowerLoading());
|
||||
// emit(SmartPowerLoading());
|
||||
|
||||
if (event.viewType == 'Year') {
|
||||
formattedDate = event.selectedDate.year.toString();
|
||||
@ -773,7 +781,7 @@ class SmartPowerBloc extends Bloc<SmartPowerEvent, SmartPowerState> {
|
||||
}
|
||||
|
||||
String endChartDate = '';
|
||||
|
||||
|
||||
void selectDateRange() async {
|
||||
DateTime startDate = dateTime!;
|
||||
DateTime endDate = DateTime(startDate.year, startDate.month + 1, 1)
|
||||
|
@ -11,6 +11,7 @@ class SmartPowerState extends Equatable {
|
||||
class SmartPowerInitial extends SmartPowerState {}
|
||||
|
||||
class SmartPowerLoading extends SmartPowerState {}
|
||||
|
||||
class GetDeviceStatus extends SmartPowerState {}
|
||||
//GetDeviceStatus
|
||||
|
||||
@ -25,6 +26,8 @@ class SmartPowerLoadBatchControll extends SmartPowerState {
|
||||
|
||||
class DateSelectedState extends SmartPowerState {}
|
||||
|
||||
class FakeState extends SmartPowerState {}
|
||||
|
||||
class SmartPowerStatusLoaded extends SmartPowerState {
|
||||
final PowerClampModel deviceStatus;
|
||||
final int currentPage;
|
||||
|
@ -93,9 +93,9 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
|
||||
Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 15),
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.12,
|
||||
height: MediaQuery.of(context).size.height * 0.11,
|
||||
child: LineChart(
|
||||
LineChartData(
|
||||
lineTouchData: LineTouchData(
|
||||
@ -227,7 +227,7 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@ -240,7 +240,7 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
|
||||
child: Container(child: widget.widget),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Expanded(
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/painting.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
|
||||
@ -20,57 +19,61 @@ class PowerClampInfoCard extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: ColorsManager.graysColor,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
height: 55,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
iconPath,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 8,
|
||||
fontWeight: FontWeight.w400,
|
||||
child: Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorsManager.whiteColors,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
height: 55,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: 16,
|
||||
),
|
||||
SvgPicture.asset(
|
||||
iconPath,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 18,
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 8,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
value,
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
Text(
|
||||
unit,
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
Text(
|
||||
unit,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -3,9 +3,9 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_bloc.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_event.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/power_clamp/bloc/smart_power_state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/power_clamp/view/phase_widget.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/power_clamp/view/power_chart.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/power_clamp/view/power_info_card.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/power_clamp/view/phase_widget.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
@ -29,6 +29,12 @@ class SmartPowerDeviceControl extends StatelessWidget
|
||||
|
||||
if (state is SmartPowerLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is FakeState) {
|
||||
return _buildStatusControls(
|
||||
currentPage: _blocProvider.currentPage,
|
||||
context: context,
|
||||
blocProvider: _blocProvider,
|
||||
);
|
||||
} else if (state is GetDeviceStatus) {
|
||||
return _buildStatusControls(
|
||||
currentPage: _blocProvider.currentPage,
|
||||
@ -56,6 +62,7 @@ class SmartPowerDeviceControl extends StatelessWidget
|
||||
}) {
|
||||
PageController _pageController = PageController(initialPage: currentPage);
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50),
|
||||
child: DeviceControlsContainer(
|
||||
child: Column(
|
||||
children: [
|
||||
@ -66,12 +73,12 @@ class SmartPowerDeviceControl extends StatelessWidget
|
||||
style: TextStyle(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: ColorsManager.grayColor),
|
||||
color: ColorsManager.textPrimaryColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@ -102,23 +109,24 @@ class SmartPowerDeviceControl extends StatelessWidget
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
PhaseWidget(
|
||||
phaseData: blocProvider.phaseData,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 10,
|
||||
left: 20,
|
||||
right: 20,
|
||||
bottom: 10,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorsManager.whiteColors,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
height: 325,
|
||||
height: 300,
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
@ -164,9 +172,10 @@ class SmartPowerDeviceControl extends StatelessWidget
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
height: 5,
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: PageView(
|
||||
controller: _pageController,
|
||||
onPageChanged: (int page) {
|
||||
@ -176,7 +185,7 @@ class SmartPowerDeviceControl extends StatelessWidget
|
||||
children: [
|
||||
EnergyConsumptionPage(
|
||||
formattedDate:
|
||||
'${blocProvider.formattedDate}${blocProvider.endChartDate}',
|
||||
'${blocProvider.dateTime!.day}/${blocProvider.dateTime!.month}/${blocProvider.dateTime!.year} ${blocProvider.endChartDate}',
|
||||
onTap: () {
|
||||
blocProvider.add(SelectDateEvent(context: context));
|
||||
blocProvider.add(FilterRecordsByDateEvent(
|
||||
@ -205,7 +214,8 @@ class SmartPowerDeviceControl extends StatelessWidget
|
||||
date: blocProvider.formattedDate,
|
||||
),
|
||||
EnergyConsumptionPage(
|
||||
formattedDate: blocProvider.formattedDate,
|
||||
formattedDate:
|
||||
'${blocProvider.dateTime!.day}/${blocProvider.dateTime!.month}/${blocProvider.dateTime!.year} ${blocProvider.endChartDate}',
|
||||
onTap: () {
|
||||
blocProvider.add(SelectDateEvent(context: context));
|
||||
},
|
||||
@ -230,7 +240,8 @@ class SmartPowerDeviceControl extends StatelessWidget
|
||||
date: blocProvider.formattedDate,
|
||||
),
|
||||
EnergyConsumptionPage(
|
||||
formattedDate: blocProvider.formattedDate,
|
||||
formattedDate:
|
||||
'${blocProvider.dateTime!.day}/${blocProvider.dateTime!.month}/${blocProvider.dateTime!.year} ${blocProvider.endChartDate}',
|
||||
onTap: () {
|
||||
blocProvider.add(SelectDateEvent(context: context));
|
||||
},
|
||||
|
@ -52,6 +52,7 @@ class _FactoryResetWidgetState extends State<FactoryResetWidget> {
|
||||
child: DefaultButton(
|
||||
height: 20,
|
||||
elevation: 0,
|
||||
padding: 0,
|
||||
onPressed: _toggleConfirmation,
|
||||
backgroundColor: ColorsManager.greyColor,
|
||||
child: Text(
|
||||
@ -69,14 +70,16 @@ class _FactoryResetWidgetState extends State<FactoryResetWidget> {
|
||||
child: DefaultButton(
|
||||
height: 20,
|
||||
elevation: 0,
|
||||
padding: 0,
|
||||
onPressed: widget.callFactoryReset,
|
||||
backgroundColor: ColorsManager.red,
|
||||
child: Text(
|
||||
'Reset',
|
||||
style: context.textTheme.bodyMedium!.copyWith(
|
||||
color: ColorsManager.whiteColors,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 12),
|
||||
color: ColorsManager.whiteColors,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -18,10 +18,11 @@ class AuthenticationAPI {
|
||||
static Future forgetPassword({
|
||||
required var email,
|
||||
required var password,
|
||||
required var otpCode,
|
||||
}) async {
|
||||
final response = await HTTPService().post(
|
||||
path: ApiEndpoints.forgetPassword,
|
||||
body: {"email": email, "password": password},
|
||||
body: {"email": email, "password": password,"otpCode": otpCode},
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {});
|
||||
return response;
|
||||
|
@ -42,4 +42,5 @@ abstract class ColorsManager {
|
||||
static const Color textGreen = Color(0xFF008905);
|
||||
static const Color yaGreen = Color(0xFFFFBF44);
|
||||
}
|
||||
//background: #999999;
|
||||
//background: #background: #5D5D5D;
|
||||
|
||||
|
Reference in New Issue
Block a user