From 3cec93678ec7dd5e702f7ca35e6f08e693d6a4ce Mon Sep 17 00:00:00 2001 From: Waleed Arshad <25613623+wal33d006@users.noreply.github.com> Date: Fri, 13 May 2022 15:42:27 +0500 Subject: [PATCH] refactor: Update custom switch to have Cosmos specific gradient (#276) --- .../assets/images/2.0x/toggle.png | Bin 0 -> 4971 bytes .../assets/images/3.0x/toggle.png | Bin 0 -> 9651 bytes .../assets/images/toggle.png | Bin 0 -> 2163 bytes .../lib/components/cosmos_qr_image.dart | 2 +- .../lib/components/cosmos_switch.dart | 70 +++++++++++++----- .../lib/utils/global_constants.dart | 8 ++ 6 files changed, 60 insertions(+), 20 deletions(-) create mode 100644 packages/cosmos_ui_components/assets/images/2.0x/toggle.png create mode 100644 packages/cosmos_ui_components/assets/images/3.0x/toggle.png create mode 100644 packages/cosmos_ui_components/assets/images/toggle.png diff --git a/packages/cosmos_ui_components/assets/images/2.0x/toggle.png b/packages/cosmos_ui_components/assets/images/2.0x/toggle.png new file mode 100644 index 0000000000000000000000000000000000000000..e3522c2e6c9ae141a412ec5b472367530cc057f3 GIT binary patch literal 4971 zcmai22T)Vn);^&VKtP&OLzPYviV#8vDFV`@2?zp#&=LqrlP*XR;fe^vP^623pi-rY zNKtwhP?0JiMd>v!c+0!<=AZe`%-ZYQd#~?XYwtC4=FEvVG1g@ObAkZ?V9?joHY0h( zQ=_3GjU}8h{GK2~eJfkjxUq^$&Ici2~%m z*U3nmFn}}y{3Jtx;J+~|3CG<<0~Ehw0DwU9rx0>F{OvVdFgIKwChi!249*>cg}~v` zau87?Cug+J>53Qtz@czB0xFMy$wFXq2>FW$xB>uBq)_~mV=x!=R~;nPT(W=iDdv*@ z7n5@SuaW{n9twbl>2ye2v{*eG8~{jOJ~dFG%A=>G0yoeW*8bK;h6rbjx3tq~q0)ig z*i$6{8HgZ3Z&!aONT9cu4-OHiBJeu`LBglYG6Im_A^x5!0@g+*5G{c%K9EygryH1?{we|jr-}Y~{;Ja(`%fYt++U|6olhpv z2`d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SbS}YX~z;|~HouU!Nomr=vr&V_(!VFfs&Ncp5 z(^={9LQdRaTogR&H4UQlbEgzmCi>i}!~5n?tyrJbhQGVt#utdBHLoWHHd5VeT*=O6 z3iUwB>HZe)2P)o0d%5d`*tJ24yC04Fr$4Dq+pH);8I~gyG5&wi#qkKX+TJhzA4g40 AFaQ7m literal 0 HcmV?d00001 diff --git a/packages/cosmos_ui_components/lib/components/cosmos_qr_image.dart b/packages/cosmos_ui_components/lib/components/cosmos_qr_image.dart index f9a4996f..1485d730 100644 --- a/packages/cosmos_ui_components/lib/components/cosmos_qr_image.dart +++ b/packages/cosmos_ui_components/lib/components/cosmos_qr_image.dart @@ -19,7 +19,7 @@ class CosmosQrImage extends StatelessWidget { Widget build(BuildContext context) { final theme = CosmosTheme.of(context); return ClipRRect( - borderRadius: borderRadius ?? BorderRadius.circular(theme.radiusL), + borderRadius: borderRadius ?? theme.borderRadiusL, child: QrImage( padding: padding, data: data, diff --git a/packages/cosmos_ui_components/lib/components/cosmos_switch.dart b/packages/cosmos_ui_components/lib/components/cosmos_switch.dart index 7336d9b5..6991c17a 100644 --- a/packages/cosmos_ui_components/lib/components/cosmos_switch.dart +++ b/packages/cosmos_ui_components/lib/components/cosmos_switch.dart @@ -1,4 +1,5 @@ -import 'package:cosmos_ui_components/cosmos_theme.dart'; +import 'package:cosmos_ui_components/cosmos_ui_components.dart'; +import 'package:cosmos_ui_components/utils/global_constants.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -6,33 +7,60 @@ import 'package:flutter/material.dart'; class CosmosSwitch extends StatelessWidget { const CosmosSwitch({ required this.checked, + this.toggleAsset, + this.checkedGradientStops = const [0, 0.5866, 1], + this.gradientColors = GlobalConstants.cosmosGradientColors, + this.package, this.onChanged, Key? key, }) : super(key: key); final bool checked; final ValueChanged? onChanged; + final String? toggleAsset; + final List checkedGradientStops; + final List gradientColors; + final String? package; @override Widget build(BuildContext context) { - final theme = CosmosTheme.of(context); - return Transform.scale( - scale: 0.9, // so that the border appears closer to the switch - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(1000), - border: Border.all( - color: checked ? Colors.transparent : theme.colors.text.withOpacity(0.1), - ), - ), + return TweenAnimationBuilder( + duration: const Duration(milliseconds: 200), + tween: AlignmentTween( + begin: checked ? Alignment.centerLeft : Alignment.centerRight, + end: checked ? Alignment.centerRight : Alignment.centerLeft, + ), + builder: (context, value, child) => GestureDetector( + onTap: () => onChanged!(!checked), child: Transform.scale( - scale: 1.1, // so that the border appears closer to the switch - child: CupertinoSwitch( - value: checked, - onChanged: onChanged, - activeColor: theme.colors.link, - thumbColor: checked ? theme.colors.background : theme.colors.text, - trackColor: theme.colors.background, + scale: 0.9, + child: Container( + width: 50, + height: 28, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(30), + gradient: checked + ? LinearGradient( + stops: checkedGradientStops, + colors: gradientColors, + ) + : null, + color: checked ? null : CosmosTheme.of(context).colors.text, + ), + child: Transform.scale( + scale: 1.1, + child: Align( + alignment: value, + child: SizedBox( + width: 30, + height: 30, + child: Image.asset( + toggleAsset ?? 'assets/images/toggle.png', + package: package ?? (toggleAsset == null ? packageName : null), + ), + ), + ), + ), ), ), ), @@ -43,7 +71,11 @@ class CosmosSwitch extends StatelessWidget { void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); properties + ..add(DiagnosticsProperty('checked', checked)) ..add(ObjectFlagProperty?>.has('onChanged', onChanged)) - ..add(DiagnosticsProperty('checked', checked)); + ..add(StringProperty('toggleAsset', toggleAsset)) + ..add(IterableProperty('checkedGradientStops', checkedGradientStops)) + ..add(IterableProperty('gradientColors', gradientColors)) + ..add(StringProperty('package', package)); } } diff --git a/packages/cosmos_ui_components/lib/utils/global_constants.dart b/packages/cosmos_ui_components/lib/utils/global_constants.dart index 8c7ba25c..da1b79cc 100644 --- a/packages/cosmos_ui_components/lib/utils/global_constants.dart +++ b/packages/cosmos_ui_components/lib/utils/global_constants.dart @@ -1,3 +1,11 @@ +import 'package:flutter/material.dart'; + abstract class GlobalConstants { static const double defaultButtonHeight = 50; + + static const List cosmosGradientColors = [ + Color(0xFF64DBFC), + Color(0xFF30FFDF), + Color(0xFFFFFE39), + ]; }