added color and blur to BottomActionBarWidget

This commit is contained in:
ashilkn 2022-11-29 20:21:38 +05:30
parent 9b0693de44
commit 392b548622

View file

@ -1,6 +1,9 @@
import 'dart:ui';
import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart';
import 'package:photos/models/selected_files.dart';
import 'package:photos/theme/effects.dart';
import 'package:photos/theme/ente_theme.dart';
import 'package:photos/ui/components/bottom_action_bar/action_bar_widget.dart';
import 'package:photos/ui/components/icon_button_widget.dart';
@ -26,7 +29,7 @@ class BottomActionBarWidget extends StatefulWidget {
}
class _BottomActionBarWidgetState extends State<BottomActionBarWidget> {
late bool _showBottomActionBar;
late bool _showBottomActionBar; //need to use this
final ExpandableController _expandableController =
ExpandableController(initialExpanded: false);
@override
@ -47,58 +50,63 @@ class _BottomActionBarWidgetState extends State<BottomActionBarWidget> {
final colorScheme = getEnteColorScheme(context);
final textTheme = getEnteTextTheme(context);
//todo : restrict width of column
return Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 4,
bottom: !_expandableController.expanded &&
((widget.selectedFiles?.files.isNotEmpty) ?? false)
? 24
: 36,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ExpandableNotifier(
controller: _expandableController,
child: ExpandablePanel(
theme: getExpandableTheme(context),
header: Padding(
padding: EdgeInsets.symmetric(
horizontal: widget.text == null ? 12 : 0,
),
child: ActionBarWidget(
text: widget.text,
iconButtons: _iconButtons(),
),
),
expanded: widget.expandedMenu,
collapsed: const SizedBox.shrink(),
controller: _expandableController,
),
return ClipRRect(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: blurBase, sigmaY: blurBase),
child: Container(
color: colorScheme.backdropBase,
padding: EdgeInsets.only(
top: 4,
bottom: !_expandableController.expanded &&
((widget.selectedFiles?.files.isNotEmpty) ?? false)
? 24
: 36,
),
GestureDetector(
onTap: () {
//unselect all files here
//or collapse the expansion panel
_expandableController.value = false;
},
child: Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 14,
),
child: Center(
child: Text(
"Cancel",
style: textTheme.bodyBold
.copyWith(color: colorScheme.blurTextBase),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ExpandableNotifier(
controller: _expandableController,
child: ExpandablePanel(
theme: getExpandableTheme(context),
header: Padding(
padding: EdgeInsets.symmetric(
horizontal: widget.text == null ? 12 : 0,
),
child: ActionBarWidget(
text: widget.text,
iconButtons: _iconButtons(),
),
),
expanded: widget.expandedMenu,
collapsed: const SizedBox.shrink(),
controller: _expandableController,
),
),
),
)
],
GestureDetector(
onTap: () {
//unselect all files here
//or collapse the expansion panel
_expandableController.value = false;
},
child: Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 14,
),
child: Center(
child: Text(
"Cancel",
style: textTheme.bodyBold
.copyWith(color: colorScheme.blurTextBase),
),
),
),
)
],
),
),
),
);
}