import 'package:flutter/material.dart';
class AppSubmissionChecklist extends StatefulWidget {
@override
State<AppSubmissionChecklist> createState() => _AppSubmissionChecklistState();
}
class _AppSubmissionChecklistState extends State<AppSubmissionChecklist> {
bool appNameChecked = false;
bool appIconChecked = false;
bool screenshotsChecked = false;
bool privacyPolicyChecked = false;
bool versionNumberChecked = false;
bool buildNumberChecked = false;
final TextEditingController releaseNotesController = TextEditingController();
bool get isSubmitEnabled {
return appNameChecked && appIconChecked && screenshotsChecked && privacyPolicyChecked && versionNumberChecked && buildNumberChecked && releaseNotesController.text.trim().isNotEmpty;
}
@override
void initState() {
super.initState();
releaseNotesController.addListener(() {
setState(() {});
});
}
@override
void dispose() {
releaseNotesController.dispose();
super.dispose();
}
void _showSubmissionDialog() {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Confirm Submission'),
content: Text('Are you sure you want to submit your app to the App Store?'),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: Text('Cancel'),
),
ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('App submitted successfully!')),
);
},
child: Text('Submit'),
),
],
),
);
}
Widget _buildCheckbox(String title, bool value, void Function(bool?) onChanged) {
return CheckboxListTile(
title: Text(title),
value: value,
onChanged: onChanged,
controlAffinity: ListTileControlAffinity.leading,
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('App Submission Checklist')),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: ListView(
children: [
_buildCheckbox('App Name', appNameChecked, (val) => setState(() => appNameChecked = val ?? false)),
_buildCheckbox('App Icon', appIconChecked, (val) => setState(() => appIconChecked = val ?? false)),
_buildCheckbox('Screenshots', screenshotsChecked, (val) => setState(() => screenshotsChecked = val ?? false)),
_buildCheckbox('Privacy Policy URL', privacyPolicyChecked, (val) => setState(() => privacyPolicyChecked = val ?? false)),
_buildCheckbox('Version Number', versionNumberChecked, (val) => setState(() => versionNumberChecked = val ?? false)),
_buildCheckbox('Build Number', buildNumberChecked, (val) => setState(() => buildNumberChecked = val ?? false)),
SizedBox(height: 16),
Text('Release Notes', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16)),
SizedBox(height: 8),
TextField(
controller: releaseNotesController,
maxLines: 4,
decoration: InputDecoration(
border: OutlineInputBorder(),
hintText: 'Enter release notes here',
),
),
],
),
),
SizedBox(height: 16),
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: isSubmitEnabled ? _showSubmissionDialog : null,
child: Text('Submit to App Store'),
),
),
],
),
),
);
}
}
This screen uses a stateful widget to track the checklist items as boolean variables. Each checklist item is shown as a CheckboxListTile so the user can tap to check or uncheck it.
A TextEditingController manages the Release Notes input. The submit button is enabled only when all checklist items are checked and the Release Notes field is not empty.
When the user taps Submit, a confirmation dialog appears. If confirmed, a success message shows using a SnackBar.
This approach keeps the UI simple and accessible, with clear labels and a logical flow for preparing an app for App Store submission.