File tree Expand file tree Collapse file tree 2 files changed +35
-6
lines changed Expand file tree Collapse file tree 2 files changed +35
-6
lines changed Original file line number Diff line number Diff line change 1- import 'package:calc/components/button .dart' ;
1+ import 'package:calc/components/buttons/icon .dart' ;
22import 'package:flutter/material.dart' ;
33
44class ButtonBackspace extends StatelessWidget {
55 final Function onPress;
6+ final Brightness brightness;
67
78 ButtonBackspace ({
89 this .onPress,
10+ this .brightness,
911 });
1012
1113 @override
1214 Widget build (BuildContext context) {
13- return Button (
14- child: Icon (
15- Icons .backspace_outlined,
16- size: 18 ,
17- ),
15+ return ButtonIcon (
16+ icon: Icons .backspace_outlined,
1817 size: 50 ,
1918 onPress: () => this .onPress (),
19+ brightness: brightness,
2020 );
2121 }
2222}
Original file line number Diff line number Diff line change 1+ import 'package:calc/components/button.dart' ;
2+ import 'package:flutter/material.dart' ;
3+
4+ class ButtonIcon extends StatelessWidget {
5+ final IconData icon;
6+ final Function onPress;
7+ final double size;
8+ final Brightness brightness;
9+
10+ ButtonIcon ({
11+ this .icon,
12+ this .onPress,
13+ this .size,
14+ this .brightness,
15+ });
16+
17+ @override
18+ Widget build (BuildContext context) {
19+ return Button (
20+ child: Icon (
21+ icon,
22+ size: 18 ,
23+ color: brightness == Brightness .light ? Colors .white : Colors .grey[800 ],
24+ ),
25+ size: size,
26+ onPress: () => onPress (),
27+ );
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments