From 936d4ead6627aa7d09f2396f3be9221d5e28fdbc Mon Sep 17 00:00:00 2001 From: waitingwittykitty Date: Mon, 28 Nov 2022 09:02:19 -0600 Subject: [PATCH] add outline with inverted color to date text --- lib/pages/save_video/save_video_page.dart | 34 +++++++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/lib/pages/save_video/save_video_page.dart b/lib/pages/save_video/save_video_page.dart index 5442081..21d8991 100644 --- a/lib/pages/save_video/save_video_page.dart +++ b/lib/pages/save_video/save_video_page.dart @@ -112,6 +112,14 @@ class _SaveVideoPageState extends State { Get.offNamed(Routes.RECORDING); } + Color invert(Color color) { + final r = 255 - color.red; + final g = 255 - color.green; + final b = 255 - color.blue; + + return Color.fromARGB((color.opacity * 255).round(), r, g, b); + } + Widget _dailyVideoPlayer() { return GestureDetector( onTap: () => videoPlay(), @@ -144,12 +152,26 @@ class _SaveVideoPageState extends State { alignment: isTextDate ? Alignment.bottomLeft : Alignment.topRight, child: Padding( padding: const EdgeInsets.all(5.0), - child: Text( - _dateFormatValue, - style: TextStyle( - color: currentColor, - fontSize: MediaQuery.of(context).size.width * 0.03, - ), + child: Stack( + children: [ + Text( + _dateFormatValue, + style: TextStyle( + fontSize: MediaQuery.of(context).size.width * 0.03, + foreground: Paint() + ..style = PaintingStyle.stroke + ..strokeWidth = 2 + ..color = invert(currentColor), + ), + ), + Text( + _dateFormatValue, + style: TextStyle( + fontSize: MediaQuery.of(context).size.width * 0.03, + color: currentColor, + ), + ), + ], ), ), ),