Make some icons platform specific

This commit is contained in:
Vishnu Mohandas 2021-01-13 16:04:23 +05:30
parent 87ceb6ca0a
commit 3a88760540
4 changed files with 24 additions and 11 deletions

View file

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:like_button/like_button.dart';
@ -124,7 +126,9 @@ class _DetailPageState extends State<DetailPage> {
value: 1,
child: Row(
children: [
Icon(Icons.share),
Icon(Platform.isAndroid
? Icons.share_outlined
: CupertinoIcons.share),
Padding(
padding: EdgeInsets.all(8),
),
@ -136,7 +140,9 @@ class _DetailPageState extends State<DetailPage> {
value: 2,
child: Row(
children: [
Icon(Icons.info),
Icon(Platform.isAndroid
? Icons.info_outline
: CupertinoIcons.info),
Padding(
padding: EdgeInsets.all(8),
),
@ -148,7 +154,9 @@ class _DetailPageState extends State<DetailPage> {
value: 3,
child: Row(
children: [
Icon(Icons.delete),
Icon(Platform.isAndroid
? Icons.delete_outline
: CupertinoIcons.delete),
Padding(
padding: EdgeInsets.all(8),
),

View file

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
@ -92,7 +93,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
return AppBar(
leading: IconButton(
icon: Icon(Icons.close),
icon: Icon(Platform.isAndroid ? Icons.clear : CupertinoIcons.clear),
onPressed: () {
_clearSelectedFiles();
},
@ -162,13 +163,14 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
List<Widget> _getActions(BuildContext context) {
List<Widget> actions = List<Widget>();
actions.add(IconButton(
icon: Icon(Icons.add),
icon: Icon(Platform.isAndroid ? Icons.add_outlined : CupertinoIcons.add),
onPressed: () {
_createAlbum();
},
));
actions.add(IconButton(
icon: Icon(Icons.share),
icon: Icon(
Platform.isAndroid ? Icons.share_outlined : CupertinoIcons.share),
onPressed: () {
_shareSelected(context);
},
@ -176,7 +178,8 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
if (widget.type == GalleryAppBarType.homepage ||
widget.type == GalleryAppBarType.local_folder) {
actions.add(IconButton(
icon: Icon(Icons.delete),
icon: Icon(
Platform.isAndroid ? Icons.delete_outline : CupertinoIcons.delete),
onPressed: () {
_showDeleteSheet(context);
},
@ -189,7 +192,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
value: 1,
child: Row(
children: [
Icon(Icons.remove_circle),
Icon(Icons.remove_circle_outline_rounded),
Padding(
padding: EdgeInsets.all(8),
),
@ -201,7 +204,9 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
value: 2,
child: Row(
children: [
Icon(Icons.delete),
Icon(Platform.isAndroid
? Icons.delete_outline
: CupertinoIcons.delete),
Padding(
padding: EdgeInsets.all(8),
),

View file

@ -154,7 +154,7 @@ packages:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "1.0.0"
device_info:
dependency: transitive
description:

View file

@ -22,7 +22,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
cupertino_icons: ^1.0.0
photo_manager:
path: thirdparty/flutter_photo_manager
provider: ^3.1.0