minor home screen fixes
This commit is contained in:
@@ -366,128 +366,18 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
|||||||
children: [
|
children: [
|
||||||
if (!_isLoggedIn) _buildLoginPrompt(theme, isDark),
|
if (!_isLoggedIn) _buildLoginPrompt(theme, isDark),
|
||||||
if (_isLoggedIn) const AccountBalanceWidget(),
|
if (_isLoggedIn) const AccountBalanceWidget(),
|
||||||
const SizedBox(height: 16),
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
_buildSectionLabel(theme, isDark, Icons.grid_view_rounded, "Pay"),
|
_buildSectionLabel(theme, isDark, Icons.grid_view_rounded, "Pay"),
|
||||||
Row(
|
IconButton(
|
||||||
mainAxisSize: MainAxisSize.min,
|
icon: Icon(
|
||||||
children: [
|
Icons.refresh_rounded,
|
||||||
Container(
|
color: isDark ? Colors.white54 : Colors.black54,
|
||||||
padding: const EdgeInsets.symmetric(
|
size: 20,
|
||||||
horizontal: 8,
|
),
|
||||||
vertical: 2,
|
onPressed: _onRefresh,
|
||||||
),
|
tooltip: 'Refresh',
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: isDark ? const Color(0xFF1E1E1E) : Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
|
||||||
border: Border.all(
|
|
||||||
color: isDark
|
|
||||||
? Colors.white.withValues(alpha: 0.12)
|
|
||||||
: Colors.black.withValues(alpha: 0.08),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'USD',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 11,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: !_isZWGSelected
|
|
||||||
? theme.colorScheme.primary
|
|
||||||
: isDark
|
|
||||||
? Colors.white54
|
|
||||||
: Colors.black45,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
setState(() {
|
|
||||||
_isZWGSelected = !_isZWGSelected;
|
|
||||||
});
|
|
||||||
if (_isZWGSelected) {
|
|
||||||
AppSnackBar.show(
|
|
||||||
context,
|
|
||||||
'ZWG currency not supported yet',
|
|
||||||
customContent: const Center(
|
|
||||||
child: Text('ZWG currency not supported yet'),
|
|
||||||
),
|
|
||||||
backgroundColor: theme.colorScheme.primary,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
),
|
|
||||||
duration: const Duration(seconds: 3),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future.delayed(
|
|
||||||
const Duration(milliseconds: 1000),
|
|
||||||
() {
|
|
||||||
setState(() {
|
|
||||||
_isZWGSelected = !_isZWGSelected;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: AnimatedContainer(
|
|
||||||
duration: const Duration(milliseconds: 200),
|
|
||||||
width: 32,
|
|
||||||
height: 18,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
color: _isZWGSelected
|
|
||||||
? theme.colorScheme.primary
|
|
||||||
: Colors.grey.shade300,
|
|
||||||
),
|
|
||||||
child: AnimatedAlign(
|
|
||||||
duration: const Duration(milliseconds: 200),
|
|
||||||
alignment: _isZWGSelected
|
|
||||||
? Alignment.centerRight
|
|
||||||
: Alignment.centerLeft,
|
|
||||||
child: Container(
|
|
||||||
width: 14,
|
|
||||||
height: 14,
|
|
||||||
margin: const EdgeInsets.all(2),
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'ZWG',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 11,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: _isZWGSelected
|
|
||||||
? theme.colorScheme.primary
|
|
||||||
: isDark
|
|
||||||
? Colors.white54
|
|
||||||
: Colors.black45,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 4),
|
|
||||||
IconButton(
|
|
||||||
icon: Icon(
|
|
||||||
Icons.refresh_rounded,
|
|
||||||
color: isDark ? Colors.white54 : Colors.black54,
|
|
||||||
size: 20,
|
|
||||||
),
|
|
||||||
onPressed: _onRefresh,
|
|
||||||
tooltip: 'Refresh',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user