fix iconbuttons splash animation
This commit is contained in:
+81
-79
@@ -613,98 +613,100 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
|
|
||||||
Widget _buildFilePickerSection() {
|
Widget _buildFilePickerSection() {
|
||||||
return Container(
|
return Container(
|
||||||
color: Color(0xFFF2F2F2),
|
|
||||||
height: _filePickerSize,
|
height: _filePickerSize,
|
||||||
child: Column(
|
child: Material(
|
||||||
children: [
|
color: Color(0xFFF2F2F2),
|
||||||
Row(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
children: [
|
||||||
children: [
|
Row(
|
||||||
IconButton(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
icon: Icon(
|
children: [
|
||||||
StreamIcons.picture,
|
IconButton(
|
||||||
color: _filePickerIndex == 0
|
icon: Icon(
|
||||||
? StreamChatTheme.of(context).accentColor
|
StreamIcons.picture,
|
||||||
: Colors.black.withOpacity(0.5),
|
color: _filePickerIndex == 0
|
||||||
|
? StreamChatTheme.of(context).accentColor
|
||||||
|
: Colors.black.withOpacity(0.5),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_filePickerIndex = 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onPressed: () {
|
IconButton(
|
||||||
setState(() {
|
icon: Icon(
|
||||||
_filePickerIndex = 0;
|
StreamIcons.folder,
|
||||||
});
|
color: _filePickerIndex == 1
|
||||||
},
|
? StreamChatTheme.of(context).accentColor
|
||||||
),
|
: Colors.black.withOpacity(0.5),
|
||||||
IconButton(
|
),
|
||||||
icon: Icon(
|
onPressed: () {
|
||||||
StreamIcons.folder,
|
pickFile(DefaultAttachmentTypes.file, false);
|
||||||
color: _filePickerIndex == 1
|
},
|
||||||
? StreamChatTheme.of(context).accentColor
|
|
||||||
: Colors.black.withOpacity(0.5),
|
|
||||||
),
|
),
|
||||||
onPressed: () {
|
IconButton(
|
||||||
pickFile(DefaultAttachmentTypes.file, false);
|
icon: Icon(
|
||||||
},
|
StreamIcons.camera,
|
||||||
),
|
color: _filePickerIndex == 2
|
||||||
IconButton(
|
? StreamChatTheme.of(context).accentColor
|
||||||
icon: Icon(
|
: Colors.black.withOpacity(0.5),
|
||||||
StreamIcons.camera,
|
),
|
||||||
color: _filePickerIndex == 2
|
onPressed: () {
|
||||||
? StreamChatTheme.of(context).accentColor
|
pickFile(DefaultAttachmentTypes.image, true);
|
||||||
: Colors.black.withOpacity(0.5),
|
},
|
||||||
),
|
),
|
||||||
onPressed: () {
|
],
|
||||||
pickFile(DefaultAttachmentTypes.image, true);
|
),
|
||||||
},
|
GestureDetector(
|
||||||
),
|
onVerticalDragUpdate: (update) {
|
||||||
],
|
setState(() {
|
||||||
),
|
_filePickerSize -= update.delta.dy;
|
||||||
GestureDetector(
|
if (_filePickerSize < 100) {
|
||||||
onVerticalDragUpdate: (update) {
|
_filePickerSize = 100.0;
|
||||||
setState(() {
|
} else if (_filePickerSize >
|
||||||
_filePickerSize -= update.delta.dy;
|
MediaQuery.of(context).size.height / 1.7) {
|
||||||
if (_filePickerSize < 100) {
|
_filePickerSize = MediaQuery.of(context).size.height / 1.7;
|
||||||
_filePickerSize = 100.0;
|
}
|
||||||
} else if (_filePickerSize >
|
});
|
||||||
MediaQuery.of(context).size.height / 1.7) {
|
},
|
||||||
_filePickerSize = MediaQuery.of(context).size.height / 1.7;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(16.0),
|
|
||||||
topRight: Radius.circular(16.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
decoration: BoxDecoration(
|
||||||
child: Center(
|
color: Colors.white,
|
||||||
child: Padding(
|
borderRadius: BorderRadius.only(
|
||||||
padding: const EdgeInsets.all(8.0),
|
topLeft: Radius.circular(16.0),
|
||||||
child: Container(
|
topRight: Radius.circular(16.0),
|
||||||
width: 40.0,
|
),
|
||||||
height: 4.0,
|
),
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
color: Color(0xFFF2F2F2),
|
width: double.infinity,
|
||||||
borderRadius: BorderRadius.circular(4.0),
|
child: Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
width: 40.0,
|
||||||
|
height: 4.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFF2F2F2),
|
||||||
|
borderRadius: BorderRadius.circular(4.0),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
Expanded(
|
child: Container(
|
||||||
child: Container(
|
decoration: BoxDecoration(
|
||||||
decoration: BoxDecoration(
|
color: Colors.white,
|
||||||
color: Colors.white,
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
),
|
||||||
|
child: _buildPickerSection(),
|
||||||
),
|
),
|
||||||
child: _buildPickerSection(),
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user