Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 22 additions & 37 deletions lib/ui/screens/save_page_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ class _SavePageDialogState extends State<SavePageDialog> {

try {
if (mounted) {
await context
.read<CanvasCubit>()
.savePage(pageName, label: label, color: color.toARGB32());
await context.read<CanvasCubit>().savePage(pageName, label: label, color: color.toARGB32());
}

if (mounted) {
Expand Down Expand Up @@ -134,8 +132,7 @@ class _SavePageDialogState extends State<SavePageDialog> {
text: '"$pageName"',
style: const TextStyle(fontWeight: FontWeight.bold),
),
const TextSpan(
text: ' already exists. Do you want to overwrite it?'),
const TextSpan(text: ' already exists. Do you want to overwrite it?'),
],
),
),
Expand Down Expand Up @@ -203,8 +200,7 @@ class _SavePageDialogState extends State<SavePageDialog> {
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: const BorderSide(
color: ColorConstants.dialogButtonBlue, width: 2),
borderSide: const BorderSide(color: ColorConstants.dialogButtonBlue, width: 2),
),
prefixIcon: const Icon(Icons.description),
counterText: '', // Hide character counter
Expand Down Expand Up @@ -239,7 +235,7 @@ class _SavePageDialogState extends State<SavePageDialog> {
textInputAction: TextInputAction.next,
),
const SizedBox(height: 16),
Row(
Wrap(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the main change

children: [
const Text('Choose a color: ', style: TextStyle(fontSize: 14)),
...[
Expand All @@ -250,39 +246,28 @@ class _SavePageDialogState extends State<SavePageDialog> {
ColorConstants.dialogPurple,
ColorConstants.dialogButtonBlue,
].map((color) => GestureDetector(
onTap: () {
setState(() {
_selectedColor = color;
});
},
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 4),
width: 24,
height: 24,
decoration: BoxDecoration(
color: color,
shape: BoxShape.circle,
border: Border.all(
color: _selectedColor == color
? ColorConstants.dialogTextBlack
: ColorConstants.dialogGray,
width: 2,
),
onTap: () {
setState(() {
_selectedColor = color;
});
},
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 4),
width: 24,
height: 24,
decoration: BoxDecoration(
color: color,
shape: BoxShape.circle,
border: Border.all(
color: _selectedColor == color ? ColorConstants.dialogTextBlack : ColorConstants.dialogGray,
width: 2,
),
),
))
),
),
),
],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the existing page stuff

),
if (_existingPages.isNotEmpty) ...[
const SizedBox(height: 12),
Text(
'Existing pages: ${_existingPages.length}',
style: TextStyle(
fontSize: 12,
color: ColorConstants.gray600,
),
),
],
],
),
),
Expand Down
Loading