-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: adding blinker * examples and changelog * examples and changelog * fix lint
- Loading branch information
1 parent
3105504
commit de24539
Showing
7 changed files
with
69 additions
and
25 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
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,31 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:nes_ui/nes_ui.dart'; | ||
|
||
class EffectsSection extends StatelessWidget { | ||
const EffectsSection({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = Theme.of(context); | ||
return Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
'Effects', | ||
style: theme.textTheme.displayMedium, | ||
), | ||
const SizedBox(height: 16), | ||
Wrap( | ||
children: [ | ||
SizedBox( | ||
height: 40, | ||
child: NesBlinker( | ||
child: const Text('NES Blinker'), | ||
), | ||
), | ||
], | ||
), | ||
], | ||
); | ||
} | ||
} |
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,30 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:phased/phased.dart'; | ||
|
||
/// {@template nes_blinker} | ||
/// A widget that blinks its child. | ||
/// {@endtemplate} | ||
class NesBlinker extends Phased<bool> { | ||
/// {@macro nes_blinker} | ||
NesBlinker({ | ||
super.key, | ||
required this.child, | ||
}) : super( | ||
state: PhasedState<bool>( | ||
values: [true, false], | ||
ticker: const Duration(seconds: 1), | ||
), | ||
); | ||
|
||
/// The child widget to blink. | ||
final Widget child; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
if (state.value) { | ||
return child; | ||
} else { | ||
return const SizedBox(); | ||
} | ||
} | ||
} |
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