-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added Tooltip95, a Windows95 Themed tooltip (#19)
Co-authored-by: Miguel Beltran <m@beltran.work>
- Loading branch information
1 parent
f6442a3
commit db40a73
Showing
6 changed files
with
100 additions
and
0 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
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,55 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter95/src/globals.dart'; | ||
|
||
class Tooltip95 extends StatelessWidget { | ||
const Tooltip95({ | ||
Key? key, | ||
required this.child, | ||
required this.message, | ||
this.triggerMode, | ||
this.preferBelow, | ||
this.showDuration, | ||
this.onTriggered, | ||
}); | ||
|
||
final Widget child; | ||
final String message; | ||
final TooltipTriggerMode? triggerMode; | ||
final bool? preferBelow; | ||
final Duration? showDuration; | ||
final void Function()? onTriggered; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Tooltip( | ||
key: key, | ||
child: child, | ||
message: message, | ||
margin: const EdgeInsets.all(8.0), | ||
textAlign: TextAlign.center, | ||
preferBelow: preferBelow, | ||
showDuration: showDuration, | ||
onTriggered: onTriggered, | ||
padding: const EdgeInsets.symmetric( | ||
horizontal: 8, | ||
vertical: 4, | ||
), | ||
decoration: BoxDecoration( | ||
border: Border.all( | ||
color: Colors.black, | ||
width: 1.0, | ||
), | ||
borderRadius: BorderRadius.zero, | ||
color: Flutter95.tooltipBackground, | ||
boxShadow: [ | ||
BoxShadow( | ||
color: Flutter95.black, | ||
offset: Offset(2.0, 2.0), | ||
), | ||
], | ||
), | ||
triggerMode: triggerMode, | ||
textStyle: Flutter95.textStyle, | ||
); | ||
} | ||
} |
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