style: display branch distance prominently under the title with brand color and near_me icon for improved readability

This commit is contained in:
Suherdy Yacob 2026-06-14 11:17:29 +07:00
parent 370099930d
commit 561e69e0f0

View File

@ -3,8 +3,6 @@ import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../services/odoo_service.dart'; import '../services/odoo_service.dart';
import '../theme/app_theme.dart';
class BranchesScreen extends StatefulWidget { class BranchesScreen extends StatefulWidget {
const BranchesScreen({super.key}); const BranchesScreen({super.key});
@ -260,48 +258,41 @@ class _BranchesScreenState extends State<BranchesScreen> {
child: Icon(Icons.storefront, child: Icon(Icons.storefront,
color: colorScheme.secondary), color: colorScheme.secondary),
), ),
title: Row( title: Text(
children: [ branch['name'] ?? 'Mapan Branch',
Expanded( style: theme
child: Text( .textTheme
branch['name'] ?? 'Mapan Branch', .titleMedium
style: theme ?.copyWith(
.textTheme fontFamily: 'serif',
.titleMedium fontWeight: FontWeight.bold,
?.copyWith(
fontFamily: 'serif',
fontWeight: FontWeight.bold,
),
), ),
),
if (distanceLabel.isNotEmpty)
Container(
margin: const EdgeInsets.only(left: 8),
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 3),
decoration: BoxDecoration(
color: colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(12),
),
child: Text(
distanceLabel,
style: theme
.textTheme
.labelLarge
?.copyWith(
color: colorScheme.onSecondaryContainer,
fontSize: 10,
fontWeight: FontWeight.bold,
),
),
),
],
), ),
subtitle: Padding( subtitle: Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 6.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (distanceLabel.isNotEmpty) ...[
Row(
children: [
Icon(
Icons.near_me_rounded,
size: 14,
color: colorScheme.primary,
),
const SizedBox(width: 4),
Text(
'$distanceLabel away',
style: theme.textTheme.bodyMedium?.copyWith(
color: colorScheme.primary,
fontWeight: FontWeight.bold,
),
),
],
),
const SizedBox(height: 6),
],
Text( Text(
addressParts.isEmpty addressParts.isEmpty
? 'No address specified' ? 'No address specified'