-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from xpwmaosldk/dev
Dev
- Loading branch information
Showing
11 changed files
with
261 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,3 +73,5 @@ build/ | |
!**/ios/**/default.mode2v3 | ||
!**/ios/**/default.pbxuser | ||
!**/ios/**/default.perspectivev3 | ||
|
||
**/coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ControlButton extends StatelessWidget { | ||
const ControlButton( | ||
this.buttonElevation, | ||
this.buttonRadius, | ||
this.colorPrimary, | ||
this.colorSub, | ||
this.icon, | ||
this.enabled, | ||
this.onTap, | ||
); | ||
|
||
final double buttonElevation; | ||
final double buttonRadius; | ||
final Color colorPrimary; | ||
final Color colorSub; | ||
final Widget icon; | ||
final bool enabled; | ||
final Function(BuildContext) onTap; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ElevatedButton( | ||
style: ElevatedButton.styleFrom( | ||
elevation: buttonElevation, | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(buttonRadius), | ||
), | ||
surfaceTintColor: Colors.transparent, | ||
padding: EdgeInsets.zero, | ||
minimumSize: Size(48, 48), | ||
foregroundColor: enabled ? colorPrimary : Colors.grey, | ||
backgroundColor: colorSub, | ||
disabledForegroundColor: colorPrimary, | ||
disabledBackgroundColor: colorSub, | ||
), | ||
onPressed: enabled ? () => onTap(context) : null, | ||
child: icon, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'number_pagination.dart'; | ||
|
||
class NumberButton extends StatelessWidget { | ||
const NumberButton( | ||
this.number, | ||
this.buttonElevation, | ||
this.buttonRadius, | ||
this.colorPrimary, | ||
this.colorSub, | ||
this.fontSize, | ||
this.fontFamily, | ||
this.onSelect, | ||
); | ||
|
||
final int number; | ||
final double buttonElevation; | ||
final double buttonRadius; | ||
final Color colorPrimary; | ||
final Color colorSub; | ||
final double fontSize; | ||
final String fontFamily; | ||
final Function(BuildContext, int) onSelect; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Flexible( | ||
child: Padding( | ||
padding: const EdgeInsets.all(1.5), | ||
child: ElevatedButton( | ||
style: ElevatedButton.styleFrom( | ||
shadowColor: number == NumberPageContainer.of(context).currentPage | ||
? colorPrimary | ||
: null, | ||
elevation: buttonElevation, | ||
surfaceTintColor: Colors.transparent, | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(buttonRadius), | ||
), | ||
padding: EdgeInsets.zero, | ||
minimumSize: Size(48, 48), | ||
foregroundColor: | ||
number == NumberPageContainer.of(context).currentPage | ||
? colorSub | ||
: colorPrimary, | ||
backgroundColor: | ||
number == NumberPageContainer.of(context).currentPage | ||
? colorPrimary | ||
: colorSub, | ||
), | ||
onPressed: () { | ||
onSelect(context, number); | ||
}, | ||
child: Text( | ||
'${number}', | ||
style: TextStyle( | ||
fontSize: fontSize, | ||
fontFamily: fontFamily, | ||
color: number == NumberPageContainer.of(context).currentPage | ||
? colorSub | ||
: colorPrimary, | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.