refactor(ui): Update some UI and fix some bugs
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:sfm_app/product/shared/shared_snack_bar.dart';
|
||||
import '../../product/utils/response_status_utils.dart';
|
||||
import '../../product/constant/enums/role_enums.dart';
|
||||
import '../../product/services/api_services.dart';
|
||||
@@ -22,8 +23,11 @@ addNewDevice(BuildContext context, String role) async {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('${appLocalization(context).add_device_title}: ',
|
||||
style: context.titleMediumTextStyle),
|
||||
Text(
|
||||
'${appLocalization(context).add_device_title}: ',
|
||||
style:
|
||||
const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.centerRight,
|
||||
child: IconButton(
|
||||
@@ -57,15 +61,28 @@ addNewDevice(BuildContext context, String role) async {
|
||||
appLocalization(context).input_name_device_hintText),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
SizedBox(
|
||||
height: context.lowValue,
|
||||
),
|
||||
Center(
|
||||
child: TextButton(
|
||||
onPressed: () async {
|
||||
String extID = extIDController.text;
|
||||
String deviceName = deviceNameController.text;
|
||||
child: FilledButton.tonal(
|
||||
onPressed: () async {
|
||||
String extID = extIDController.text;
|
||||
String deviceName = deviceNameController.text;
|
||||
if (extID == "") {
|
||||
showNoIconTopSnackBar(
|
||||
context,
|
||||
appLocalization(context).notification_enter_all_inf,
|
||||
Colors.orange,
|
||||
Colors.white);
|
||||
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
||||
} else {
|
||||
addDevices(context, role, extID, deviceName);
|
||||
ScaffoldMessenger.of(context).hideCurrentSnackBar();
|
||||
},
|
||||
child: Text(appLocalization(context).add_button_content)),
|
||||
}
|
||||
},
|
||||
child: Text(appLocalization(context).add_button_content),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user