fix: new group clear splash (#5214)

* fix: splash color for clear btn

* fix: translation for New group

* fix: complete rest of the issue

---------

Co-authored-by: Mathias Mogensen <mathias@appflowy.io>
This commit is contained in:
Chirag Bargoojar 2024-05-01 15:29:45 +05:30 committed by GitHub
parent 1d73174b0c
commit a971f3c6d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 30 additions and 30 deletions

View File

@ -1,14 +1,13 @@
import 'package:flutter/material.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/database/board/application/board_bloc.dart'; import 'package:appflowy/plugins/database/board/application/board_bloc.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
/// Add new group /// Add new group
class MobileBoardTrailing extends StatefulWidget { class MobileBoardTrailing extends StatefulWidget {
const MobileBoardTrailing({ const MobileBoardTrailing({super.key});
super.key,
});
@override @override
State<MobileBoardTrailing> createState() => _MobileBoardTrailingState(); State<MobileBoardTrailing> createState() => _MobileBoardTrailingState();
@ -49,13 +48,24 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
TextField( TextField(
controller: _textController, controller: _textController,
autofocus: true, autofocus: true,
onChanged: (_) => setState(() {}),
decoration: InputDecoration( decoration: InputDecoration(
suffixIcon: IconButton( suffixIcon: AnimatedOpacity(
icon: Icon( duration: const Duration(milliseconds: 200),
Icons.close, opacity: _textController.text.isNotEmpty ? 1 : 0,
color: style.colorScheme.onBackground, child: Material(
color: Colors.transparent,
shape: const CircleBorder(),
clipBehavior: Clip.antiAlias,
child: IconButton(
icon: Icon(
Icons.close,
color: style.colorScheme.onBackground,
),
onPressed: () =>
setState(() => _textController.clear()),
),
), ),
onPressed: () => _textController.clear(),
), ),
isDense: true, isDense: true,
), ),
@ -66,9 +76,7 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
), ),
); );
_textController.clear(); _textController.clear();
setState(() { setState(() => isEditing = false);
isEditing = false;
});
}, },
), ),
Row( Row(
@ -81,11 +89,7 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
color: style.colorScheme.onBackground, color: style.colorScheme.onBackground,
), ),
), ),
onPressed: () { onPressed: () => setState(() => isEditing = false),
setState(() {
isEditing = false;
});
},
), ),
TextButton( TextButton(
child: Text( child: Text(
@ -102,9 +106,7 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
), ),
); );
_textController.clear(); _textController.clear();
setState(() { setState(() => isEditing = false);
isEditing = false;
});
}, },
), ),
], ],
@ -120,6 +122,9 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
).copyWith(
overlayColor:
MaterialStateProperty.all(Theme.of(context).hoverColor),
), ),
icon: const Icon(Icons.add), icon: const Icon(Icons.add),
label: Text( label: Text(
@ -128,9 +133,7 @@ class _MobileBoardTrailingState extends State<MobileBoardTrailing> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
onPressed: () => setState( onPressed: () => setState(() => isEditing = true),
() => isEditing = true,
),
), ),
), ),
); );

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
class MobileQuickActionButton extends StatelessWidget { class MobileQuickActionButton extends StatelessWidget {
const MobileQuickActionButton({ const MobileQuickActionButton({
@ -25,11 +26,7 @@ class MobileQuickActionButton extends StatelessWidget {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 4), padding: const EdgeInsets.symmetric(horizontal: 4),
child: InkWell( child: InkWell(
onTap: () { onTap: enable ? onTap : null,
if (enable) {
onTap();
}
},
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
overlayColor: overlayColor:
enable ? null : const MaterialStatePropertyAll(Colors.transparent), enable ? null : const MaterialStatePropertyAll(Colors.transparent),

View File

@ -1093,7 +1093,7 @@
"addToColumnBottomTooltip": "Add a new card at the bottom", "addToColumnBottomTooltip": "Add a new card at the bottom",
"renameColumn": "Rename", "renameColumn": "Rename",
"hideColumn": "Hide", "hideColumn": "Hide",
"newGroup": "New Group", "newGroup": "New group",
"deleteColumn": "Delete", "deleteColumn": "Delete",
"deleteColumnConfirmation": "This will delete this group and all the cards in it.\nAre you sure you want to continue?" "deleteColumnConfirmation": "This will delete this group and all the cards in it.\nAre you sure you want to continue?"
}, },