feat: Switched to svgicon
This commit is contained in:
@@ -83,8 +83,7 @@ class ImageActionsModal extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
StreamIcons.close,
|
||||
icon: StreamSvgIcon.close(
|
||||
size: 24.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
@@ -111,17 +110,31 @@ class ImageActionsModal extends StatelessWidget {
|
||||
children: ListTile.divideTiles(
|
||||
context: context,
|
||||
tiles: [
|
||||
_buildButton(context, 'Reply',
|
||||
StreamIcons.curve_line_down_left, () {}),
|
||||
_buildButton(context, 'Show in Chat', StreamIcons.eye,
|
||||
() {
|
||||
_buildButton(
|
||||
context,
|
||||
'Reply',
|
||||
StreamSvgIcon.Icon_curve_line_left_up(
|
||||
size: 24.0,
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
),
|
||||
() {}),
|
||||
_buildButton(
|
||||
context,
|
||||
'Show in Chat',
|
||||
StreamSvgIcon.eye(
|
||||
size: 24.0,
|
||||
color: Colors.black,
|
||||
), () {
|
||||
Navigator.pop(context);
|
||||
Navigator.pop(context);
|
||||
}),
|
||||
_buildButton(
|
||||
context,
|
||||
'Save ${urls[currentIndex].type == 'video' ? 'Video' : 'Image'}',
|
||||
StreamIcons.save_1, () async {
|
||||
StreamSvgIcon.Icon_save(
|
||||
size: 24.0,
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
), () async {
|
||||
var url = urls[currentIndex].imageUrl ??
|
||||
urls[currentIndex].assetUrl ??
|
||||
urls[currentIndex].thumbUrl;
|
||||
@@ -135,8 +148,13 @@ class ImageActionsModal extends StatelessWidget {
|
||||
}
|
||||
}),
|
||||
if (StreamChat.of(context).user.id == message.user.id)
|
||||
_buildButton(context, 'Delete', StreamIcons.delete,
|
||||
() {
|
||||
_buildButton(
|
||||
context,
|
||||
'Delete',
|
||||
StreamSvgIcon.delete(
|
||||
size: 24.0,
|
||||
color: Colors.black,
|
||||
), () {
|
||||
Navigator.pop(context);
|
||||
Navigator.pop(context);
|
||||
StreamChat.of(context).client.deleteMessage(
|
||||
@@ -157,7 +175,7 @@ class ImageActionsModal extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildButton(
|
||||
context, String title, IconData iconData, VoidCallback onTap,
|
||||
context, String title, StreamSvgIcon icon, VoidCallback onTap,
|
||||
{Color color}) {
|
||||
var titleStyle = TextStyle(
|
||||
fontSize: 14.5,
|
||||
@@ -174,11 +192,7 @@ class ImageActionsModal extends StatelessWidget {
|
||||
style:
|
||||
color == null ? titleStyle : titleStyle.copyWith(color: color),
|
||||
),
|
||||
leading: Icon(
|
||||
iconData,
|
||||
color: color ?? StreamChatTheme.of(context).primaryIconTheme.color,
|
||||
size: 24.0,
|
||||
),
|
||||
leading: icon,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
+13
-24
@@ -12,7 +12,6 @@ import 'package:path_provider/path_provider.dart';
|
||||
import 'package:stream_chat/stream_chat.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_chat.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_icons.dart';
|
||||
import 'package:stream_chat_flutter/src/user_avatar.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
@@ -81,8 +80,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
StreamIcons.share_1,
|
||||
icon: StreamSvgIcon.icon_SHARE(
|
||||
size: 24.0,
|
||||
color: Colors.black,
|
||||
),
|
||||
@@ -111,8 +109,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
StreamIcons.grid,
|
||||
icon: StreamSvgIcon.Icon_grid(
|
||||
color: Colors.black,
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -160,8 +157,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
StreamIcons.close,
|
||||
icon: StreamSvgIcon.close(
|
||||
color: Colors.black,
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -446,13 +442,11 @@ class _ImageFooterState extends State<ImageFooter> {
|
||||
prefixIconConstraints:
|
||||
BoxConstraints.tight(Size(38.0, 38.0)),
|
||||
prefixIcon: Transform.scale(
|
||||
scale: 1.2,
|
||||
alignment: Alignment.center,
|
||||
child: Icon(
|
||||
StreamIcons.search,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
scale: 1.2,
|
||||
alignment: Alignment.center,
|
||||
child: StreamSvgIcon.search(
|
||||
color: Colors.black,
|
||||
)),
|
||||
hintText: 'Search',
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(32.0),
|
||||
@@ -472,8 +466,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
||||
width: 8.0,
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
StreamIcons.close_circle,
|
||||
icon: StreamSvgIcon.close_small(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
),
|
||||
onPressed: () {
|
||||
@@ -494,8 +487,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6.0),
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
StreamIcons.search,
|
||||
icon: StreamSvgIcon.search(
|
||||
color: Colors.black,
|
||||
),
|
||||
iconSize: 24.0,
|
||||
@@ -520,8 +512,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6.0),
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
StreamIcons.share,
|
||||
icon: StreamSvgIcon.search(
|
||||
color: Colors.black,
|
||||
),
|
||||
iconSize: 24.0,
|
||||
@@ -612,8 +603,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
||||
},
|
||||
child: Transform.rotate(
|
||||
angle: -pi / 2,
|
||||
child: Icon(
|
||||
StreamIcons.send_message,
|
||||
child: StreamSvgIcon.Icon_send_message(
|
||||
color: StreamChatTheme.of(context).accentColor,
|
||||
),
|
||||
),
|
||||
@@ -630,8 +620,7 @@ class _ImageFooterState extends State<ImageFooter> {
|
||||
child: Center(
|
||||
child: InkWell(
|
||||
onTap: () {},
|
||||
child: Icon(
|
||||
StreamIcons.send_message,
|
||||
child: StreamSvgIcon.Icon_send_message(
|
||||
color: Colors.grey,
|
||||
),
|
||||
)),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat/stream_chat.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_chat_theme.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_icons.dart';
|
||||
import 'package:stream_chat_flutter/src/stream_svg_icon.dart';
|
||||
import 'image_actions_modal.dart';
|
||||
import 'stream_channel.dart';
|
||||
|
||||
@@ -49,8 +49,7 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
elevation: 1,
|
||||
leading: showBackButton
|
||||
? IconButton(
|
||||
icon: Icon(
|
||||
StreamIcons.close,
|
||||
icon: StreamSvgIcon.close(
|
||||
color: Colors.black,
|
||||
size: 24.0,
|
||||
),
|
||||
@@ -61,10 +60,8 @@ class ImageHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
StreamChatTheme.of(context).channelTheme.channelHeaderTheme.color,
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
StreamIcons.menu_point_v,
|
||||
icon: StreamSvgIcon.Icon_menu_point_v(
|
||||
color: Colors.black,
|
||||
size: 24.0,
|
||||
),
|
||||
onPressed: () {
|
||||
_showMessageActionModalBottomSheet(context);
|
||||
|
||||
@@ -397,4 +397,76 @@ class StreamSvgIcon extends StatelessWidget {
|
||||
height: size,
|
||||
);
|
||||
}
|
||||
|
||||
factory StreamSvgIcon.Icon_curve_line_left_up({
|
||||
double size,
|
||||
Color color,
|
||||
}) {
|
||||
return StreamSvgIcon(
|
||||
assetName: 'Icon_curve_line_left_up.svg',
|
||||
color: color,
|
||||
width: size,
|
||||
height: size,
|
||||
);
|
||||
}
|
||||
|
||||
factory StreamSvgIcon.icon_SHARE({
|
||||
double size,
|
||||
Color color,
|
||||
}) {
|
||||
return StreamSvgIcon(
|
||||
assetName: 'icon_SHARE.svg',
|
||||
color: color,
|
||||
width: size,
|
||||
height: size,
|
||||
);
|
||||
}
|
||||
|
||||
factory StreamSvgIcon.Icon_grid({
|
||||
double size,
|
||||
Color color,
|
||||
}) {
|
||||
return StreamSvgIcon(
|
||||
assetName: 'Icon_grid.svg',
|
||||
color: color,
|
||||
width: size,
|
||||
height: size,
|
||||
);
|
||||
}
|
||||
|
||||
factory StreamSvgIcon.Icon_send_message({
|
||||
double size,
|
||||
Color color,
|
||||
}) {
|
||||
return StreamSvgIcon(
|
||||
assetName: 'Icon_send_message.svg',
|
||||
color: color,
|
||||
width: size,
|
||||
height: size,
|
||||
);
|
||||
}
|
||||
|
||||
factory StreamSvgIcon.Icon_menu_point_v({
|
||||
double size,
|
||||
Color color,
|
||||
}) {
|
||||
return StreamSvgIcon(
|
||||
assetName: 'Icon_menu_point_v.svg',
|
||||
color: color,
|
||||
width: size,
|
||||
height: size,
|
||||
);
|
||||
}
|
||||
|
||||
factory StreamSvgIcon.Icon_save({
|
||||
double size,
|
||||
Color color,
|
||||
}) {
|
||||
return StreamSvgIcon(
|
||||
assetName: 'Icon_save.svg',
|
||||
color: color,
|
||||
width: size,
|
||||
height: size,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<svg width="4" height="16" viewBox="0 0 4 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2 4C0.8954 4 0 3.10457 0 2C0 0.89543 0.8954 0 2 0C3.1046 0 4 0.89543 4 2C4 3.10457 3.1046 4 2 4Z" fill="black"/>
|
||||
<path d="M2 10C0.8954 10 0 9.1046 0 8C0 6.8954 0.8954 6 2 6C3.1046 6 4 6.8954 4 8C4 9.1046 3.1046 10 2 10Z" fill="black"/>
|
||||
<path d="M2 16C0.8954 16 0 15.1046 0 14C0 12.8954 0.8954 12 2 12C3.1046 12 4 12.8954 4 14C4 15.1046 3.1046 16 2 16Z" fill="black"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 479 B |
@@ -0,0 +1,4 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 4C11.4477 4 11 4.44771 11 5V14.529L6.78165 10.306C6.37408 9.89799 5.71326 9.89799 5.30568 10.306C4.8981 10.714 4.89811 11.3756 5.30568 11.7836L11.2096 17.694C11.4267 17.9114 11.7157 18.0129 12 17.9987C12.2843 18.0129 12.5733 17.9113 12.7905 17.694L18.6944 11.7836C19.1019 11.3756 19.1019 10.714 18.6944 10.306C18.2868 9.89799 17.626 9.89799 17.2184 10.306L13 14.529V5C13 4.44771 12.5523 4 12 4Z" fill="black"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 21C5 20.4477 5.44771 20 6 20H18C18.5523 20 19 20.4477 19 21C19 21.5523 18.5523 22 18 22H6C5.44772 22 5 21.5523 5 21Z" fill="black"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 752 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 12C22 6.48 17.52 2 12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12ZM8 11H12V8L16 12L12 16V13H8V11Z" fill="black"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 293 B |
Reference in New Issue
Block a user