Explorar el Código

Modify BottomOfTitleBarWidget to show close button

Neeraj Gupta hace 2 años
padre
commit
5b953d1a8c
Se han modificado 1 ficheros con 20 adiciones y 1 borrados
  1. 20 1
      lib/ui/components/bottom_of_title_bar_widget.dart

+ 20 - 1
lib/ui/components/bottom_of_title_bar_widget.dart

@@ -6,11 +6,20 @@ import 'package:photos/ui/components/title_bar_title_widget.dart';
 class BottomOfTitleBarWidget extends StatelessWidget {
   final TitleBarTitleWidget? title;
   final String? caption;
-  const BottomOfTitleBarWidget({this.title, this.caption, super.key});
+  final bool showCloseButton;
+
+  const BottomOfTitleBarWidget({
+    this.title,
+    this.caption,
+    this.showCloseButton = false,
+    super.key,
+  });
 
   @override
   Widget build(BuildContext context) {
     return Row(
+      mainAxisAlignment: showCloseButton ? MainAxisAlignment.spaceBetween :
+      MainAxisAlignment.start,
       children: [
         Flexible(
           child: Padding(
@@ -31,6 +40,16 @@ class BottomOfTitleBarWidget extends StatelessWidget {
             ),
           ),
         ),
+        if (showCloseButton)
+          IconButton(
+            icon: Icon(
+              Icons.close,
+              color: getEnteColorScheme(context).strokeFaint,
+            ),
+            onPressed: () {
+              Navigator.of(context).pop();
+            },
+          ),
       ],
     );
   }