diff --git a/.gitignore b/.gitignore index 1315784b..5cdb494a 100644 --- a/.gitignore +++ b/.gitignore @@ -115,7 +115,6 @@ xcuserdata/ **/xcshareddata/WorkspaceSettings.xcsettings .AppleDouble .LSOverride -Icon ._* .DocumentRevisions-V100 .fseventsd diff --git a/LICENSE-3RD-PARTY b/LICENSE-3RD-PARTY index 56c7b63c..25659cf2 100644 --- a/LICENSE-3RD-PARTY +++ b/LICENSE-3RD-PARTY @@ -7,6 +7,7 @@ Applies to: - material_switch.dart +- icon.dart Copyright 2014 The Flutter Authors. All rights reserved. @@ -66,8 +67,6 @@ This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL ---- - ## SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 PREAMBLE diff --git a/coverage/lcov.info b/coverage/lcov.info index 48c9e697..ef6d5bf9 100644 --- a/coverage/lcov.info +++ b/coverage/lcov.info @@ -65,39 +65,39 @@ DA:153,4 DA:155,1 DA:157,1 DA:158,1 -DA:161,2 -DA:168,1 +DA:159,2 +DA:166,1 +DA:167,1 DA:169,1 -DA:171,1 +DA:176,1 +DA:177,3 DA:178,1 -DA:179,3 -DA:180,1 -DA:182,2 +DA:180,2 LF:74 LH:53 end_of_record SF:lib/src/utils/rounded.dart -DA:9,5 -DA:19,9 -DA:20,9 +DA:9,7 +DA:19,12 +DA:20,12 DA:23,1 DA:24,3 DA:25,1 DA:27,1 DA:28,3 -DA:35,10 -DA:40,7 -DA:42,7 -DA:43,21 +DA:35,218 +DA:40,8 +DA:42,8 +DA:43,24 DA:50,5 DA:55,3 DA:57,3 DA:58,9 -DA:65,10 -DA:67,38 +DA:65,13 +DA:67,44 DA:68,12 -DA:71,6 -DA:74,30 +DA:71,8 +DA:74,41 LF:21 LH:21 end_of_record @@ -643,114 +643,110 @@ DA:61,0 DA:63,0 DA:64,0 DA:65,0 -DA:66,0 -DA:67,0 -DA:71,0 +DA:74,0 DA:81,0 -DA:88,0 +DA:82,0 +DA:83,0 +DA:84,0 +DA:85,0 +DA:86,0 +DA:87,0 DA:89,0 -DA:90,0 DA:91,0 -DA:92,0 -DA:93,0 -DA:94,0 +DA:95,0 DA:96,0 +DA:97,0 DA:98,0 +DA:100,0 DA:102,0 DA:103,0 -DA:104,0 -DA:105,0 +DA:106,0 DA:107,0 DA:109,0 DA:110,0 -DA:113,0 -DA:114,0 -DA:116,0 -DA:117,0 -DA:127,0 +DA:120,0 +DA:144,0 +DA:145,0 +DA:147,0 +DA:149,0 DA:151,0 DA:152,0 +DA:153,0 DA:154,0 -DA:156,0 -DA:158,0 -DA:159,0 -DA:160,0 -DA:161,0 +DA:155,0 DA:162,0 -DA:169,0 -DA:171,0 +DA:164,0 +DA:165,0 +DA:166,0 +DA:167,0 DA:172,0 -DA:173,0 DA:174,0 -DA:179,0 -DA:181,0 -DA:182,0 +DA:175,0 +DA:176,0 +DA:177,0 +DA:180,0 DA:183,0 DA:184,0 +DA:185,0 +DA:186,0 DA:187,0 +DA:188,0 DA:190,0 -DA:191,0 -DA:192,0 DA:193,0 DA:194,0 DA:195,0 -DA:197,0 -DA:200,0 -DA:201,0 -DA:202,0 -DA:210,0 +DA:203,0 +DA:204,0 +DA:205,0 +DA:207,0 +DA:208,0 DA:211,0 -DA:212,0 +DA:213,0 DA:214,0 DA:215,0 -DA:218,0 -DA:220,0 -DA:221,0 -DA:222,0 -DA:224,0 -DA:233,0 +DA:217,0 +DA:226,0 +DA:234,0 +DA:235,0 DA:241,0 -DA:242,0 +DA:243,0 +DA:244,0 +DA:246,0 +DA:247,0 DA:248,0 +DA:249,0 DA:250,0 DA:251,0 -DA:253,0 DA:254,0 DA:255,0 DA:256,0 DA:257,0 -DA:258,0 -DA:261,0 +DA:259,0 +DA:260,0 DA:262,0 DA:263,0 -DA:264,0 -DA:266,0 +DA:265,0 DA:267,0 +DA:268,0 DA:269,0 -DA:270,0 -DA:272,0 +DA:271,0 +DA:273,0 DA:274,0 -DA:275,0 -DA:276,0 DA:278,0 +DA:279,0 DA:280,0 -DA:281,0 +DA:282,0 DA:285,0 DA:286,0 -DA:287,0 -DA:289,0 -DA:292,0 -DA:293,0 +DA:290,0 +DA:291,0 DA:297,0 -DA:298,0 DA:301,0 +DA:302,0 +DA:303,0 DA:304,0 -DA:308,0 -DA:309,0 -DA:310,0 -DA:311,0 -DA:327,0 -LF:132 +DA:313,0 +LF:128 LH:0 end_of_record SF:lib/src/components/button_group/button_group.dart @@ -855,42 +851,41 @@ DA:314,0 DA:318,0 DA:320,0 DA:321,0 -DA:322,0 -DA:327,0 -DA:328,0 -DA:329,0 -DA:333,0 -DA:334,0 -DA:335,0 +DA:324,0 +DA:325,0 +DA:326,0 +DA:330,0 +DA:331,0 +DA:332,0 +DA:336,0 DA:339,0 +DA:340,0 DA:342,0 DA:343,0 -DA:345,0 +DA:344,0 DA:346,0 -DA:347,0 +DA:348,0 DA:349,0 -DA:351,0 -DA:352,0 -DA:353,0 -DA:357,0 -DA:358,0 -DA:364,0 -DA:366,0 +DA:350,0 +DA:354,0 +DA:355,0 +DA:361,0 +DA:363,0 +DA:367,0 +DA:368,0 +DA:369,0 DA:370,0 DA:371,0 DA:372,0 -DA:373,0 DA:374,0 DA:375,0 +DA:376,0 DA:377,0 -DA:378,0 -DA:379,0 -DA:380,0 -DA:386,0 +DA:383,0 +DA:389,0 +DA:391,0 DA:392,0 -DA:394,0 -DA:395,0 -LF:136 +LF:135 LH:0 end_of_record SF:lib/src/components/buttons/button.dart @@ -1049,28 +1044,24 @@ DA:105,0 DA:107,0 DA:108,0 DA:111,0 -DA:112,0 -DA:113,0 -DA:114,0 DA:115,0 -DA:120,0 +DA:116,0 +DA:117,0 +DA:119,0 DA:121,0 -DA:122,0 -DA:124,0 DA:126,0 -DA:131,0 +DA:127,0 +DA:128,0 +DA:130,0 DA:132,0 -DA:133,0 -DA:135,0 DA:137,0 +DA:139,0 +DA:141,0 DA:142,0 +DA:143,0 DA:144,0 -DA:146,0 -DA:147,0 -DA:148,0 -DA:149,0 -DA:150,0 -LF:37 +DA:145,0 +LF:33 LH:0 end_of_record SF:lib/src/components/buttons/input_icon_button.dart @@ -1322,32 +1313,32 @@ DA:194,1 DA:196,1 DA:198,1 DA:199,2 -DA:206,6 +DA:200,6 +DA:204,1 +DA:207,1 +DA:208,1 DA:210,1 +DA:211,1 +DA:212,3 DA:213,1 -DA:214,1 -DA:216,1 -DA:217,1 -DA:218,3 +DA:216,3 DA:219,1 -DA:222,3 -DA:225,1 -DA:226,2 -DA:233,2 -DA:234,1 -DA:235,1 -DA:237,3 -DA:244,1 -DA:245,4 -DA:246,4 +DA:220,2 +DA:227,2 +DA:228,1 +DA:229,1 +DA:231,3 +DA:238,1 +DA:239,4 +DA:240,4 +DA:241,1 +DA:242,3 DA:247,1 -DA:248,3 -DA:253,1 -DA:254,1 -DA:255,1 -DA:257,0 -DA:258,0 -DA:261,0 +DA:248,1 +DA:249,1 +DA:251,0 +DA:252,0 +DA:255,0 LF:88 LH:85 end_of_record @@ -1587,6 +1578,7 @@ DA:208,0 DA:209,0 DA:211,0 DA:213,0 +DA:214,0 DA:215,0 DA:216,0 DA:217,0 @@ -1597,33 +1589,31 @@ DA:221,0 DA:222,0 DA:223,0 DA:224,0 -DA:225,0 DA:226,0 +DA:227,0 DA:228,0 DA:229,0 DA:230,0 -DA:231,0 DA:232,0 -DA:234,0 -DA:235,0 -DA:240,0 -DA:241,0 +DA:233,0 +DA:238,0 +DA:239,0 +DA:243,0 +DA:244,0 DA:245,0 -DA:246,0 -DA:247,0 +DA:248,0 +DA:249,0 DA:250,0 -DA:251,0 DA:252,0 +DA:253,0 DA:254,0 DA:255,0 -DA:256,0 DA:257,0 DA:259,0 +DA:260,0 DA:261,0 DA:262,0 -DA:263,0 -DA:264,0 -LF:109 +LF:108 LH:0 end_of_record SF:lib/src/interfaces/form_field.dart @@ -2123,8 +2113,6 @@ DA:28,0 DA:30,0 DA:31,0 DA:33,0 -DA:34,0 -DA:35,0 DA:40,0 DA:41,0 DA:45,0 @@ -2135,7 +2123,7 @@ DA:56,0 DA:58,0 DA:60,0 DA:61,0 -LF:21 +LF:19 LH:0 end_of_record SF:lib/src/components/global_header/global_header.dart @@ -2244,6 +2232,48 @@ DA:77,0 LF:27 LH:0 end_of_record +SF:lib/src/components/icon/icon.dart +DA:17,210 +DA:190,9 +DA:192,9 +DA:193,18 +DA:194,9 +DA:195,9 +DA:196,9 +DA:197,9 +DA:198,9 +DA:199,9 +DA:200,9 +DA:201,9 +DA:202,9 +DA:203,9 +DA:204,9 +DA:208,1 +DA:210,1 +DA:212,3 +DA:213,3 +DA:214,3 +DA:215,3 +DA:216,3 +DA:217,3 +DA:218,3 +DA:219,3 +DA:220,3 +DA:221,3 +DA:222,3 +DA:223,3 +DA:229,7 +DA:230,7 +DA:231,7 +DA:233,7 +DA:234,7 +DA:235,7 +DA:240,9 +DA:241,18 +DA:242,14 +LF:38 +LH:38 +end_of_record SF:lib/src/components/in_page_banner/in_page_banner.dart DA:11,2 DA:44,1 @@ -2283,7 +2313,6 @@ DA:93,1 DA:97,1 DA:98,1 DA:99,1 -DA:100,1 DA:105,2 DA:112,1 DA:114,1 @@ -2297,8 +2326,8 @@ DA:128,1 DA:130,1 DA:132,1 DA:133,1 -LF:52 -LH:52 +LF:51 +LH:51 end_of_record SF:lib/src/components/list_item/dropdown_list_item.dart DA:10,0 @@ -2313,59 +2342,56 @@ DA:50,0 DA:51,0 DA:52,0 DA:62,0 -DA:63,0 -DA:66,0 -DA:68,0 +DA:64,0 +DA:65,0 DA:69,0 +DA:70,0 DA:73,0 DA:74,0 -DA:77,0 -DA:78,0 -DA:80,0 -DA:83,0 -DA:85,0 -DA:86,0 -DA:88,0 -DA:91,0 +DA:76,0 +DA:79,0 +DA:81,0 +DA:82,0 +DA:84,0 +DA:87,0 +DA:89,0 +DA:90,0 DA:93,0 DA:94,0 +DA:95,0 DA:97,0 DA:98,0 -DA:99,0 -DA:101,0 -DA:102,0 +DA:100,0 DA:104,0 +DA:106,0 DA:108,0 -DA:110,0 +DA:109,0 +DA:111,0 DA:112,0 -DA:113,0 DA:115,0 DA:116,0 +DA:117,0 +DA:118,0 DA:119,0 -DA:120,0 -DA:121,0 -DA:122,0 DA:123,0 +DA:124,0 +DA:125,0 +DA:126,0 DA:127,0 DA:128,0 DA:129,0 -DA:130,0 DA:131,0 DA:132,0 DA:133,0 DA:135,0 -DA:136,0 DA:137,0 -DA:139,0 DA:140,0 -DA:141,0 -DA:144,0 +DA:143,0 +DA:146,0 DA:147,0 -DA:150,0 -DA:151,0 -DA:152,0 -DA:153,0 -LF:64 +DA:148,0 +DA:149,0 +LF:61 LH:0 end_of_record SF:lib/src/components/list_item/list_scope.dart @@ -2791,74 +2817,72 @@ DA:192,0 DA:193,0 DA:194,0 DA:196,0 -DA:198,0 -DA:199,0 +DA:197,0 +DA:206,0 DA:208,0 +DA:209,0 DA:210,0 DA:211,0 -DA:212,0 DA:213,0 DA:215,0 -DA:216,0 -DA:218,0 +DA:217,0 +DA:219,0 DA:220,0 DA:222,0 -DA:223,0 +DA:224,0 DA:225,0 DA:227,0 DA:228,0 DA:230,0 DA:231,0 DA:233,0 -DA:234,0 DA:236,0 +DA:238,0 DA:239,0 DA:241,0 -DA:242,0 -DA:244,0 +DA:245,0 +DA:246,0 DA:248,0 -DA:249,0 -DA:251,0 -DA:260,0 +DA:257,0 +DA:271,0 +DA:273,0 DA:274,0 -DA:276,0 -DA:277,0 -DA:281,0 +DA:278,0 +DA:279,0 +DA:280,0 DA:282,0 DA:283,0 +DA:284,0 DA:285,0 DA:286,0 DA:287,0 -DA:288,0 -DA:289,0 DA:290,0 +DA:291,0 +DA:292,0 DA:293,0 -DA:294,0 -DA:295,0 -DA:296,0 -DA:300,0 +DA:297,0 +DA:303,0 +DA:305,0 DA:306,0 +DA:307,0 DA:308,0 DA:309,0 DA:310,0 DA:311,0 -DA:312,0 DA:313,0 DA:314,0 DA:316,0 -DA:317,0 DA:319,0 -DA:322,0 -DA:332,0 +DA:329,0 +DA:331,0 +DA:333,0 DA:334,0 +DA:335,0 DA:336,0 DA:337,0 -DA:338,0 -DA:339,0 -DA:340,0 -DA:345,24 -DA:347,0 -LF:143 +DA:342,25 +DA:344,0 +LF:141 LH:1 end_of_record SF:lib/src/components/password/password_input.dart @@ -2882,33 +2906,29 @@ DA:81,1 DA:83,1 DA:84,3 DA:87,1 -DA:88,2 DA:89,1 DA:91,1 -DA:95,1 -DA:97,1 -DA:99,1 +DA:92,2 +DA:94,2 +DA:95,2 +DA:96,2 +DA:97,2 +DA:98,2 +DA:99,2 DA:100,2 +DA:101,2 DA:102,2 -DA:103,2 -DA:104,2 +DA:103,1 +DA:104,1 DA:105,2 -DA:106,2 +DA:106,1 DA:107,2 DA:108,2 -DA:109,2 -DA:110,2 -DA:111,1 -DA:112,1 -DA:113,2 -DA:114,1 -DA:115,2 -DA:116,2 -LF:42 -LH:42 +LF:38 +LH:38 end_of_record SF:lib/src/components/phone_input/countries.dart -DA:4,24 +DA:4,25 DA:20,0 DA:22,0 DA:23,0 @@ -3128,19 +3148,19 @@ DA:294,0 DA:295,0 DA:297,0 DA:298,0 +DA:303,0 +DA:304,0 DA:305,0 DA:306,0 -DA:307,0 -DA:308,0 -DA:320,0 -DA:324,0 -DA:331,0 -DA:334,0 -DA:338,0 -DA:345,0 -DA:348,0 -DA:352,0 -DA:359,0 +DA:318,0 +DA:322,0 +DA:329,0 +DA:332,0 +DA:336,0 +DA:343,0 +DA:346,0 +DA:350,0 +DA:357,0 LF:146 LH:0 end_of_record @@ -3281,7 +3301,6 @@ DA:121,0 DA:122,0 DA:123,0 DA:127,0 -DA:128,0 DA:130,0 DA:146,0 DA:147,0 @@ -3305,7 +3324,7 @@ DA:198,0 DA:199,0 DA:201,0 DA:205,0 -LF:77 +LF:76 LH:0 end_of_record SF:lib/src/components/radio/radio.dart @@ -3414,7 +3433,6 @@ DA:28,0 DA:30,0 DA:31,0 DA:32,0 -DA:33,0 DA:35,0 DA:37,0 DA:39,0 @@ -3426,7 +3444,7 @@ DA:51,0 DA:53,0 DA:54,0 DA:55,0 -LF:19 +LF:18 LH:0 end_of_record SF:lib/src/components/search_bar/search_bar.dart @@ -3459,69 +3477,70 @@ DA:95,0 DA:98,0 DA:100,0 DA:101,0 -DA:102,0 +DA:103,0 DA:104,0 DA:105,0 DA:106,0 -DA:108,0 -DA:110,0 -DA:112,0 -DA:114,0 -DA:116,0 +DA:107,0 +DA:109,0 +DA:111,0 +DA:113,0 +DA:115,0 DA:117,0 DA:118,0 -DA:120,0 +DA:119,0 DA:121,0 -DA:123,0 -DA:125,0 -DA:134,0 +DA:122,0 +DA:124,0 +DA:126,0 DA:135,0 -DA:137,0 +DA:136,0 DA:138,0 DA:139,0 -DA:144,0 +DA:140,0 DA:145,0 DA:146,0 -DA:148,0 -DA:150,0 -DA:154,0 +DA:147,0 +DA:149,0 +DA:151,0 DA:155,0 -DA:157,0 +DA:156,0 DA:158,0 -DA:164,0 -DA:166,0 +DA:159,0 +DA:165,0 DA:167,0 -DA:172,0 -DA:174,0 +DA:168,0 +DA:173,0 DA:175,0 -DA:177,0 +DA:176,0 DA:178,0 -DA:181,0 -DA:195,0 +DA:179,0 +DA:182,0 DA:196,0 DA:197,0 DA:198,0 DA:199,0 -DA:204,0 -DA:205,0 +DA:200,0 DA:206,0 DA:207,0 -DA:210,0 -DA:211,0 +DA:208,0 +DA:209,0 DA:212,0 DA:213,0 -DA:216,0 -DA:220,0 -DA:221,0 +DA:214,0 +DA:215,0 +DA:218,0 DA:222,0 -DA:225,0 -DA:229,0 -DA:230,0 +DA:223,0 +DA:224,0 +DA:227,0 DA:231,0 -DA:234,0 -DA:235,0 +DA:232,0 +DA:233,0 DA:236,0 -LF:91 +DA:237,0 +DA:238,0 +LF:92 LH:0 end_of_record SF:lib/src/components/segmented_control/segmented_control.dart @@ -3788,71 +3807,68 @@ DA:74,0 DA:75,0 DA:85,0 DA:87,0 -DA:88,0 DA:89,0 +DA:90,0 +DA:92,0 +DA:93,0 DA:96,0 DA:98,0 DA:99,0 DA:101,0 -DA:102,0 +DA:104,0 DA:105,0 -DA:107,0 -DA:108,0 +DA:106,0 +DA:109,0 DA:110,0 -DA:113,0 +DA:111,0 +DA:112,0 DA:114,0 -DA:115,0 +DA:117,0 DA:118,0 DA:119,0 -DA:120,0 -DA:121,0 +DA:122,0 DA:123,0 -DA:126,0 +DA:124,0 +DA:125,0 DA:127,0 -DA:128,0 -DA:131,0 +DA:130,0 DA:132,0 -DA:133,0 -DA:134,0 +DA:135,0 DA:136,0 -DA:139,0 -DA:141,0 -DA:144,0 +DA:137,0 +DA:138,0 +DA:140,0 +DA:142,0 DA:145,0 DA:146,0 DA:147,0 DA:149,0 +DA:150,0 DA:151,0 +DA:153,0 DA:154,0 DA:155,0 DA:156,0 +DA:157,0 DA:158,0 DA:159,0 DA:160,0 DA:162,0 DA:163,0 -DA:164,0 DA:165,0 -DA:166,0 -DA:167,0 -DA:168,0 -DA:169,0 +DA:170,0 DA:171,0 DA:172,0 +DA:173,0 DA:174,0 +DA:175,0 +DA:176,0 +DA:177,0 +DA:178,0 DA:179,0 DA:180,0 DA:181,0 -DA:182,0 -DA:183,0 -DA:184,0 -DA:185,0 -DA:186,0 -DA:187,0 -DA:188,0 -DA:189,0 -DA:190,0 -LF:80 +LF:77 LH:0 end_of_record SF:lib/src/components/slider/slider.dart @@ -3910,14 +3926,14 @@ LF:50 LH:0 end_of_record SF:lib/src/zeta.dart -DA:15,17 +DA:15,18 DA:44,14 DA:45,28 DA:46,58 DA:47,4 DA:48,2 DA:50,4 -DA:55,30 +DA:55,39 DA:62,2 DA:63,4 DA:64,2 @@ -3927,8 +3943,8 @@ DA:74,6 DA:75,6 DA:76,3 DA:77,3 -DA:84,15 -DA:85,15 +DA:84,16 +DA:85,16 DA:89,1 DA:90,1 DA:91,1 @@ -4052,49 +4068,48 @@ DA:294,0 DA:295,0 DA:300,0 DA:301,0 -DA:303,0 -DA:312,0 +DA:308,0 +DA:318,0 +DA:320,0 DA:322,0 +DA:323,0 DA:324,0 -DA:326,0 DA:327,0 -DA:328,0 +DA:329,0 DA:331,0 -DA:333,0 -DA:335,0 -DA:336,0 +DA:332,0 +DA:341,0 +DA:342,0 +DA:343,0 +DA:344,0 DA:345,0 -DA:346,0 -DA:347,0 -DA:348,0 -DA:349,0 -DA:359,0 -DA:364,0 +DA:355,0 +DA:360,0 +DA:362,0 +DA:363,0 DA:366,0 -DA:367,0 +DA:368,0 +DA:369,0 DA:370,0 +DA:371,0 DA:372,0 DA:373,0 -DA:374,0 -DA:375,0 -DA:376,0 DA:377,0 +DA:379,0 +DA:380,0 DA:381,0 +DA:382,0 DA:383,0 DA:384,0 -DA:385,0 -DA:386,0 -DA:387,0 -DA:388,0 +DA:389,0 +DA:391,0 DA:393,0 +DA:394,0 DA:395,0 +DA:396,0 DA:397,0 -DA:398,0 DA:399,0 -DA:400,0 -DA:401,0 -DA:403,0 -LF:143 +LF:142 LH:0 end_of_record SF:lib/src/components/stepper/stepper.dart @@ -4145,7 +4160,6 @@ DA:128,0 DA:130,0 DA:131,0 DA:132,0 -DA:133,0 DA:134,0 DA:136,0 DA:137,0 @@ -4253,7 +4267,7 @@ DA:352,0 DA:353,0 DA:356,0 DA:376,0 -LF:155 +LF:154 LH:0 end_of_record SF:lib/src/components/stepper_input/stepper_input.dart @@ -4301,39 +4315,37 @@ DA:123,0 DA:124,0 DA:128,0 DA:129,0 -DA:131,0 -DA:140,0 +DA:132,0 +DA:133,0 +DA:134,0 +DA:139,0 DA:141,0 DA:142,0 DA:143,0 +DA:145,0 +DA:147,0 +DA:148,0 DA:149,0 DA:151,0 -DA:152,0 DA:153,0 +DA:154,0 DA:155,0 DA:157,0 DA:158,0 DA:159,0 DA:161,0 +DA:162,0 DA:163,0 -DA:164,0 -DA:165,0 -DA:167,0 +DA:166,0 DA:168,0 -DA:169,0 +DA:170,0 DA:171,0 DA:172,0 DA:173,0 -DA:176,0 +DA:174,0 DA:178,0 -DA:180,0 -DA:181,0 -DA:182,0 -DA:183,0 -DA:184,0 -DA:188,0 -DA:189,0 -LF:76 +DA:179,0 +LF:74 LH:0 end_of_record SF:lib/src/components/switch/material_switch.dart @@ -5192,20 +5204,18 @@ DA:446,1 DA:447,1 DA:448,1 DA:449,1 -DA:450,1 -DA:453,0 -DA:462,1 -DA:463,1 -DA:465,1 -DA:470,1 +DA:456,1 +DA:457,1 +DA:459,1 +DA:464,1 +DA:467,0 +DA:469,0 +DA:471,0 +DA:472,0 DA:473,0 -DA:475,0 -DA:477,0 -DA:478,0 -DA:479,0 -DA:480,0 -LF:192 -LH:103 +DA:474,0 +LF:190 +LH:102 end_of_record SF:lib/src/components/time_input/time_input.dart DA:19,0 @@ -5285,9 +5295,10 @@ DA:208,0 DA:209,0 DA:211,0 DA:213,0 +DA:214,0 DA:215,0 -DA:216,0 DA:217,0 +DA:218,0 DA:219,0 DA:220,0 DA:221,0 @@ -5298,31 +5309,29 @@ DA:225,0 DA:226,0 DA:227,0 DA:228,0 -DA:229,0 DA:230,0 DA:232,0 +DA:233,0 DA:234,0 -DA:235,0 DA:236,0 -DA:238,0 -DA:241,0 -DA:242,0 +DA:239,0 +DA:240,0 +DA:244,0 +DA:245,0 DA:246,0 -DA:247,0 -DA:248,0 +DA:249,0 +DA:250,0 DA:251,0 -DA:252,0 DA:253,0 +DA:254,0 DA:255,0 DA:256,0 -DA:257,0 DA:258,0 DA:260,0 +DA:261,0 DA:262,0 DA:263,0 -DA:264,0 -DA:265,0 -LF:114 +LF:113 LH:0 end_of_record SF:lib/src/components/tooltip/tooltip.dart @@ -5666,8 +5675,8 @@ DA:63,1 DA:64,1 DA:65,1 DA:66,7 -DA:75,50 -DA:78,51 +DA:75,53 +DA:78,54 DA:81,3 DA:94,1 DA:96,1 @@ -5727,16 +5736,16 @@ LF:76 LH:76 end_of_record SF:lib/src/theme/color_swatch.dart -DA:15,45 -DA:20,21 +DA:15,47 +DA:20,22 DA:32,3 DA:45,3 DA:48,3 DA:49,3 DA:50,3 -DA:67,22 -DA:68,86 -DA:71,42 +DA:67,23 +DA:68,90 +DA:71,44 DA:74,18 DA:77,16 DA:80,16 @@ -5744,9 +5753,9 @@ DA:83,22 DA:86,16 DA:89,20 DA:92,16 -DA:95,44 +DA:95,46 DA:98,14 -DA:106,34 +DA:106,36 DA:112,4 DA:118,16 DA:124,8 @@ -5755,13 +5764,13 @@ DA:136,4 DA:142,20 DA:148,4 DA:153,8 -DA:165,22 -DA:169,88 -DA:172,80 -DA:175,100 -DA:178,63 -DA:181,20 -DA:184,40 +DA:165,23 +DA:169,92 +DA:172,84 +DA:175,105 +DA:178,66 +DA:181,21 +DA:184,42 DA:189,7 DA:190,7 DA:191,7 @@ -5781,8 +5790,8 @@ LF:50 LH:50 end_of_record SF:lib/src/theme/contrast.dart -DA:18,21 -DA:20,21 +DA:18,22 +DA:20,22 DA:22,5 DA:31,2 DA:33,2 @@ -5815,59 +5824,59 @@ LF:30 LH:30 end_of_record SF:lib/src/theme/color_scheme.dart -DA:29,17 -DA:95,17 -DA:151,17 -DA:152,16 -DA:153,16 -DA:154,17 -DA:155,16 -DA:156,16 -DA:157,17 -DA:158,17 -DA:159,17 -DA:160,17 -DA:161,17 -DA:162,17 -DA:163,17 -DA:164,17 -DA:165,17 -DA:166,17 -DA:167,17 -DA:168,17 -DA:169,17 -DA:170,17 -DA:171,17 -DA:172,17 -DA:173,17 -DA:174,17 -DA:175,17 -DA:176,17 -DA:177,17 -DA:178,17 -DA:179,17 -DA:180,17 -DA:181,17 -DA:182,17 -DA:183,17 -DA:184,17 -DA:185,17 -DA:186,17 -DA:187,17 -DA:188,17 -DA:189,17 -DA:190,17 -DA:191,17 -DA:192,17 -DA:193,17 -DA:194,17 -DA:195,17 -DA:196,17 +DA:29,18 +DA:95,18 +DA:151,18 +DA:152,17 +DA:153,17 +DA:154,18 +DA:155,17 +DA:156,17 +DA:157,18 +DA:158,18 +DA:159,18 +DA:160,18 +DA:161,18 +DA:162,18 +DA:163,18 +DA:164,18 +DA:165,18 +DA:166,18 +DA:167,18 +DA:168,18 +DA:169,18 +DA:170,18 +DA:171,18 +DA:172,18 +DA:173,18 +DA:174,18 +DA:175,18 +DA:176,18 +DA:177,18 +DA:178,18 +DA:179,18 +DA:180,18 +DA:181,18 +DA:182,18 +DA:183,18 +DA:184,18 +DA:185,18 +DA:186,18 +DA:187,18 +DA:188,18 +DA:189,18 +DA:190,18 +DA:191,18 +DA:192,18 +DA:193,18 +DA:194,18 +DA:195,18 +DA:196,18 DA:200,1 DA:202,1 DA:204,3 DA:205,3 -DA:208,16 +DA:208,17 DA:211,1 DA:212,1 DA:213,3 @@ -5879,31 +5888,31 @@ LF:60 LH:60 end_of_record SF:lib/src/theme/colors.dart -DA:16,21 -DA:34,21 -DA:35,21 -DA:36,21 -DA:37,21 -DA:38,21 -DA:39,21 -DA:42,21 -DA:48,21 -DA:50,20 -DA:56,20 -DA:57,21 -DA:58,21 -DA:59,21 -DA:60,21 -DA:61,21 -DA:62,21 -DA:63,21 -DA:64,21 -DA:78,19 -DA:91,19 +DA:16,22 +DA:34,22 +DA:35,22 +DA:36,22 +DA:37,22 +DA:38,22 +DA:39,22 +DA:42,22 +DA:48,22 +DA:50,21 +DA:56,21 +DA:57,22 +DA:58,22 +DA:59,22 +DA:60,22 +DA:61,22 +DA:62,22 +DA:63,22 +DA:64,22 +DA:78,20 +DA:91,20 DA:100,1 DA:101,1 -DA:118,19 -DA:131,19 +DA:118,20 +DA:131,20 DA:141,1 DA:142,1 DA:148,1 @@ -5921,7 +5930,7 @@ DA:169,1 DA:172,1 DA:176,1 DA:180,1 -DA:276,48 +DA:276,51 DA:285,6 DA:292,6 DA:301,6 @@ -5977,10 +5986,10 @@ DA:592,1 DA:593,1 DA:594,1 DA:595,1 -DA:599,21 -DA:607,21 -DA:611,21 -DA:617,21 +DA:599,22 +DA:607,22 +DA:611,22 +DA:617,22 DA:623,3 DA:640,3 DA:641,3 @@ -5996,20 +6005,20 @@ DA:650,3 DA:651,3 DA:652,3 DA:653,8 -DA:660,19 -DA:663,38 +DA:660,20 +DA:663,40 DA:664,3 -DA:670,16 -DA:671,64 -DA:672,64 -DA:673,16 -DA:674,16 -DA:676,16 -DA:678,16 -DA:680,16 -DA:681,16 -DA:682,16 -DA:683,16 +DA:670,17 +DA:671,68 +DA:672,68 +DA:673,17 +DA:674,17 +DA:676,17 +DA:678,17 +DA:680,17 +DA:681,17 +DA:682,17 +DA:683,17 DA:690,5 DA:691,5 DA:692,5 @@ -6126,26 +6135,26 @@ LF:243 LH:243 end_of_record SF:lib/src/theme/theme_data.dart -DA:22,18 +DA:22,19 DA:32,1 DA:34,1 DA:35,1 -DA:37,18 -DA:38,18 +DA:37,19 +DA:38,19 DA:40,1 DA:42,1 DA:43,1 -DA:45,18 -DA:46,18 -DA:65,36 -DA:72,36 -DA:82,17 -DA:85,17 -DA:87,17 -DA:88,17 -DA:89,17 -DA:90,17 -DA:91,17 +DA:45,19 +DA:46,19 +DA:65,38 +DA:72,38 +DA:82,18 +DA:85,18 +DA:87,18 +DA:88,18 +DA:89,18 +DA:90,18 +DA:91,18 DA:95,3 DA:96,3 DA:97,3 @@ -6218,10 +6227,10 @@ LF:46 LH:46 end_of_record SF:lib/src/zeta_provider.dart -DA:21,16 +DA:21,17 DA:28,1 -DA:58,16 -DA:59,16 +DA:58,17 +DA:59,17 DA:61,1 DA:63,1 DA:65,3 @@ -6240,16 +6249,16 @@ DA:85,1 DA:86,2 DA:87,1 DA:88,1 -DA:126,16 -DA:128,16 -DA:129,32 -DA:132,96 -DA:135,48 -DA:138,48 -DA:141,80 -DA:147,16 -DA:149,32 -DA:150,16 +DA:126,17 +DA:128,17 +DA:129,34 +DA:132,102 +DA:135,51 +DA:138,51 +DA:141,85 +DA:147,17 +DA:149,34 +DA:150,17 DA:157,1 DA:159,1 DA:162,1 @@ -6260,13 +6269,13 @@ DA:176,3 DA:178,4 DA:180,2 DA:182,2 -DA:189,16 -DA:191,16 -DA:192,16 -DA:193,16 -DA:194,16 -DA:195,16 -DA:196,80 +DA:189,17 +DA:191,17 +DA:192,17 +DA:193,17 +DA:194,17 +DA:195,17 +DA:196,85 DA:200,1 DA:202,1 DA:203,4 diff --git a/lib/src/components/accordion/accordion.dart b/lib/src/components/accordion/accordion.dart index b3859fc8..8be557e0 100644 --- a/lib/src/components/accordion/accordion.dart +++ b/lib/src/components/accordion/accordion.dart @@ -154,10 +154,8 @@ class _ZetaAccordionState extends State with TickerProviderStateM ), Padding( padding: const EdgeInsets.only(left: ZetaSpacing.large), - child: Icon( - _isOpen - ? (rounded ? ZetaIcons.remove_round : ZetaIcons.remove_sharp) - : (rounded ? ZetaIcons.add_round : ZetaIcons.add_sharp), + child: ZetaIcon( + _isOpen ? ZetaIcons.remove : ZetaIcons.add, color: _disabled ? zetaColors.iconDisabled : zetaColors.iconDefault, ), ), diff --git a/lib/src/components/avatars/avatar.dart b/lib/src/components/avatars/avatar.dart index f1afb3ac..50a6a967 100644 --- a/lib/src/components/avatars/avatar.dart +++ b/lib/src/components/avatars/avatar.dart @@ -314,7 +314,7 @@ extension on ZetaAvatarSize { /// Enum of types for [ZetaAvatarBadge] enum ZetaAvatarBadgeType { - /// Shows an icon on [ZetaAvatarBadge]. Defaults to [ZetaIcons.star_round]. + /// Shows an icon on [ZetaAvatarBadge]. Defaults to [ZetaIcons.star]. icon, /// Shows a number on [ZetaAvatarBadge] from provided [ZetaAvatarBadge.value]. @@ -349,7 +349,7 @@ class ZetaAvatarBadge extends StatelessWidget { const ZetaAvatarBadge.icon({ super.key, this.color, - this.icon = ZetaIcons.star_round, + this.icon = ZetaIcons.star, this.iconColor, this.size = ZetaAvatarSize.xxxl, }) : value = null, @@ -431,7 +431,7 @@ class ZetaAvatarBadge extends StatelessWidget { ), ) : icon != null - ? Icon( + ? ZetaIcon( icon, size: badgeSize - borderSize, color: iconColor ?? backgroundColor.onColor, diff --git a/lib/src/components/badges/indicator.dart b/lib/src/components/badges/indicator.dart index af510a26..12d9d029 100644 --- a/lib/src/components/badges/indicator.dart +++ b/lib/src/components/badges/indicator.dart @@ -4,7 +4,7 @@ import '../../../zeta_flutter.dart'; /// [ZetaIndicator] type. enum ZetaIndicatorType { - /// Shows an icon on [ZetaIndicator]. Defaults to [ZetaIcons.star_round]. + /// Shows an icon on [ZetaIndicator]. Defaults to [ZetaIcons.star]. icon, /// Shows a number on [ZetaIndicator] from provided [ZetaIndicator.value]. @@ -65,7 +65,7 @@ class ZetaIndicator extends ZetaStatelessWidget { /// Defaults to false. final bool inverse; - /// Indicator icon, default: `ZetaIcons.star_round`. + /// Indicator icon, default: `ZetaIcons.star`. final IconData? icon; /// Value for the type `notification`. @@ -138,8 +138,8 @@ class ZetaIndicator extends ZetaStatelessWidget { case ZetaIndicatorType.icon: final iconSize = _getIconSize(size); return Center( - child: Icon( - icon ?? ZetaIcons.star_round, + child: ZetaIcon( + icon ?? ZetaIcons.star, color: foregroundColor, size: iconSize, ), diff --git a/lib/src/components/badges/status_label.dart b/lib/src/components/badges/status_label.dart index 346f7137..97a61781 100644 --- a/lib/src/components/badges/status_label.dart +++ b/lib/src/components/badges/status_label.dart @@ -40,7 +40,7 @@ class ZetaStatusLabel extends ZetaStatelessWidget { child: Row( mainAxisSize: MainAxisSize.min, children: [ - Icon( + ZetaIcon( customIcon ?? Icons.circle, size: customIcon != null ? ZetaSpacing.xl_1 : ZetaSpacing.small, color: colors.icon, diff --git a/lib/src/components/banner/banner.dart b/lib/src/components/banner/banner.dart index f092ae72..af2ec7f4 100644 --- a/lib/src/components/banner/banner.dart +++ b/lib/src/components/banner/banner.dart @@ -75,7 +75,7 @@ class ZetaBanner extends MaterialBanner { if (leadingIcon != null) Padding( padding: const EdgeInsets.only(right: ZetaSpacing.small), - child: Icon( + child: ZetaIcon( leadingIcon, color: foregroundColor, size: ZetaSpacing.xl_2, diff --git a/lib/src/components/bottom sheets/bottom_sheet.dart b/lib/src/components/bottom sheets/bottom_sheet.dart index 6b54e629..be7b0b74 100644 --- a/lib/src/components/bottom sheets/bottom_sheet.dart +++ b/lib/src/components/bottom sheets/bottom_sheet.dart @@ -53,8 +53,8 @@ class ZetaBottomSheet extends ZetaStatelessWidget { height: ZetaSpacing.xl_5, child: Padding( padding: const EdgeInsets.only(top: ZetaSpacing.small), - child: Icon( - Icons.maximize_rounded, + child: ZetaIcon( + Icons.maximize, size: ZetaSpacing.xl_9, color: colors.surfaceDisabled, ), diff --git a/lib/src/components/bottom sheets/menu_items.dart b/lib/src/components/bottom sheets/menu_items.dart index 7d9ecec4..31f1273e 100644 --- a/lib/src/components/bottom sheets/menu_items.dart +++ b/lib/src/components/bottom sheets/menu_items.dart @@ -111,7 +111,7 @@ class ZetaMenuItem extends ZetaStatelessWidget { if (trailing != null) IconTheme( data: _iconThemeData(colors, _enabled, ZetaSpacing.xl_2), - child: trailing ?? const Icon(Icons.keyboard_arrow_right), + child: trailing!, ), ], ), diff --git a/lib/src/components/breadcrumbs/breadcrumbs.dart b/lib/src/components/breadcrumbs/breadcrumbs.dart index 93ab54aa..a7d33afe 100644 --- a/lib/src/components/breadcrumbs/breadcrumbs.dart +++ b/lib/src/components/breadcrumbs/breadcrumbs.dart @@ -63,18 +63,11 @@ class _ZetaBreadCrumbsState extends State { child: Row( children: renderedChildren(widget.children) .divide( - Row( + const Row( children: [ - const SizedBox( - width: ZetaSpacing.small, - ), - Icon( - rounded ? ZetaIcons.chevron_right_round : ZetaIcons.chevron_right_sharp, - size: ZetaSpacing.xl_1, - ), - const SizedBox( - width: ZetaSpacing.small, - ), + SizedBox(width: ZetaSpacing.small), + ZetaIcon(ZetaIcons.chevron_right, size: ZetaSpacing.xl_1), + SizedBox(width: ZetaSpacing.small), ], ), ) @@ -190,8 +183,8 @@ class _ZetaBreadCrumbState extends State { child: Row( children: [ if (widget.isSelected) - Icon( - widget.activeIcon ?? ZetaIcons.star_round, + ZetaIcon( + widget.activeIcon ?? ZetaIcons.star, color: getColor(controller.value, colors), ), const SizedBox( @@ -298,8 +291,8 @@ class _BreadCrumbsTruncatedState extends State { minimumSize: WidgetStateProperty.all(Size.zero), elevation: const WidgetStatePropertyAll(ZetaSpacing.none), ), - child: Icon( - rounded ? ZetaIcons.more_horizontal_round : ZetaIcons.more_horizontal_sharp, + child: const ZetaIcon( + ZetaIcons.more_horizontal, size: ZetaSpacing.large, ).paddingHorizontal(ZetaSpacing.small).paddingVertical(ZetaSpacing.minimum), ); @@ -311,16 +304,9 @@ class _BreadCrumbsTruncatedState extends State { .divide( const Row( children: [ - SizedBox( - width: ZetaSpacing.small, - ), - Icon( - ZetaIcons.chevron_right_round, - size: ZetaSpacing.xl_1, - ), - SizedBox( - width: ZetaSpacing.small, - ), + SizedBox(width: ZetaSpacing.small), + ZetaIcon(ZetaIcons.chevron_right, size: ZetaSpacing.xl_1), + SizedBox(width: ZetaSpacing.small), ], ), ) diff --git a/lib/src/components/button_group/button_group.dart b/lib/src/components/button_group/button_group.dart index f9849cf8..b8988466 100644 --- a/lib/src/components/button_group/button_group.dart +++ b/lib/src/components/button_group/button_group.dart @@ -302,9 +302,9 @@ class _ZetaGroupButtonState extends State { late final IconData dropdownIcon; if (!dropdownOpen || onPressed == null) { - dropdownIcon = rounded ? ZetaIcons.expand_more_round : ZetaIcons.expand_more_sharp; + dropdownIcon = ZetaIcons.expand_more; } else { - dropdownIcon = rounded ? ZetaIcons.expand_less_round : ZetaIcons.expand_less_sharp; + dropdownIcon = ZetaIcons.expand_less; } const iconSize = ZetaSpacing.xl_1; @@ -318,10 +318,7 @@ class _ZetaGroupButtonState extends State { child: selectedItem!.icon!, ); } else if (selectedItem == null && widget.icon != null) { - leadingIcon = Icon( - widget.icon, - size: iconSize, - ); + leadingIcon = ZetaIcon(widget.icon, size: iconSize); } return Container( @@ -350,7 +347,7 @@ class _ZetaGroupButtonState extends State { leadingIcon ?? const SizedBox(), Text(selectedItem?.label ?? widget.label ?? '', style: ZetaTextStyles.labelMedium), if (widget.items != null) - Icon( + ZetaIcon( dropdownIcon, size: ZetaSpacing.xl_1, ), diff --git a/lib/src/components/buttons/button.dart b/lib/src/components/buttons/button.dart index 45c553c8..d2d42638 100644 --- a/lib/src/components/buttons/button.dart +++ b/lib/src/components/buttons/button.dart @@ -171,7 +171,7 @@ class ZetaButton extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ if (leadingIcon != null) - Icon( + ZetaIcon( leadingIcon, size: _iconSize, ), @@ -181,7 +181,7 @@ class ZetaButton extends StatelessWidget { style: _textStyle, ), if (trailingIcon != null) - Icon( + ZetaIcon( trailingIcon, size: _iconSize, ), diff --git a/lib/src/components/buttons/icon_button.dart b/lib/src/components/buttons/icon_button.dart index 137da668..852ebd96 100644 --- a/lib/src/components/buttons/icon_button.dart +++ b/lib/src/components/buttons/icon_button.dart @@ -12,7 +12,7 @@ class ZetaIconButton extends ZetaStatelessWidget { this.borderType, this.type = ZetaButtonType.primary, this.size = ZetaWidgetSize.medium, - this.icon = ZetaIcons.more_horizontal_round, + this.icon = ZetaIcons.more_horizontal, }); /// Constructs [ZetaIconButton] with Primary theme. @@ -108,12 +108,7 @@ class ZetaIconButton extends ZetaStatelessWidget { type, null, ), - child: SelectionContainer.disabled( - child: Icon( - icon, - size: _iconSize, - ).paddingAll(_iconPadding), - ), + child: SelectionContainer.disabled(child: ZetaIcon(icon, size: _iconSize).paddingAll(_iconPadding)), ); } diff --git a/lib/src/components/buttons/input_icon_button.dart b/lib/src/components/buttons/input_icon_button.dart index b7ffc928..515e0566 100644 --- a/lib/src/components/buttons/input_icon_button.dart +++ b/lib/src/components/buttons/input_icon_button.dart @@ -58,7 +58,7 @@ class InputIconButton extends StatelessWidget { color: !disabled ? color : colors.iconDisabled, onPressed: disabled ? null : onTap, iconSize: _iconSize, - icon: Icon(icon), + icon: ZetaIcon(icon), ); } diff --git a/lib/src/components/chat_item/chat_item.dart b/lib/src/components/chat_item/chat_item.dart index b1597fc7..c3dcc126 100644 --- a/lib/src/components/chat_item/chat_item.dart +++ b/lib/src/components/chat_item/chat_item.dart @@ -122,21 +122,21 @@ class ZetaChatItem extends ZetaStatelessWidget { if (onMenuMoreTap != null) { actions.add( - ZetaSlidableAction(onPressed: onMenuMoreTap, color: colors.purple, icon: ZetaIcons.more_vertical_round), + ZetaSlidableAction(onPressed: onMenuMoreTap, color: colors.purple, icon: ZetaIcons.more_vertical), ); } if (onCallTap != null) { actions.add( - ZetaSlidableAction(onPressed: onCallTap, color: colors.green, icon: Icons.call), + ZetaSlidableAction(onPressed: onCallTap, color: colors.green, icon: ZetaIcons.phone), ); } if (onPttTap != null) { actions.add( - ZetaSlidableAction(onPressed: onPttTap, color: colors.blue, icon: ZetaIcons.ptt_round), + ZetaSlidableAction(onPressed: onPttTap, color: colors.blue, icon: ZetaIcons.ptt), ); } if (onDeleteTap != null) { - actions.add(ZetaSlidableAction(onPressed: onDeleteTap, color: colors.red, icon: ZetaIcons.delete_round)); + actions.add(ZetaSlidableAction(onPressed: onDeleteTap, color: colors.red, icon: ZetaIcons.delete)); } return ZetaRoundedScope( @@ -217,8 +217,8 @@ class ZetaChatItem extends ZetaStatelessWidget { padding: const EdgeInsets.only( left: ZetaSpacing.minimum, ), - child: Icon( - ZetaIcons.error_round, + child: ZetaIcon( + ZetaIcons.error, color: colors.cool.shade70, ), ), @@ -280,8 +280,8 @@ class ZetaChatItem extends ZetaStatelessWidget { padding: const EdgeInsets.only( left: ZetaSpacing.minimum, ), - child: Icon( - starred! ? ZetaIcons.star_sharp : ZetaIcons.star_outline_sharp, + child: ZetaIcon( + starred! ? ZetaIcons.star : ZetaIcons.star_outline, color: starred! ? colors.yellow.shade60 : null, ), ), @@ -458,7 +458,7 @@ class ZetaSlidableAction extends StatelessWidget { shape: const RoundedRectangleBorder(borderRadius: ZetaRadius.minimal), side: BorderSide.none, ), - icon: Icon(icon, size: ZetaSpacing.xl_4), + icon: ZetaIcon(icon, size: ZetaSpacing.xl_4), ), ), ), diff --git a/lib/src/components/checkbox/checkbox.dart b/lib/src/components/checkbox/checkbox.dart index d77e71a2..af9eb6bf 100644 --- a/lib/src/components/checkbox/checkbox.dart +++ b/lib/src/components/checkbox/checkbox.dart @@ -195,15 +195,9 @@ class _CheckboxState extends State { final icon = !_checked ? const SizedBox.shrink() - : Icon( - !widget.useIndeterminate - ? rounded - ? ZetaIcons.check_mark_round - : ZetaIcons.check_mark_sharp - : rounded - ? ZetaIcons.remove_round - : ZetaIcons.remove_sharp, - color: !widget.disabled ? theme.colors.white : theme.colors.iconDisabled, + : ZetaIcon( + widget.useIndeterminate ? ZetaIcons.remove : ZetaIcons.check_mark, + color: widget.disabled ? theme.colors.iconDisabled : theme.colors.white, size: ZetaSpacingBase.x3_5, ); diff --git a/lib/src/components/chips/chip.dart b/lib/src/components/chips/chip.dart index 86cce2db..71f636c3 100644 --- a/lib/src/components/chips/chip.dart +++ b/lib/src/components/chips/chip.dart @@ -187,8 +187,8 @@ class _ZetaChipState extends State { duration: Durations.short1, width: iconSize, child: (selected - ? Icon( - rounded ? ZetaIcons.check_mark_round : ZetaIcons.check_mark_sharp, + ? ZetaIcon( + ZetaIcons.check_mark, color: widget.selected! ? colors.iconInverse : Colors.transparent, ) : const SizedBox()), diff --git a/lib/src/components/date_input/date_input.dart b/lib/src/components/date_input/date_input.dart index c1fcd459..6ef19e1e 100644 --- a/lib/src/components/date_input/date_input.dart +++ b/lib/src/components/date_input/date_input.dart @@ -210,8 +210,6 @@ class ZetaDateInputState extends State implements ZetaFormFieldSt @override Widget build(BuildContext context) { - final rounded = context.rounded; - return ZetaTextInput( disabled: widget.disabled, key: _key, @@ -250,14 +248,14 @@ class ZetaDateInputState extends State implements ZetaFormFieldSt children: [ if (_showClearButton) InputIconButton( - icon: rounded ? ZetaIcons.cancel_round : ZetaIcons.cancel_sharp, + icon: ZetaIcons.cancel, onTap: reset, disabled: widget.disabled, size: widget.size, color: _colors.iconSubtle, ), InputIconButton( - icon: rounded ? ZetaIcons.calendar_round : ZetaIcons.calendar_sharp, + icon: ZetaIcons.calendar, onTap: _pickDate, disabled: widget.disabled, size: widget.size, diff --git a/lib/src/components/fabs/fab.dart b/lib/src/components/fabs/fab.dart index e05ea4c5..86b6f417 100644 --- a/lib/src/components/fabs/fab.dart +++ b/lib/src/components/fabs/fab.dart @@ -35,7 +35,7 @@ class ZetaFAB extends StatefulWidget { this.type = ZetaFabType.primary, this.size = ZetaFabSize.small, this.shape = ZetaWidgetBorder.full, - this.icon = ZetaIcons.add_round, + this.icon = ZetaIcons.add, this.initiallyExpanded, this.focusNode, super.key, @@ -73,7 +73,7 @@ class ZetaFAB extends StatefulWidget { /// Icon for the button /// - /// Defaults to [ZetaIcons.add_round]. + /// Defaults to [ZetaIcons.add]. final IconData icon; /// Whether the FAB starts as expanded. @@ -147,7 +147,7 @@ class _ZetaFABState extends State { child: Row( mainAxisSize: MainAxisSize.min, children: [ - Icon(widget.icon, size: widget.size.iconSize), + ZetaIcon(widget.icon, size: widget.size.iconSize), if (isExpanded && widget.label != null) Row( mainAxisSize: MainAxisSize.min, diff --git a/lib/src/components/filter_selection/filter_selection.dart b/lib/src/components/filter_selection/filter_selection.dart index 65a0c3b8..471e0f09 100644 --- a/lib/src/components/filter_selection/filter_selection.dart +++ b/lib/src/components/filter_selection/filter_selection.dart @@ -31,8 +31,8 @@ class ZetaFilterSelection extends ZetaStatelessWidget { child: IconButton( visualDensity: VisualDensity.compact, onPressed: onPressed, - icon: Icon( - context.rounded ? ZetaIcons.filter_round : ZetaIcons.filter_sharp, + icon: const ZetaIcon( + ZetaIcons.filter, size: ZetaSpacing.xl_2, ), ), diff --git a/lib/src/components/global_header/global_header.dart b/lib/src/components/global_header/global_header.dart index 8ec7da9c..553d94a2 100644 --- a/lib/src/components/global_header/global_header.dart +++ b/lib/src/components/global_header/global_header.dart @@ -110,7 +110,7 @@ class _GlobalHeaderState extends State { height: ZetaSpacing.xl_2, margin: const EdgeInsets.symmetric(horizontal: ZetaSpacing.minimum), ), - IconButton(icon: const Icon(ZetaIcons.apps_round), onPressed: widget.onAppsButton), + IconButton(icon: const ZetaIcon(ZetaIcons.apps), onPressed: widget.onAppsButton), ], const SizedBox(width: ZetaSpacing.small), if (widget.avatar != null) widget.avatar!.copyWith(size: ZetaAvatarSize.m), diff --git a/lib/src/components/global_header/header_tab_item.dart b/lib/src/components/global_header/header_tab_item.dart index fb4269d0..c8411990 100644 --- a/lib/src/components/global_header/header_tab_item.dart +++ b/lib/src/components/global_header/header_tab_item.dart @@ -72,7 +72,7 @@ class _ZetaGlobalHeaderItemState extends State { children: [ Text(widget.label, style: TextStyle(color: foregroundColor)), const SizedBox(width: ZetaSpacing.small), - if (widget.dropdown != null) Icon(ZetaIcons.expand_more_round, color: foregroundColor), + if (widget.dropdown != null) ZetaIcon(ZetaIcons.expand_more, color: foregroundColor), ], ).paddingHorizontal(ZetaSpacing.xl_2).paddingVertical(ZetaSpacing.medium), ), diff --git a/lib/src/components/icon/icon.dart b/lib/src/components/icon/icon.dart new file mode 100644 index 00000000..ea799c7e --- /dev/null +++ b/lib/src/components/icon/icon.dart @@ -0,0 +1,246 @@ +// The content of this file is taken from +// package:flutter/src/widgets/icon.dart + +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-3RD-PARTY file. + +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; + +import 'package:flutter/rendering.dart'; +import '../../../zeta_flutter.dart'; + +/// Custom wrapper for [Icon] that applies the Zeta icon family. +class ZetaIcon extends ZetaStatelessWidget { + /// Constructs a [ZetaIcon]. + const ZetaIcon( + this.icon, { + super.rounded, + super.key, + this.size, + this.fill, + this.weight, + this.grade, + this.opticalSize, + this.color, + this.shadows, + this.semanticLabel, + this.textDirection, + this.applyTextScaling, + }); + + /// The icon to display. The available icons are described in [Icons]. + /// + /// The icon can be null, in which case the widget will render as an empty + /// space of the specified [size]. + final IconData? icon; + + /// The size of the icon in logical pixels. + /// + /// Icons occupy a square with width and height equal to size. + /// + /// Defaults to the nearest [IconTheme]'s [IconThemeData.size]. + /// + /// If this [Icon] is being placed inside an [IconButton], then use + /// [IconButton.iconSize] instead, so that the [IconButton] can make the splash + /// area the appropriate size as well. The [IconButton] uses an [IconTheme] to + /// pass down the size to the [Icon]. + final double? size; + + /// The fill for drawing the icon. + /// + /// Requires the underlying icon font to support the `FILL` [FontVariation] + /// axis, otherwise has no effect. Variable font filenames often indicate + /// the supported axes. Must be between 0.0 (unfilled) and 1.0 (filled), + /// inclusive. + /// + /// Can be used to convey a state transition for animation or interaction. + /// + /// Defaults to nearest [IconTheme]'s [IconThemeData.fill]. + /// + /// See also: + /// * [weight], for controlling stroke weight. + /// * [grade], for controlling stroke weight in a more granular way. + /// * [opticalSize], for controlling optical size. + final double? fill; + + /// The stroke weight for drawing the icon. + /// + /// Requires the underlying icon font to support the `wght` [FontVariation] + /// axis, otherwise has no effect. Variable font filenames often indicate + /// the supported axes. Must be greater than 0. + /// + /// Defaults to nearest [IconTheme]'s [IconThemeData.weight]. + /// + /// See also: + /// * [fill], for controlling fill. + /// * [grade], for controlling stroke weight in a more granular way. + /// * [opticalSize], for controlling optical size. + /// * https://fonts.google.com/knowledge/glossary/weight_axis + final double? weight; + + /// The grade (granular stroke weight) for drawing the icon. + /// + /// Requires the underlying icon font to support the `GRAD` [FontVariation] + /// axis, otherwise has no effect. Variable font filenames often indicate + /// the supported axes. Can be negative. + /// + /// Grade and [weight] both affect a symbol's stroke weight (thickness), but + /// grade has a smaller impact on the size of the symbol. + /// + /// Grade is also available in some text fonts. One can match grade levels + /// between text and symbols for a harmonious visual effect. For example, if + /// the text font has a -25 grade value, the symbols can match it with a + /// suitable value, say -25. + /// + /// Defaults to nearest [IconTheme]'s [IconThemeData.grade]. + /// + /// See also: + /// * [fill], for controlling fill. + /// * [weight], for controlling stroke weight in a less granular way. + /// * [opticalSize], for controlling optical size. + /// * https://fonts.google.com/knowledge/glossary/grade_axis + final double? grade; + + /// The optical size for drawing the icon. + /// + /// Requires the underlying icon font to support the `opsz` [FontVariation] + /// axis, otherwise has no effect. Variable font filenames often indicate + /// the supported axes. Must be greater than 0. + /// + /// For an icon to look the same at different sizes, the stroke weight + /// (thickness) must change as the icon size scales. Optical size offers a way + /// to automatically adjust the stroke weight as icon size changes. + /// + /// Defaults to nearest [IconTheme]'s [IconThemeData.opticalSize]. + /// + /// See also: + /// * [fill], for controlling fill. + /// * [weight], for controlling stroke weight. + /// * [grade], for controlling stroke weight in a more granular way. + /// * https://fonts.google.com/knowledge/glossary/optical_size_axis + final double? opticalSize; + + /// The color to use when drawing the icon. + /// + /// Defaults to the nearest [IconTheme]'s [IconThemeData.color]. + /// + /// The color (whether specified explicitly here or obtained from the + /// [IconTheme]) will be further adjusted by the nearest [IconTheme]'s + /// [IconThemeData.opacity]. + /// + /// {@tool snippet} + /// Typically, a Material Design color will be used, as follows: + /// + /// ```dart + /// Icon( + /// Icons.widgets, + /// color: Colors.blue.shade400, + /// ) + /// ``` + /// {@end-tool} + final Color? color; + + /// A list of [Shadow]s that will be painted underneath the icon. + /// + /// Multiple shadows are supported to replicate lighting from multiple light + /// sources. + /// + /// Shadows must be in the same order for [Icon] to be considered as + /// equivalent as order produces differing transparency. + /// + /// Defaults to the nearest [IconTheme]'s [IconThemeData.shadows]. + final List? shadows; + + /// Semantic label for the icon. + /// + /// Announced in accessibility modes (e.g TalkBack/VoiceOver). + /// This label does not show in the UI. + /// + /// * [SemanticsProperties.label], which is set to [semanticLabel] in the + /// underlying [Semantics] widget. + final String? semanticLabel; + + /// The text direction to use for rendering the icon. + /// + /// If this is null, the ambient [Directionality] is used instead. + /// + /// Some icons follow the reading direction. For example, "back" buttons point + /// left in left-to-right environments and right in right-to-left + /// environments. Such icons have their [IconData.matchTextDirection] field + /// set to true, and the [Icon] widget uses the [textDirection] to determine + /// the orientation in which to draw the icon. + /// + /// This property has no effect if the [icon]'s [IconData.matchTextDirection] + /// field is false, but for consistency a text direction value must always be + /// specified, either directly using this property or using [Directionality]. + final TextDirection? textDirection; + + /// Whether to scale the size of this widget using the ambient [MediaQuery]'s [TextScaler]. + /// + /// This is specially useful when you have an icon associated with a text, as + /// scaling the text without scaling the icon would result in a confusing + /// interface. + /// + /// Defaults to the nearest [IconTheme]'s + /// [IconThemeData.applyTextScaling]. + final bool? applyTextScaling; + + @override + Widget build(BuildContext context) { + return Icon( + icon?.apply(context), + size: size, + fill: fill, + weight: weight, + grade: grade, + opticalSize: opticalSize, + color: color, + shadows: shadows, + semanticLabel: semanticLabel, + textDirection: textDirection, + applyTextScaling: applyTextScaling, + key: key, + ); + } + + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties + ..add(DiagnosticsProperty('rounded', rounded)) + ..add(DiagnosticsProperty('icon', icon)) + ..add(DoubleProperty('size', size)) + ..add(DoubleProperty('fill', fill)) + ..add(DoubleProperty('weight', weight)) + ..add(DoubleProperty('grade', grade)) + ..add(DoubleProperty('opticalSize', opticalSize)) + ..add(ColorProperty('color', color)) + ..add(IterableProperty('shadows', shadows)) + ..add(StringProperty('semanticLabel', semanticLabel)) + ..add(EnumProperty('textDirection', textDirection)) + ..add(DiagnosticsProperty('applyTextScaling', applyTextScaling)); + } +} + +/// Custom extension for [IconData] that applies the Zeta icon family. +extension IconExtensions on IconData { + IconData _copyWith(String fontFamily) { + return IconData( + codePoint, + fontFamily: fontFamily, + fontFamilyFallback: fontFamilyFallback, + fontPackage: fontPackage, + matchTextDirection: matchTextDirection, + ); + } + + /// Returns a copy of the icon with the correct font family. + IconData apply(BuildContext context, {bool? rounded}) { + if (fontFamily == ZetaIcons.family) { + return _copyWith((rounded ?? context.rounded) ? ZetaIcons.familyRound : ZetaIcons.familySharp); + } + return this; + } +} diff --git a/lib/src/components/in_page_banner/in_page_banner.dart b/lib/src/components/in_page_banner/in_page_banner.dart index 39173d05..b1b25371 100644 --- a/lib/src/components/in_page_banner/in_page_banner.dart +++ b/lib/src/components/in_page_banner/in_page_banner.dart @@ -63,8 +63,8 @@ class ZetaInPageBanner extends ZetaStatelessWidget { children: [ Padding( padding: const EdgeInsetsDirectional.only(top: ZetaSpacing.medium, start: ZetaSpacingBase.x2_5), - child: Icon( - customIcon ?? status.icon(rounded: rounded), + child: ZetaIcon( + customIcon ?? status.icon, size: ZetaSpacing.xl_1, color: status == ZetaWidgetStatus.neutral ? theme.colors.textDefault : colors.icon, ), @@ -97,8 +97,8 @@ class ZetaInPageBanner extends ZetaStatelessWidget { if (onClose != null) IconButton( onPressed: onClose, - icon: Icon( - !rounded ? ZetaIcons.close_sharp : ZetaIcons.close_round, + icon: const ZetaIcon( + ZetaIcons.close, size: ZetaSpacing.xl_1, ), ), @@ -121,17 +121,17 @@ class ZetaInPageBanner extends ZetaStatelessWidget { } extension on ZetaWidgetStatus { - IconData icon({required bool rounded}) { + IconData get icon { switch (this) { case ZetaWidgetStatus.positive: - return rounded ? ZetaIcons.check_circle_round : ZetaIcons.check_circle_sharp; + return ZetaIcons.check_circle; case ZetaWidgetStatus.warning: - return rounded ? ZetaIcons.warning_round : ZetaIcons.warning_sharp; + return ZetaIcons.warning; case ZetaWidgetStatus.negative: - return rounded ? ZetaIcons.error_round : ZetaIcons.error_sharp; + return ZetaIcons.error; case ZetaWidgetStatus.neutral: case ZetaWidgetStatus.info: - return rounded ? ZetaIcons.info_round : ZetaIcons.info_sharp; + return ZetaIcons.info; } } } diff --git a/lib/src/components/list_item/dropdown_list_item.dart b/lib/src/components/list_item/dropdown_list_item.dart index 065c451e..9f1eabb8 100644 --- a/lib/src/components/list_item/dropdown_list_item.dart +++ b/lib/src/components/list_item/dropdown_list_item.dart @@ -59,10 +59,6 @@ class _ZetaDropdownListItemState extends State with Single late bool _expanded; - IconData get _icon { - return context.rounded ? ZetaIcons.expand_more_round : ZetaIcons.expand_more_sharp; - } - @override void initState() { _expanded = widget.expanded; @@ -136,8 +132,8 @@ class _ZetaDropdownListItemState extends State with Single icon: AnimatedRotation( turns: _expanded ? 0.5 : 0, duration: ZetaAnimationLength.fast, - child: Icon( - _icon, + child: ZetaIcon( + ZetaIcons.expand_more, color: colors.iconSubtle, ), ), diff --git a/lib/src/components/list_item/notification_list_item.dart b/lib/src/components/list_item/notification_list_item.dart index bee3b1ca..842733ee 100644 --- a/lib/src/components/list_item/notification_list_item.dart +++ b/lib/src/components/list_item/notification_list_item.dart @@ -121,8 +121,8 @@ class _ZetaNotificationListItemState extends State { Container( padding: const EdgeInsets.all(2), decoration: BoxDecoration(color: colors.surfaceNegative, borderRadius: ZetaRadius.full), - child: Icon( - ZetaIcons.important_notification_round, + child: ZetaIcon( + ZetaIcons.important_notification, color: colors.white, size: ZetaSpacing.medium, ), @@ -211,11 +211,11 @@ class ZetaNotificationBadge extends StatelessWidget { return avatar != null ? avatar!.copyWith( size: ZetaAvatarSize.m, - lowerBadge: ZetaAvatarBadge.icon(icon: ZetaIcons.check_mark_round, color: colors.green), + lowerBadge: ZetaAvatarBadge.icon(icon: ZetaIcons.check_mark, color: colors.green), backgroundColor: colors.purple.shade80, ) : icon != null - ? Icon( + ? ZetaIcon( icon, size: ZetaSpacing.xl_8, color: iconColor, diff --git a/lib/src/components/navigation bar/navigation_bar.dart b/lib/src/components/navigation bar/navigation_bar.dart index c545dc05..5365949c 100644 --- a/lib/src/components/navigation bar/navigation_bar.dart +++ b/lib/src/components/navigation bar/navigation_bar.dart @@ -245,7 +245,7 @@ class _NavigationItem extends StatelessWidget { left: ZetaSpacingBase.x2_5, top: ZetaSpacing.small - _navigationItemBorderWidth, right: ZetaSpacingBase.x2_5, - child: Icon(item.icon, color: elementColor, size: ZetaSpacing.xl_2), + child: ZetaIcon(item.icon, color: elementColor, size: ZetaSpacing.xl_2), ), if (item.badge != null) _getBadge(colors), ], diff --git a/lib/src/components/pagination/pagination.dart b/lib/src/components/pagination/pagination.dart index 13e041e6..8404f125 100644 --- a/lib/src/components/pagination/pagination.dart +++ b/lib/src/components/pagination/pagination.dart @@ -191,9 +191,7 @@ class _ZetaPaginationState extends State { items: items, onChanged: (val) => _onItemPressed(val!), value: _currentPage, - icon: Icon( - rounded ? ZetaIcons.expand_more_round : ZetaIcons.expand_more_sharp, - ).paddingStart(ZetaSpacing.small), + icon: const ZetaIcon(ZetaIcons.expand_more).paddingStart(ZetaSpacing.small), underline: const SizedBox(), style: Theme.of(context).textTheme.bodyLarge?.copyWith( color: colors.textSubtle, @@ -213,23 +211,22 @@ class _ZetaPaginationState extends State { builder: (context, constraints) { final showDropdown = widget.type == ZetaPaginationType.dropdown || constraints.deviceType == DeviceType.mobilePortrait; - final rounded = context.rounded; final List buttons = [ if (!showDropdown) _PaginationItem( - icon: rounded ? ZetaIcons.first_page_round : ZetaIcons.first_page_sharp, + icon: ZetaIcons.first_page, onPressed: () => _onItemPressed(1), disabled: _disabled, ), _PaginationItem( - icon: rounded ? ZetaIcons.chevron_left_round : ZetaIcons.chevron_left_sharp, + icon: ZetaIcons.chevron_left, onPressed: () => _onItemPressed(max(1, _currentPage - 1)), disabled: _disabled, ), if (!showDropdown) ...numberedPaginationItems else paginationDropdown, _PaginationItem( - icon: rounded ? ZetaIcons.chevron_right_round : ZetaIcons.chevron_right_sharp, + icon: ZetaIcons.chevron_right, onPressed: () => _onItemPressed( min(widget.pages, _currentPage + 1), ), @@ -237,7 +234,7 @@ class _ZetaPaginationState extends State { ), if (!showDropdown) _PaginationItem( - icon: rounded ? ZetaIcons.last_page_round : ZetaIcons.last_page_sharp, + icon: ZetaIcons.last_page, onPressed: () => _onItemPressed( widget.pages, ), @@ -291,7 +288,7 @@ class _PaginationItem extends StatelessWidget { ), ); } else if (icon != null) { - child = Icon( + child = ZetaIcon( icon, color: disabled ? colors.iconDisabled : colors.iconDefault, ); diff --git a/lib/src/components/password/password_input.dart b/lib/src/components/password/password_input.dart index 88adbde0..97e6eb6c 100644 --- a/lib/src/components/password/password_input.dart +++ b/lib/src/components/password/password_input.dart @@ -84,14 +84,6 @@ class _ZetaPasswordInputState extends State { _obscureText = widget.obscureText; } - IconData get _icon { - if (context.rounded) { - return !_obscureText ? ZetaIcons.visibility_round : ZetaIcons.visibility_off_round; - } else { - return !_obscureText ? ZetaIcons.visibility_sharp : ZetaIcons.visibility_off_sharp; - } - } - @override Widget build(BuildContext context) { final rounded = context.rounded; @@ -110,7 +102,7 @@ class _ZetaPasswordInputState extends State { disabled: widget.disabled, obscureText: _obscureText, suffix: IconButton( - icon: Icon(_icon), + icon: ZetaIcon(_obscureText ? ZetaIcons.visibility_off : ZetaIcons.visibility), onPressed: () { setState(() { _obscureText = !_obscureText; diff --git a/lib/src/components/phone_input/phone_input.dart b/lib/src/components/phone_input/phone_input.dart index 3b20a780..ff8362f9 100644 --- a/lib/src/components/phone_input/phone_input.dart +++ b/lib/src/components/phone_input/phone_input.dart @@ -198,8 +198,8 @@ class _ZetaPhoneInputState extends State { fit: BoxFit.fitHeight, ), ), - Icon( - rounded ? ZetaIcons.expand_more_round : ZetaIcons.expand_more_sharp, + ZetaIcon( + ZetaIcons.expand_more, color: widget.enabled ? zeta.colors.textDefault : zeta.colors.cool.shade50, size: ZetaSpacing.xl_1, ), @@ -294,10 +294,8 @@ class _ZetaPhoneInputState extends State { children: [ Padding( padding: const EdgeInsets.only(right: ZetaSpacing.small), - child: Icon( - showError && widget.enabled - ? (rounded ? ZetaIcons.error_round : ZetaIcons.error_sharp) - : (rounded ? ZetaIcons.info_round : ZetaIcons.info_sharp), + child: ZetaIcon( + (showError && widget.enabled) ? ZetaIcons.error : ZetaIcons.info, size: ZetaSpacing.large, color: hintErrorColor, ), diff --git a/lib/src/components/progress/progress_circle.dart b/lib/src/components/progress/progress_circle.dart index 73286c18..938a7f5f 100644 --- a/lib/src/components/progress/progress_circle.dart +++ b/lib/src/components/progress/progress_circle.dart @@ -124,8 +124,8 @@ class ZetaProgressCircleState extends ZetaProgressState { borderRadius: ZetaRadius.full, ), padding: const EdgeInsets.all(ZetaSpacing.small), - child: Icon( - context.rounded ? ZetaIcons.close_round : ZetaIcons.close_sharp, + child: ZetaIcon( + ZetaIcons.close, size: widget.size == ZetaCircleSizes.s ? ZetaSpacing.medium : ZetaSpacing.large, ), diff --git a/lib/src/components/screen_header_bar/screen_header_bar.dart b/lib/src/components/screen_header_bar/screen_header_bar.dart index 27c3cbc0..5fbf63ad 100644 --- a/lib/src/components/screen_header_bar/screen_header_bar.dart +++ b/lib/src/components/screen_header_bar/screen_header_bar.dart @@ -30,7 +30,7 @@ class ZetaScreenHeaderBar extends ZetaStatelessWidget { child: ZetaTopAppBar( leading: IconButton( onPressed: () async => Navigator.maybePop(context), - icon: Icon(rounded ? ZetaIcons.chevron_left_round : ZetaIcons.chevron_left_sharp), + icon: const ZetaIcon(ZetaIcons.chevron_left), ), title: title, titleTextStyle: ZetaTextStyles.titleLarge, diff --git a/lib/src/components/search_bar/search_bar.dart b/lib/src/components/search_bar/search_bar.dart index eb00cf24..af05de0d 100644 --- a/lib/src/components/search_bar/search_bar.dart +++ b/lib/src/components/search_bar/search_bar.dart @@ -98,105 +98,107 @@ class _ZetaSearchBarState extends State { @override Widget build(BuildContext context) { final zeta = Zeta.of(context); - final sharp = widget.shape == ZetaWidgetBorder.sharp; final iconSize = _iconSize(_size); - return TextFormField( - enabled: !widget.disabled, - controller: _controller, - keyboardType: TextInputType.text, - onChanged: (value) => setState(() => widget.onChanged?.call(value)), - style: ZetaTextStyles.bodyMedium, - decoration: InputDecoration( - isDense: true, - contentPadding: EdgeInsets.symmetric( - horizontal: 10, - vertical: _inputVerticalPadding(_size), - ), - hintText: widget.hint ?? 'Search', - hintStyle: ZetaTextStyles.bodyMedium.copyWith( - color: !widget.disabled ? zeta.colors.textDefault : zeta.colors.cool.shade50, - ), - prefixIcon: widget.showLeadingIcon - ? Padding( - padding: const EdgeInsets.only(left: ZetaSpacingBase.x2_5, right: ZetaSpacing.small), - child: Icon( - sharp ? ZetaIcons.search_sharp : ZetaIcons.search_round, - color: !widget.disabled ? zeta.colors.cool.shade70 : zeta.colors.cool.shade50, - size: iconSize, - ), - ) - : null, - prefixIconConstraints: const BoxConstraints( - minHeight: ZetaSpacing.xl_2, - minWidth: ZetaSpacing.xl_2, - ), - suffixIcon: IntrinsicHeight( - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - if (_controller.text.isNotEmpty && !widget.disabled) ...[ - IconButton( - visualDensity: const VisualDensity( - horizontal: -4, - vertical: -4, - ), - onPressed: () { - setState(_controller.clear); - widget.onChanged?.call(''); - }, - icon: Icon( - sharp ? ZetaIcons.cancel_sharp : ZetaIcons.cancel_round, - color: zeta.colors.cool.shade70, + return ZetaRoundedScope( + rounded: widget.shape != ZetaWidgetBorder.sharp, + child: TextFormField( + enabled: !widget.disabled, + controller: _controller, + keyboardType: TextInputType.text, + onChanged: (value) => setState(() => widget.onChanged?.call(value)), + style: ZetaTextStyles.bodyMedium, + decoration: InputDecoration( + isDense: true, + contentPadding: EdgeInsets.symmetric( + horizontal: 10, + vertical: _inputVerticalPadding(_size), + ), + hintText: widget.hint ?? 'Search', + hintStyle: ZetaTextStyles.bodyMedium.copyWith( + color: !widget.disabled ? zeta.colors.textDefault : zeta.colors.cool.shade50, + ), + prefixIcon: widget.showLeadingIcon + ? Padding( + padding: const EdgeInsets.only(left: ZetaSpacingBase.x2_5, right: ZetaSpacing.small), + child: ZetaIcon( + ZetaIcons.search, + color: !widget.disabled ? zeta.colors.cool.shade70 : zeta.colors.cool.shade50, size: iconSize, ), - ), - if (widget.showSpeechToText) - SizedBox( - height: iconSize, - child: VerticalDivider( - color: zeta.colors.cool.shade40, - width: 5, - thickness: 1, + ) + : null, + prefixIconConstraints: const BoxConstraints( + minHeight: ZetaSpacing.xl_2, + minWidth: ZetaSpacing.xl_2, + ), + suffixIcon: IntrinsicHeight( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + if (_controller.text.isNotEmpty && !widget.disabled) ...[ + IconButton( + visualDensity: const VisualDensity( + horizontal: -4, + vertical: -4, + ), + onPressed: () { + setState(_controller.clear); + widget.onChanged?.call(''); + }, + icon: ZetaIcon( + ZetaIcons.cancel, + color: zeta.colors.cool.shade70, + size: iconSize, ), ), + if (widget.showSpeechToText) + SizedBox( + height: iconSize, + child: VerticalDivider( + color: zeta.colors.cool.shade40, + width: 5, + thickness: 1, + ), + ), + ], + Padding( + padding: const EdgeInsets.only(right: ZetaSpacing.minimum), + child: widget.showSpeechToText + ? IconButton( + visualDensity: const VisualDensity( + horizontal: -4, + vertical: -4, + ), + onPressed: widget.onSpeechToText == null + ? null + : () async { + final text = await widget.onSpeechToText!.call(); + if (text != null) { + setState(() => _controller.text = text); + widget.onChanged?.call(text); + } + }, + icon: ZetaIcon( + ZetaIcons.microphone, + size: iconSize, + ), + ) + : const SizedBox(), + ), ], - Padding( - padding: const EdgeInsets.only(right: ZetaSpacing.minimum), - child: widget.showSpeechToText - ? IconButton( - visualDensity: const VisualDensity( - horizontal: -4, - vertical: -4, - ), - onPressed: widget.onSpeechToText == null - ? null - : () async { - final text = await widget.onSpeechToText!.call(); - if (text != null) { - setState(() => _controller.text = text); - widget.onChanged?.call(text); - } - }, - icon: Icon( - sharp ? ZetaIcons.microphone_sharp : ZetaIcons.microphone_round, - size: iconSize, - ), - ) - : const SizedBox(), - ), - ], + ), ), + suffixIconConstraints: const BoxConstraints( + minHeight: ZetaSpacing.xl_2, + minWidth: ZetaSpacing.xl_2, + ), + filled: !widget.disabled ? null : true, + fillColor: !widget.disabled ? null : zeta.colors.cool.shade30, + enabledBorder: _defaultInputBorder(zeta, shape: _shape), + focusedBorder: _focusedInputBorder(zeta, shape: _shape), + disabledBorder: _defaultInputBorder(zeta, shape: _shape), ), - suffixIconConstraints: const BoxConstraints( - minHeight: ZetaSpacing.xl_2, - minWidth: ZetaSpacing.xl_2, - ), - filled: !widget.disabled ? null : true, - fillColor: !widget.disabled ? null : zeta.colors.cool.shade30, - enabledBorder: _defaultInputBorder(zeta, shape: _shape), - focusedBorder: _focusedInputBorder(zeta, shape: _shape), - disabledBorder: _defaultInputBorder(zeta, shape: _shape), ), ); } diff --git a/lib/src/components/select_input/select_input.dart b/lib/src/components/select_input/select_input.dart index 9e847a51..2e397053 100644 --- a/lib/src/components/select_input/select_input.dart +++ b/lib/src/components/select_input/select_input.dart @@ -84,15 +84,6 @@ class _ZetaSelectInputState extends State> { bool get _dropdownOpen => _dropdownKey.currentState?.isOpen ?? false; - IconData get _icon { - final rounded = context.rounded; - if (_dropdownOpen) { - return rounded ? ZetaIcons.expand_less_round : ZetaIcons.expand_less_sharp; - } else { - return rounded ? ZetaIcons.expand_more_round : ZetaIcons.expand_more_sharp; - } - } - @override void initState() { _inputController.addListener( @@ -183,7 +174,7 @@ class _ZetaSelectInputState extends State> { hintText: widget.hintText, onChange: (val) => _onInputChanged(controller), suffix: InputIconButton( - icon: _icon, + icon: _dropdownOpen ? ZetaIcons.expand_less : ZetaIcons.expand_more, disabled: widget.disabled, size: widget.size, color: colors.iconSubtle, diff --git a/lib/src/components/snack_bar/snack_bar.dart b/lib/src/components/snack_bar/snack_bar.dart index 0ece9993..dbe2a10e 100644 --- a/lib/src/components/snack_bar/snack_bar.dart +++ b/lib/src/components/snack_bar/snack_bar.dart @@ -298,11 +298,7 @@ class _IconButton extends StatelessWidget { minimumSize: const Size(ZetaSpacing.xl_1, ZetaSpacing.xl_1), ), onPressed: onPressed, - icon: Icon( - ZetaIcons.close_round, - color: color, - size: ZetaSpacing.xl_1, - ), + icon: ZetaIcon(ZetaIcons.close, color: color, size: ZetaSpacing.xl_1), ), ); } @@ -380,12 +376,12 @@ class _LeadingIcon extends StatelessWidget { Widget _getIcon(ZetaSnackBarType? type) { return switch (type) { - ZetaSnackBarType.positive => const Icon(ZetaIcons.check_circle_round), - ZetaSnackBarType.info => const Icon(ZetaIcons.info_round), - ZetaSnackBarType.warning => const Icon(ZetaIcons.warning_round), - ZetaSnackBarType.error => const Icon(ZetaIcons.error_round), - ZetaSnackBarType.deletion => const Icon(ZetaIcons.delete_round), - ZetaSnackBarType.view => const Icon(ZetaIcons.open_in_new_window_round), + ZetaSnackBarType.positive => const ZetaIcon(ZetaIcons.check_circle), + ZetaSnackBarType.info => const ZetaIcon(ZetaIcons.info), + ZetaSnackBarType.warning => const ZetaIcon(ZetaIcons.warning), + ZetaSnackBarType.error => const ZetaIcon(ZetaIcons.error), + ZetaSnackBarType.deletion => const ZetaIcon(ZetaIcons.delete), + ZetaSnackBarType.view => const ZetaIcon(ZetaIcons.open_in_new_window), _ => const SizedBox(), }; } diff --git a/lib/src/components/stepper/stepper.dart b/lib/src/components/stepper/stepper.dart index d41f447b..d7c81996 100644 --- a/lib/src/components/stepper/stepper.dart +++ b/lib/src/components/stepper/stepper.dart @@ -100,8 +100,8 @@ class _ZetaStepperState extends State with TickerProviderStateMixin ), child: Center( child: switch (widget.steps[index].type) { - ZetaStepType.complete => Icon( - rounded ? ZetaIcons.check_mark_round : ZetaIcons.check_mark_sharp, + ZetaStepType.complete => ZetaIcon( + ZetaIcons.check_mark, color: _colors.textInverse, ), ZetaStepType.enabled || ZetaStepType.disabled => Text( @@ -129,8 +129,8 @@ class _ZetaStepperState extends State with TickerProviderStateMixin ), child: Center( child: switch (widget.steps[index].type) { - ZetaStepType.complete => Icon( - context.rounded ? ZetaIcons.check_mark_round : ZetaIcons.check_mark_sharp, + ZetaStepType.complete => ZetaIcon( + ZetaIcons.check_mark, color: _colors.textInverse, ), ZetaStepType.enabled || ZetaStepType.disabled => Text( diff --git a/lib/src/components/stepper_input/stepper_input.dart b/lib/src/components/stepper_input/stepper_input.dart index a3d17ea2..231488ad 100644 --- a/lib/src/components/stepper_input/stepper_input.dart +++ b/lib/src/components/stepper_input/stepper_input.dart @@ -126,22 +126,12 @@ class _ZetaStepperInputState extends State { } ZetaIconButton _getButton({bool increase = false}) { - final bool rounded = context.rounded; - return ZetaIconButton( - icon: increase - ? rounded - ? ZetaIcons.add_round - : ZetaIcons.add_sharp - : rounded - ? ZetaIcons.remove_round - : ZetaIcons.remove_sharp, + icon: increase ? ZetaIcons.add : ZetaIcons.remove, type: ZetaButtonType.outlineSubtle, size: widget.size == ZetaStepperInputSize.medium ? ZetaWidgetSize.medium : ZetaWidgetSize.large, onPressed: !_disabled && (increase ? _value != widget.max : _value != widget.min) - ? () => _onChange( - _value + (increase ? 1 : -1), - ) + ? () => _onChange(_value + (increase ? 1 : -1)) : null, ); } diff --git a/lib/src/components/text_input/text_input.dart b/lib/src/components/text_input/text_input.dart index 875ba52a..48de5fcf 100644 --- a/lib/src/components/text_input/text_input.dart +++ b/lib/src/components/text_input/text_input.dart @@ -445,14 +445,8 @@ class _HintText extends StatelessWidget { return Row( children: [ - Icon( - errorText != null - ? rounded - ? ZetaIcons.error_round - : ZetaIcons.error_sharp - : rounded - ? ZetaIcons.info_round - : ZetaIcons.info_sharp, + ZetaIcon( + errorText != null ? ZetaIcons.error : ZetaIcons.info, size: ZetaSpacing.large, color: elementColor, ), diff --git a/lib/src/components/time_input/time_input.dart b/lib/src/components/time_input/time_input.dart index e411f396..2e1c6052 100644 --- a/lib/src/components/time_input/time_input.dart +++ b/lib/src/components/time_input/time_input.dart @@ -210,8 +210,6 @@ class ZetaTimeInputState extends State implements ZetaFormFieldSt @override Widget build(BuildContext context) { - final rounded = context.rounded; - if (!_firstBuildComplete && widget.initialValue != null) { _setText(widget.initialValue!); _firstBuildComplete = true; @@ -251,14 +249,14 @@ class ZetaTimeInputState extends State implements ZetaFormFieldSt children: [ if (_showClearButton) InputIconButton( - icon: rounded ? ZetaIcons.cancel_round : ZetaIcons.cancel_sharp, + icon: ZetaIcons.cancel, onTap: reset, disabled: widget.disabled, size: widget.size, color: _colors.iconSubtle, ), InputIconButton( - icon: rounded ? ZetaIcons.clock_outline_round : ZetaIcons.clock_outline_sharp, + icon: ZetaIcons.clock_outline, onTap: _pickTime, disabled: widget.disabled, size: widget.size, diff --git a/lib/src/components/top_app_bar/top_app_bar.dart b/lib/src/components/top_app_bar/top_app_bar.dart index df1f6789..b908d5b0 100644 --- a/lib/src/components/top_app_bar/top_app_bar.dart +++ b/lib/src/components/top_app_bar/top_app_bar.dart @@ -174,7 +174,7 @@ class _ZetaTopAppBarState extends State { IconButton( color: colors.cool.shade50, onPressed: () => widget.searchController?.clearText(), - icon: const Icon(ZetaIcons.cancel_round), + icon: const ZetaIcon(ZetaIcons.cancel), ), if (widget.onSearchMicrophoneIconPressed != null) ...[ SizedBox( @@ -183,7 +183,7 @@ class _ZetaTopAppBarState extends State { ), IconButton( onPressed: widget.onSearchMicrophoneIconPressed, - icon: const Icon(ZetaIcons.microphone_round), + icon: const ZetaIcon(ZetaIcons.microphone), ), ], ], diff --git a/lib/zeta_flutter.dart b/lib/zeta_flutter.dart index f3d73c56..714716ca 100644 --- a/lib/zeta_flutter.dart +++ b/lib/zeta_flutter.dart @@ -29,6 +29,7 @@ export 'src/components/fabs/fab.dart'; export 'src/components/filter_selection/filter_selection.dart'; export 'src/components/global_header/global_header.dart'; export 'src/components/global_header/header_tab_item.dart'; +export 'src/components/icon/icon.dart'; export 'src/components/in_page_banner/in_page_banner.dart'; export 'src/components/list_item/dropdown_list_item.dart'; export 'src/components/list_item/list_item.dart'; diff --git a/test/src/components/icon/icon_test.dart b/test/src/components/icon/icon_test.dart new file mode 100644 index 00000000..05cbbb5e --- /dev/null +++ b/test/src/components/icon/icon_test.dart @@ -0,0 +1,172 @@ +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:zeta_flutter/zeta_flutter.dart'; + +import '../../../test_utils/test_app.dart'; +import '../../../test_utils/utils.dart'; + +void main() { + group('Zeta Icon', () { + testWidgets('renders icon correctly', (WidgetTester tester) async { + await tester.pumpWidget(const TestApp(home: ZetaIcon(ZetaIcons.add_round))); + final iconFinder = find.byIcon(ZetaIcons.add_round); + expect(iconFinder, findsOneWidget); + }); + + testWidgets('applies correct size to icon', (WidgetTester tester) async { + const double iconSize = 24; + await tester.pumpWidget(const TestApp(home: ZetaIcon(ZetaIcons.add_round, size: iconSize))); + final iconFinder = find.byIcon(ZetaIcons.add_round); + final iconWidget = tester.widget(iconFinder); + expect(iconWidget.size, equals(iconSize)); + }); + + testWidgets('applies correct color to icon', (WidgetTester tester) async { + const Color iconColor = Colors.red; + await tester.pumpWidget(const TestApp(home: ZetaIcon(ZetaIcons.add_round, color: iconColor))); + final iconFinder = find.byIcon(ZetaIcons.add_round); + final iconWidget = tester.widget(iconFinder); + expect(iconWidget.color, equals(iconColor)); + }); + + testWidgets('applies correct semantic label to icon', (WidgetTester tester) async { + const String semanticLabel = 'Add Icon'; + await tester.pumpWidget(const TestApp(home: ZetaIcon(ZetaIcons.add_round, semanticLabel: semanticLabel))); + final iconFinder = find.byIcon(ZetaIcons.add_round); + final iconWidget = tester.widget(iconFinder); + expect(iconWidget.semanticLabel, equals(semanticLabel)); + }); + + testWidgets('applies sharp family to icon', (WidgetTester tester) async { + await tester.pumpWidget( + const TestApp( + home: Column( + children: [ + ZetaIcon(ZetaIcons.table), + ZetaRoundedScope( + rounded: false, + child: ZetaIcon(ZetaIcons.table), + ), + ], + ), + ), + ); + final iconFinderRound = find.byIcon(ZetaIcons.table_round); + final iconFinderSharp = find.byIcon(ZetaIcons.table_sharp); + + expect(iconFinderRound, findsOneWidget); + expect(iconFinderSharp, findsExactly(1)); + }); + + testWidgets('applies correct font family to icon', (WidgetTester tester) async { + await tester.pumpWidget(const TestApp(home: ZetaIcon(ZetaIcons.add_round))); + final iconFinder = find.byIcon(ZetaIcons.add_round); + final iconWidget = tester.widget(iconFinder); + expect(iconWidget.icon?.fontFamily, equals(ZetaIcons.familyRound)); + }); + + testWidgets('applies correct font family when rounded is false', (WidgetTester tester) async { + await tester.pumpWidget( + const TestApp( + home: ZetaRoundedScope( + rounded: false, + child: ZetaIcon(ZetaIcons.add), + ), + ), + ); + final iconFinder = find.byIcon(ZetaIcons.add_sharp); + final iconWidget = tester.widget(iconFinder); + expect(iconWidget.icon?.fontFamily, equals(ZetaIcons.familySharp)); + }); + + testWidgets('does not change fontFamily if specific rounded / sharp variant is requested', + (WidgetTester tester) async { + await tester.pumpWidget( + const TestApp( + home: ZetaRoundedScope( + rounded: false, + child: ZetaIcon(ZetaIcons.add_round, rounded: false), + ), + ), + ); + final iconFinder = find.byIcon(ZetaIcons.add_round); + final iconWidget = tester.widget(iconFinder); + expect(iconWidget.icon?.fontFamily, equals(ZetaIcons.familyRound)); + }); + + testWidgets('apply() sets round icon font', (WidgetTester tester) async { + await tester.pumpWidget( + TestApp( + home: Builder( + builder: (context) { + return ZetaIcon(ZetaIcons.activity.apply(context)); + }, + ), + ), + ); + final iconFinder = find.byIcon(ZetaIcons.activity_round); + final iconWidget = tester.widget(iconFinder); + expect(iconWidget.icon?.fontFamily, equals(ZetaIcons.familyRound)); + }); + + testWidgets('apply() uses rounded from context', (WidgetTester tester) async { + await tester.pumpWidget( + TestApp( + home: ZetaRoundedScope( + rounded: false, + child: Builder( + builder: (context) { + return ZetaIcon(ZetaIcons.activity.apply(context)); + }, + ), + ), + ), + ); + final iconFinder = find.byIcon(ZetaIcons.activity_sharp); + final iconWidget = tester.widget(iconFinder); + expect(iconWidget.icon?.fontFamily, equals(ZetaIcons.familySharp)); + }); + + testWidgets('apply() returns the same icon if not in ZetaIcons family', (WidgetTester tester) async { + await tester.pumpWidget( + TestApp( + home: ZetaRoundedScope( + rounded: false, + child: Builder( + builder: (context) { + return ZetaIcon(Icons.abc.apply(context)); + }, + ), + ), + ), + ); + final iconFinder = find.byIcon(Icons.abc); + final iconWidget = tester.widget(iconFinder); + expect(iconWidget.icon?.fontFamily, equals('MaterialIcons')); + }); + + testWidgets('debugFillProperties works correctly', (WidgetTester tester) async { + final diagnostics = DiagnosticPropertiesBuilder(); + const ZetaIcon( + ZetaIcons.cached, + rounded: false, + size: 10, + semanticLabel: 'Cached', + ).debugFillProperties(diagnostics); + + expect(diagnostics.finder('icon'), 'IconData(U+0E045)'); + expect(diagnostics.finder('rounded'), 'false'); + expect(diagnostics.finder('size'), '10.0'); + expect(diagnostics.finder('fill'), 'null'); + expect(diagnostics.finder('weight'), 'null'); + expect(diagnostics.finder('grade'), 'null'); + expect(diagnostics.finder('opticalSize'), 'null'); + expect(diagnostics.finder('color'), 'null'); + expect(diagnostics.finder('shadows'), 'null'); + expect(diagnostics.finder('semanticLabel'), '"Cached"'); + expect(diagnostics.finder('textDirection'), 'null'); + expect(diagnostics.finder('applyTextScaling'), 'null'); + }); + }); +}