@@ -11,21 +11,34 @@ class MaterialButton extends StatelessWidget {
1111 @override
1212 Widget build (BuildContext context) {
1313 final mainColor = color ?? Theme .of (context).colorScheme.secondary;
14- return FlatButton (
15- shape: RoundedRectangleBorder (
16- borderRadius: BorderRadius .circular (12.0 ),
17- side: BorderSide (width: 2 , color: mainColor)),
18- padding: const EdgeInsets .all (15 ),
14+ return TextButton (
15+ style: ButtonStyle (
16+ padding: MaterialStateProperty .all <EdgeInsetsGeometry >(
17+ const EdgeInsets .all (15 )),
18+ shape: MaterialStateProperty .all (
19+ RoundedRectangleBorder (
20+ borderRadius: BorderRadius .circular (12.0 ),
21+ side: BorderSide (width: 2 , color: mainColor)),
22+ ),
23+ ),
1924 onPressed: onPressed,
2025 child: Row (
21- mainAxisAlignment: MainAxisAlignment .center,
22- crossAxisAlignment: CrossAxisAlignment .center,
23- children: [
24- Icon (iconData, color: mainColor,),
25- const SizedBox (width: 10 ,),
26- Text (text, style: TextStyle (color: mainColor),),
27- ]
28- )
26+ mainAxisAlignment: MainAxisAlignment .center,
27+ crossAxisAlignment: CrossAxisAlignment .center,
28+ children: [
29+ Icon (
30+ iconData,
31+ color: mainColor,
32+ ),
33+ const SizedBox (
34+ width: 10 ,
35+ ),
36+ Text (
37+ text,
38+ style: TextStyle (color: mainColor),
39+ ),
40+ ],
41+ ),
2942 );
3043 }
3144}
@@ -42,8 +55,7 @@ class CommentsButton extends StatelessWidget {
4255 onPressed: onPressed,
4356 color: color,
4457 iconData: Icons .chat_bubble,
45- text: "Комментарии"
46- );
58+ text: "Комментарии" );
4759 }
4860}
4961
@@ -59,7 +71,6 @@ class SearchButton extends StatelessWidget {
5971 onPressed: onPressed,
6072 color: color,
6173 iconData: Icons .search,
62- text: "Поиск"
63- );
74+ text: "Поиск" );
6475 }
65- }
76+ }
0 commit comments