fixes
This commit is contained in:
parent
c4758eac73
commit
fd94dbf20d
@ -99,8 +99,6 @@ class _HomeState extends State<Home> {
|
||||
Widget build(BuildContext context) {
|
||||
bool widescreen = MediaQuery.sizeOf(context).width >= widescreenWidth;
|
||||
return Scaffold(
|
||||
// floatingActionButton: _getFAB(widescreen, scrollControllerBusinesses,
|
||||
// scrollControllerJobs, currentPageIndex),
|
||||
bottomNavigationBar: _getNavigationBar(widescreen),
|
||||
body: RefreshIndicator(
|
||||
edgeOffset: 145,
|
||||
@ -173,13 +171,6 @@ class _HomeState extends State<Home> {
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
label: 'Job Listings'),
|
||||
// NavigationDestination(
|
||||
// icon: const Icon(Icons.description_outlined),
|
||||
// selectedIcon: Icon(
|
||||
// Icons.description,
|
||||
// color: Theme.of(context).colorScheme.onSurface,
|
||||
// ),
|
||||
// label: 'Export Data')
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -264,51 +255,11 @@ class _HomeState extends State<Home> {
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
label: const Text('Job Listings')),
|
||||
// NavigationRailDestination(
|
||||
// icon: const Icon(Icons.description_outlined),
|
||||
// selectedIcon: Icon(
|
||||
// Icons.description,
|
||||
// color: Theme.of(context).colorScheme.onSurface,
|
||||
// ),
|
||||
// label: const Text('Export Data'))
|
||||
],
|
||||
),
|
||||
// children.first
|
||||
],
|
||||
);
|
||||
// }
|
||||
// return children.first;
|
||||
}
|
||||
|
||||
// Widget _contentPane() {
|
||||
// return IndexedStack(
|
||||
// index: currentPageIndex,
|
||||
// children: [
|
||||
// BusinessesOverview(
|
||||
// searchQuery: searchQuery,
|
||||
// refreshBusinessDataOverviewFuture:
|
||||
// refreshBusinessDataOverviewBusinessFuture,
|
||||
// updateBusinessesCallback: _updateOverviewBusinessesBusinessCallback,
|
||||
// themeCallback: widget.themeCallback,
|
||||
// updateLoggedIn: _updateLoggedIn,
|
||||
// ),
|
||||
// JobsOverview(
|
||||
// searchQuery: searchQuery,
|
||||
// refreshJobDataOverviewFuture: refreshBusinessDataOverviewJobFuture,
|
||||
// updateBusinessesCallback: _updateOverviewBusinessesJobsCallback,
|
||||
// themeCallback: widget.themeCallback, updateLoggedIn: _updateLoggedIn),
|
||||
// ExportData(
|
||||
// searchQuery: searchQuery,
|
||||
// refreshBusinessDataOverviewFuture:
|
||||
// refreshBusinessDataOverviewBusinessFuture,
|
||||
// updateBusinessesWithJobCallback:
|
||||
// _updateOverviewBusinessesJobsCallback,
|
||||
// themeCallback: widget.themeCallback,
|
||||
// refreshJobDataOverviewFuture: refreshBusinessDataOverviewJobFuture,
|
||||
// updateBusinessesCallback: _updateOverviewBusinessesBusinessCallback)
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
}
|
||||
|
||||
class _ContentPane extends StatelessWidget {
|
||||
@ -354,35 +305,7 @@ class _ContentPane extends StatelessWidget {
|
||||
themeCallback: themeCallback,
|
||||
updateLoggedIn: updateLoggedIn,
|
||||
),
|
||||
// ExportData(
|
||||
// searchQuery: searchQuery,
|
||||
// refreshBusinessDataOverviewFuture:
|
||||
// refreshBusinessDataOverviewBusinessFuture,
|
||||
// updateBusinessesWithJobCallback:
|
||||
// updateOverviewBusinessesJobsCallback,
|
||||
// themeCallback: themeCallback,
|
||||
// refreshJobDataOverviewFuture: refreshBusinessDataOverviewJobFuture,
|
||||
// updateBusinessesCallback: updateOverviewBusinessesBusinessCallback)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// class FABAnimator extends FloatingActionButtonAnimator {
|
||||
// @override
|
||||
// Offset getOffset({Offset begin, Offset end, double progress}) {
|
||||
// return end;
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// Animation<double> getRotationAnimation({required Animation<double> parent}) {
|
||||
// return Tween<double>(begin: 0.0, end: 1.0).animate(parent);
|
||||
// throw UnimplementedError();
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// Animation<double> getScaleAnimation({required Animation<double> parent}) {
|
||||
// return Tween<double>(begin: 0.0, end: 1.0).animate(parent);
|
||||
// throw UnimplementedError();
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -83,10 +83,10 @@ class _MainAppState extends State<MainApp> {
|
||||
iconTheme: const IconThemeData(color: Colors.white),
|
||||
useMaterial3: true,
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
// border: OutlineInputBorder(),
|
||||
filled: true,
|
||||
fillColor: Colors.grey.withOpacity(0.1),
|
||||
labelStyle: const TextStyle(color: Colors.grey),
|
||||
floatingLabelStyle: TextStyle(color: Colors.blue.shade700),
|
||||
),
|
||||
dropdownMenuTheme: const DropdownMenuThemeData(
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
@ -112,6 +112,7 @@ class _MainAppState extends State<MainApp> {
|
||||
filled: true,
|
||||
fillColor: Colors.blue.withOpacity(0.1),
|
||||
labelStyle: const TextStyle(color: Colors.grey),
|
||||
floatingLabelStyle: TextStyle(color: Colors.blue.shade700),
|
||||
),
|
||||
dropdownMenuTheme: const DropdownMenuThemeData(
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
|
||||
@ -450,6 +450,7 @@ class _BusinessHeaderState extends State<_BusinessHeader> {
|
||||
}
|
||||
}
|
||||
|
||||
/// A desktop widget that displays basic info about a business
|
||||
Widget _businessTile(Business business, BusinessType jobType) {
|
||||
return MouseRegion(
|
||||
cursor: SystemMouseCursors.click,
|
||||
@ -573,6 +574,7 @@ class _BusinessHeaderState extends State<_BusinessHeader> {
|
||||
);
|
||||
}
|
||||
|
||||
/// A mobile widget that displays basic info about a business
|
||||
Widget _businessListItem(Business business, BusinessType? jobType) {
|
||||
return Card(
|
||||
child: ListTile(
|
||||
|
||||
@ -91,6 +91,7 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
|
||||
),
|
||||
floatingActionButton: !widescreen
|
||||
? FloatingActionButton.extended(
|
||||
heroTag: 'saveBusiness',
|
||||
label: const Text('Save'),
|
||||
icon: _isLoading
|
||||
? const SizedBox(
|
||||
@ -171,8 +172,6 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
|
||||
right: 8.0),
|
||||
child: TextFormField(
|
||||
controller: _nameController,
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
maxLength: 30,
|
||||
onChanged: (inputName) {
|
||||
setState(() {
|
||||
@ -198,8 +197,6 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
|
||||
bottom: 8.0, left: 8.0, right: 8.0),
|
||||
child: TextFormField(
|
||||
controller: _descriptionController,
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
maxLength: 500,
|
||||
maxLines: null,
|
||||
onChanged: (inputDesc) {
|
||||
@ -227,8 +224,6 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
|
||||
left: 8.0, right: 8.0, bottom: 16.0),
|
||||
child: TextFormField(
|
||||
controller: _websiteController,
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
keyboardType: TextInputType.url,
|
||||
onChanged: (inputUrl) {
|
||||
business.website = Uri.encodeFull(inputUrl);
|
||||
@ -267,7 +262,12 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
|
||||
left: 8.0, right: 8.0, bottom: 16.0),
|
||||
child: DropdownMenu<BusinessType>(
|
||||
initialSelection: business.type,
|
||||
// width: 776,
|
||||
width: (MediaQuery.sizeOf(context).width -
|
||||
24) <
|
||||
776
|
||||
? MediaQuery.sizeOf(context).width - 24
|
||||
: 776,
|
||||
menuHeight: 300,
|
||||
label: const Text('Business Type'),
|
||||
errorText: dropDownErrorText,
|
||||
dropdownMenuEntries: [
|
||||
@ -375,8 +375,6 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
|
||||
labelText:
|
||||
'Contact Information Name (required)',
|
||||
),
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
validator: (value) {
|
||||
if (value == null || value.trim().isEmpty) {
|
||||
return 'Contact name is required';
|
||||
@ -392,8 +390,6 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
|
||||
controller: _contactPhoneController,
|
||||
inputFormatters: [PhoneFormatter()],
|
||||
keyboardType: TextInputType.phone,
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
onChanged: (inputText) {
|
||||
if (inputText.trim().isEmpty) {
|
||||
business.contactPhone = null;
|
||||
@ -432,8 +428,6 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
|
||||
business.contactEmail = inputText.trim();
|
||||
}
|
||||
},
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
onTapOutside: (PointerDownEvent event) {
|
||||
FocusScope.of(context).unfocus();
|
||||
},
|
||||
@ -472,8 +466,6 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
|
||||
business.locationName = inputName.trim();
|
||||
});
|
||||
},
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
onTapOutside: (PointerDownEvent event) {
|
||||
FocusScope.of(context).unfocus();
|
||||
},
|
||||
@ -498,8 +490,6 @@ class _CreateEditBusinessState extends State<CreateEditBusiness> {
|
||||
business.locationAddress = inputAddr;
|
||||
});
|
||||
},
|
||||
autovalidateMode:
|
||||
AutovalidateMode.onUserInteraction,
|
||||
onTapOutside: (PointerDownEvent event) {
|
||||
FocusScope.of(context).unfocus();
|
||||
},
|
||||
|
||||
@ -83,6 +83,7 @@ class _CreateEditJobListingState extends State<CreateEditJobListing> {
|
||||
),
|
||||
floatingActionButton: !widescreen
|
||||
? FloatingActionButton.extended(
|
||||
heroTag: 'saveListing',
|
||||
label: const Text('Save'),
|
||||
icon: _isLoading
|
||||
? const SizedBox(
|
||||
@ -227,6 +228,7 @@ class _CreateEditJobListingState extends State<CreateEditJobListing> {
|
||||
typeDropdownErrorText,
|
||||
width: calculateDropdownWidth(
|
||||
context),
|
||||
menuHeight: 300,
|
||||
dropdownMenuEntries: [
|
||||
for (JobType type
|
||||
in JobType.values)
|
||||
@ -336,8 +338,6 @@ class _CreateEditJobListingState extends State<CreateEditJobListing> {
|
||||
bottom: 8.0),
|
||||
child: TextFormField(
|
||||
controller: _nameController,
|
||||
autovalidateMode: AutovalidateMode
|
||||
.onUserInteraction,
|
||||
maxLength: 30,
|
||||
onChanged: (inputName) {
|
||||
setState(() {
|
||||
@ -368,8 +368,6 @@ class _CreateEditJobListingState extends State<CreateEditJobListing> {
|
||||
bottom: 8.0),
|
||||
child: TextFormField(
|
||||
controller: _descriptionController,
|
||||
autovalidateMode: AutovalidateMode
|
||||
.onUserInteraction,
|
||||
maxLength: 500,
|
||||
maxLines: null,
|
||||
onChanged: (inputDesc) {
|
||||
@ -422,8 +420,6 @@ class _CreateEditJobListingState extends State<CreateEditJobListing> {
|
||||
bottom: 16.0),
|
||||
child: TextFormField(
|
||||
controller: _linkController,
|
||||
autovalidateMode: AutovalidateMode
|
||||
.onUserInteraction,
|
||||
keyboardType: TextInputType.url,
|
||||
onChanged: (inputUrl) {
|
||||
if (inputUrl != '') {
|
||||
@ -475,7 +471,7 @@ class _CreateEditJobListingState extends State<CreateEditJobListing> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 8.0,
|
||||
right: 8.0,
|
||||
bottom: 8.0),
|
||||
|
||||
@ -258,7 +258,9 @@ class _CreateBusinessDetailState extends State<JobListingDetail> {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const MainApp()));
|
||||
builder: (context) => const MainApp(
|
||||
initialPage: 1,
|
||||
)));
|
||||
}
|
||||
}),
|
||||
],
|
||||
|
||||
@ -491,7 +491,7 @@ class _JobHeaderState extends State<_JobHeader> {
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
childCount: businesses.length,
|
||||
(BuildContext context, int index) {
|
||||
return _businessTile(
|
||||
return _jobBusinessTile(
|
||||
businesses[index],
|
||||
widget.jobType,
|
||||
);
|
||||
@ -504,7 +504,7 @@ class _JobHeaderState extends State<_JobHeader> {
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
childCount: businesses.length,
|
||||
(BuildContext context, int index) {
|
||||
return _businessListItem(
|
||||
return _jobBusinessListItem(
|
||||
businesses[index],
|
||||
widget.jobType,
|
||||
);
|
||||
@ -514,7 +514,8 @@ class _JobHeaderState extends State<_JobHeader> {
|
||||
}
|
||||
}
|
||||
|
||||
Widget _businessTile(Business business, JobType jobType) {
|
||||
/// A desktop widget that displays basic info about a job
|
||||
Widget _jobBusinessTile(Business business, JobType jobType) {
|
||||
return MouseRegion(
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: GestureDetector(
|
||||
@ -653,7 +654,8 @@ class _JobHeaderState extends State<_JobHeader> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _businessListItem(Business business, JobType? jobType) {
|
||||
/// A mobile widget that displays basic info about a job
|
||||
Widget _jobBusinessListItem(Business business, JobType? jobType) {
|
||||
return Card(
|
||||
child: ListTile(
|
||||
leading: Badge(
|
||||
|
||||
@ -87,20 +87,6 @@ Future fetchBusinessDataOverviewJobs(
|
||||
}
|
||||
|
||||
return groupedBusinesses;
|
||||
// Map<JobType, List<Business>> groupedBusinesses = {};
|
||||
//
|
||||
// for (String stringType in decodedResponse.keys) {
|
||||
// List<Business> businesses = [];
|
||||
//
|
||||
// for (Map<String, dynamic> map in decodedResponse[stringType]) {
|
||||
// Business business = Business.fromJson(map);
|
||||
// businesses.add(business);
|
||||
// }
|
||||
//
|
||||
// groupedBusinesses
|
||||
// .addAll({JobType.values.byName(stringType): businesses});
|
||||
// }
|
||||
// return groupedBusinesses;
|
||||
} else {
|
||||
return 'Error ${response.statusCode}! Please try again later!';
|
||||
}
|
||||
@ -394,9 +380,6 @@ Future marinoDevLogo() async {
|
||||
Uri.parse('$apiAddress/marinodev'),
|
||||
);
|
||||
|
||||
// File logo = File ('${getTemporaryDirectory().toString()}/marinodev.svg');
|
||||
// logo.writeAsBytes(response.bodyBytes);
|
||||
|
||||
return response.bodyBytes;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user