diff --git a/flutter/lib/common/widgets/address_book.dart b/flutter/lib/common/widgets/address_book.dart index 6b19d098a..d6a7853c5 100644 --- a/flutter/lib/common/widgets/address_book.dart +++ b/flutter/lib/common/widgets/address_book.dart @@ -71,14 +71,14 @@ class _AddressBookState extends State { Widget _buildAddressBookDesktop() { return Row( children: [ - Card( + Container( margin: EdgeInsets.symmetric(horizontal: 4.0), - shape: RoundedRectangleBorder( + decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - side: - BorderSide(color: Theme.of(context).scaffoldBackgroundColor)), + border: + Border.all(color: Theme.of(context).colorScheme.background)), child: Container( - width: 200, + width: 180, height: double.infinity, padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), @@ -89,9 +89,6 @@ class _AddressBookState extends State { child: Container( width: double.infinity, height: double.infinity, - decoration: BoxDecoration( - border: Border.all(color: MyTheme.border), - borderRadius: BorderRadius.circular(2)), child: _buildTags(), ).marginSymmetric(vertical: 8.0), ) @@ -107,12 +104,12 @@ class _AddressBookState extends State { Widget _buildAddressBookMobile() { return Column( children: [ - Card( + Container( margin: EdgeInsets.symmetric(horizontal: 1.0), - shape: RoundedRectangleBorder( + decoration: BoxDecoration( borderRadius: BorderRadius.circular(6), - side: - BorderSide(color: Theme.of(context).scaffoldBackgroundColor)), + border: + Border.all(color: Theme.of(context).colorScheme.background)), child: Container( padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), @@ -122,9 +119,6 @@ class _AddressBookState extends State { _buildTagHeader(), Container( width: double.infinity, - decoration: BoxDecoration( - border: Border.all(color: MyTheme.darkGray), - borderRadius: BorderRadius.circular(4)), child: _buildTags(), ).marginSymmetric(vertical: 8.0), ], @@ -149,7 +143,7 @@ class _AddressBookState extends State { menuPos = RelativeRect.fromLTRB(x, y, x, y); }, onPointerUp: (_) => _showMenu(menuPos), - child: ActionMore()), + child: build_more(context, invert: true)), ], ); } @@ -421,10 +415,9 @@ class AddressBookTag extends StatelessWidget { child: Obx( () => Container( decoration: BoxDecoration( - color: tags.contains(name) ? Colors.blue : null, - border: tags.contains(name) - ? null - : Border.all(color: MyTheme.border), + color: tags.contains(name) + ? Colors.blue + : Theme.of(context).colorScheme.background, borderRadius: BorderRadius.circular(6)), margin: const EdgeInsets.symmetric(horizontal: 4.0, vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 8.0), diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index 939c5ce9e..09d1cb521 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -313,7 +313,7 @@ class _PeerCardState extends State<_PeerCard> _menuPos = RelativeRect.fromLTRB(x, y, x, y); }, onPointerUp: (_) => _showPeerMenu(peer.id), - child: ActionMore()); + child: build_more(context)); /// Show the peer menu and handle user's choice. /// User might remove the peer or send a file to the peer. @@ -1226,28 +1226,28 @@ Widget getOnline(double rightPadding, bool online) { radius: 3, backgroundColor: online ? Colors.green : kColorWarn))); } -class ActionMore extends StatelessWidget { - final RxBool _hover = false.obs; - - @override - Widget build(BuildContext context) { - return InkWell( - borderRadius: BorderRadius.circular(14), - onTap: () {}, - onHover: (value) => _hover.value = value, - child: Obx(() => CircleAvatar( - radius: 14, - backgroundColor: _hover.value - ? Theme.of(context).scaffoldBackgroundColor - : Theme.of(context).colorScheme.background, - child: Icon(Icons.more_vert, - size: 18, - color: _hover.value - ? Theme.of(context).textTheme.titleLarge?.color - : Theme.of(context) - .textTheme - .titleLarge - ?.color - ?.withOpacity(0.5))))); - } +Widget build_more(BuildContext context, {bool invert = false}) { + final RxBool hover = false.obs; + return InkWell( + borderRadius: BorderRadius.circular(14), + onTap: () {}, + onHover: (value) => hover.value = value, + child: Obx(() => CircleAvatar( + radius: 14, + backgroundColor: hover.value + ? (invert + ? Theme.of(context).colorScheme.background + : Theme.of(context).scaffoldBackgroundColor) + : (invert + ? Theme.of(context).scaffoldBackgroundColor + : Theme.of(context).colorScheme.background), + child: Icon(Icons.more_vert, + size: 18, + color: hover.value + ? Theme.of(context).textTheme.titleLarge?.color + : Theme.of(context) + .textTheme + .titleLarge + ?.color + ?.withOpacity(0.5))))); }