Testing Semantics
This commit is contained in:
parent
ff74934520
commit
b88973d43c
@ -1,6 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_quill/flutter_quill_internal.dart';
|
||||||
import 'package:frontend/utils/auth_utils.dart';
|
import 'package:frontend/utils/auth_utils.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
@ -34,9 +35,15 @@ class _PlaceholdersModalState extends State<PlaceholdersModal> {
|
|||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
contentPadding: const EdgeInsets.fromLTRB(34, 30, 34, 30),
|
contentPadding: const EdgeInsets.fromLTRB(34, 30, 34, 30),
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
title: Text("Available Placeholders"),
|
title: Text(
|
||||||
content: SizedBox(
|
"Available Placeholders",
|
||||||
width: double.maxFinite,
|
style: GoogleFonts.poppins(fontSize: 15, fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
content: Container(
|
||||||
|
width:
|
||||||
|
isDesktop
|
||||||
|
? MediaQuery.of(context).size.width * 0.3
|
||||||
|
: double.maxFinite,
|
||||||
// Set max height so ListView knows constraints
|
// Set max height so ListView knows constraints
|
||||||
height: 300,
|
height: 300,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@ -73,7 +80,7 @@ class _PlaceholdersModalState extends State<PlaceholdersModal> {
|
|||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
child: Text("Close"),
|
child: Text("Close", style: GoogleFonts.poppins(fontSize: 12)),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@ -281,7 +281,7 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
|||||||
_buildFirstRow(widget.isDesktop),
|
_buildFirstRow(widget.isDesktop),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
_buildSecondRow(widget.isDesktop),
|
_buildSecondRow(widget.isDesktop),
|
||||||
SizedBox(height: 10),
|
// SizedBox(height: 10),
|
||||||
_buildThirdRow(widget.isDesktop),
|
_buildThirdRow(widget.isDesktop),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
_buildForthRow(widget.isDesktop),
|
_buildForthRow(widget.isDesktop),
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
// import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'dart:html' as html;
|
import 'dart:html' as html;
|
||||||
import 'package:frontend/config/apiUrl.dart'; // 1 newly added
|
import 'package:frontend/config/apiUrl.dart'; // 1 newly added
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ class _MyAppState extends State<MyApp> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
// SemanticsBinding.instance.ensureSemantics(); // ✅ Safe here
|
SemanticsBinding.instance.ensureSemantics(); // ✅ Safe here
|
||||||
if (kIsWeb) {
|
if (kIsWeb) {
|
||||||
final uri = Uri.parse(html.window.location.href);
|
final uri = Uri.parse(html.window.location.href);
|
||||||
if (uri.path == '/authredirection' &&
|
if (uri.path == '/authredirection' &&
|
||||||
|
|||||||
@ -17,8 +17,10 @@ class OrganizationSetting extends StatefulWidget {
|
|||||||
class OrganizationSettingState extends State<OrganizationSetting> {
|
class OrganizationSettingState extends State<OrganizationSetting> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ResponsiveBuilder(builder: (context, sizingInfo) {
|
return ResponsiveBuilder(
|
||||||
bool isDesktop = sizingInfo.deviceScreenType == DeviceScreenType.desktop;
|
builder: (context, sizingInfo) {
|
||||||
|
bool isDesktop =
|
||||||
|
sizingInfo.deviceScreenType == DeviceScreenType.desktop;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Color(0xFFf5f5f5),
|
backgroundColor: Color(0xFFf5f5f5),
|
||||||
@ -29,23 +31,27 @@ class OrganizationSettingState extends State<OrganizationSetting> {
|
|||||||
appBar: CustomAppBar(isDesktop: isDesktop),
|
appBar: CustomAppBar(isDesktop: isDesktop),
|
||||||
drawer: CustomDrawer(isDesktop: false),
|
drawer: CustomDrawer(isDesktop: false),
|
||||||
body: Padding(
|
body: Padding(
|
||||||
padding: isDesktop
|
padding:
|
||||||
|
isDesktop
|
||||||
? EdgeInsets.symmetric(
|
? EdgeInsets.symmetric(
|
||||||
horizontal: MediaQuery.of(context).size.width *
|
horizontal:
|
||||||
|
MediaQuery.of(context).size.width *
|
||||||
0.1, // 30% of screen width as horizontal padding
|
0.1, // 30% of screen width as horizontal padding
|
||||||
vertical: MediaQuery.of(context).size.height *
|
vertical:
|
||||||
|
MediaQuery.of(context).size.height *
|
||||||
0, // 5% of screen height as vertical padding
|
0, // 5% of screen height as vertical padding
|
||||||
)
|
)
|
||||||
: EdgeInsets.all(0),
|
: EdgeInsets.all(0),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
// if (isDesktop) CustomDrawer(isDesktop: true),
|
// if (isDesktop) CustomDrawer(isDesktop: true),
|
||||||
Expanded(child: buildGroupListLayout(isDesktop))
|
Expanded(child: buildGroupListLayout(isDesktop)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildGroupListLayout(bool isDesktop) {
|
Widget buildGroupListLayout(bool isDesktop) {
|
||||||
@ -56,57 +62,63 @@ class OrganizationSettingState extends State<OrganizationSetting> {
|
|||||||
'value': '/OrganizationSetup',
|
'value': '/OrganizationSetup',
|
||||||
'icon': Icons.business,
|
'icon': Icons.business,
|
||||||
'label': 'Organization Settings',
|
'label': 'Organization Settings',
|
||||||
'description': 'Edit Logo and Email Configurations'
|
'description': 'Edit Logo and Email Configurations',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'value': '/group',
|
'value': '/group',
|
||||||
'icon': Icons.groups,
|
'icon': Icons.groups,
|
||||||
'label': 'Groups',
|
'label': 'Groups',
|
||||||
'description': 'Create and Edit Groups'
|
'description': 'Create and Edit Groups',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'value': '/PolicyList',
|
'value': '/PolicyList',
|
||||||
'icon': Icons.policy,
|
'icon': Icons.policy,
|
||||||
'label': 'Travel Policies',
|
'label': 'Travel Policies',
|
||||||
'description': 'Create and Edit Travel Policy'
|
'description': 'Create and Edit Travel Policy',
|
||||||
},
|
|
||||||
{
|
|
||||||
'value': '/department',
|
|
||||||
'icon': Icons.group_add_outlined,
|
|
||||||
'label': 'Departments',
|
|
||||||
'description': 'Create and Edit Department'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
'value': '/getPerdiem',
|
'value': '/getPerdiem',
|
||||||
'icon': Icons.attach_money,
|
'icon': Icons.attach_money,
|
||||||
'label': 'Perdiem Amount',
|
'label': 'Perdiem Amount',
|
||||||
'description': 'Create and Edit Perdiem Amount'
|
'description': 'Create and Edit Perdiem Amount',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'value': '/department',
|
||||||
|
'icon': Icons.group_add_outlined,
|
||||||
|
'label': 'Forex Template',
|
||||||
|
'description': 'Create and Edit Template',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'value': '/templateList',
|
'value': '/templateList',
|
||||||
'icon': Icons.email_outlined,
|
'icon': Icons.email_outlined,
|
||||||
'label': 'Email Templates',
|
'label': 'Email Templates',
|
||||||
'description': ' Edit Email Template'
|
'description': ' Edit Email Template',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'value': '/department',
|
||||||
|
'icon': Icons.group_add_outlined,
|
||||||
|
'label': 'Departments',
|
||||||
|
'description': 'Create and Edit Department',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'value': '/costcenter',
|
'value': '/costcenter',
|
||||||
'icon': Icons.account_balance_wallet,
|
'icon': Icons.account_balance_wallet,
|
||||||
'label': 'Cost Center',
|
'label': 'Cost Center',
|
||||||
'description': 'Create and Edit Cost Center'
|
'description': 'Create and Edit Cost Center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'value': '/hotels',
|
'value': '/hotels',
|
||||||
'icon': Icons.add_business,
|
'icon': Icons.add_business,
|
||||||
'label': 'Hotels',
|
'label': 'Hotels',
|
||||||
'description': 'Create and Edit Hotels'
|
'description': 'Create and Edit Hotels',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'value': '/traveller',
|
'value': '/traveller',
|
||||||
'icon': Icons.travel_explore,
|
'icon': Icons.travel_explore,
|
||||||
'label': 'Traveller',
|
'label': 'Traveller',
|
||||||
'description': 'Create and Edit Traveller'
|
'description': 'Create and Edit Traveller',
|
||||||
},
|
},
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// List<Widget> rows = [];
|
// List<Widget> rows = [];
|
||||||
@ -225,7 +237,8 @@ class OrganizationSettingState extends State<OrganizationSetting> {
|
|||||||
child: Wrap(
|
child: Wrap(
|
||||||
spacing: 16,
|
spacing: 16,
|
||||||
runSpacing: 16,
|
runSpacing: 16,
|
||||||
children: menuItems.map((item) {
|
children:
|
||||||
|
menuItems.map((item) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: isDesktop ? 325 : double.infinity,
|
width: isDesktop ? 325 : double.infinity,
|
||||||
child: Card(
|
child: Card(
|
||||||
@ -239,11 +252,16 @@ class OrganizationSettingState extends State<OrganizationSetting> {
|
|||||||
padding: EdgeInsets.all(12),
|
padding: EdgeInsets.all(12),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(item['icon'], size: 40, color: Color(0xFF114D8B)),
|
Icon(
|
||||||
|
item['icon'],
|
||||||
|
size: 40,
|
||||||
|
color: Color(0xFF114D8B),
|
||||||
|
),
|
||||||
SizedBox(width: 16),
|
SizedBox(width: 16),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
@ -281,6 +299,5 @@ class OrganizationSettingState extends State<OrganizationSetting> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user