@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
44import 'package:watch_it/watch_it.dart' ;
55import 'package:yaru/yaru.dart' ;
66
7+ import '../../constants.dart' ;
78import '../../weather.dart' ;
89import '../weather/view/city_search_field.dart' ;
910import '../weather/weather_model.dart' ;
@@ -46,6 +47,7 @@ class MasterDetailPage extends StatelessWidget with WatchItMixin {
4647 controller: YaruPageController (
4748 length: favLocationsLength == 0 ? 1 : favLocationsLength,
4849 ),
50+ layoutDelegate: const YaruMasterFixedPaneDelegate (paneWidth: kPaneWidth),
4951 tileBuilder: (context, index, selected, availableWidth) {
5052 final location = favLocations.elementAt (index);
5153 return YaruMasterTile (
@@ -56,17 +58,20 @@ class MasterDetailPage extends StatelessWidget with WatchItMixin {
5658 favLocations.elementAt (index),
5759 ),
5860 trailing: favLocationsLength > 1
59- ? IconButton (
60- padding: EdgeInsets .zero,
61- onPressed: () {
62- model.removeFavLocation (location).then (
63- (value) => model.init (
64- cityName: favLocations.lastOrNull,
65- ),
66- );
67- },
68- icon: const Icon (
69- YaruIcons .window_close,
61+ ? Center (
62+ widthFactor: 0.1 ,
63+ child: IconButton (
64+ padding: EdgeInsets .zero,
65+ onPressed: () {
66+ model.removeFavLocation (location).then (
67+ (value) => model.init (
68+ cityName: favLocations.lastOrNull,
69+ ),
70+ );
71+ },
72+ icon: const Icon (
73+ YaruIcons .window_close,
74+ ),
7075 ),
7176 )
7277 : null ,
@@ -79,21 +84,7 @@ class MasterDetailPage extends StatelessWidget with WatchItMixin {
7984 backgroundColor: YaruMasterDetailTheme .of (context).sideBarColor,
8085 border: BorderSide .none,
8186 style: YaruTitleBarStyle .undecorated,
82- leading: Center (
83- child: YaruIconButton (
84- padding: EdgeInsets .zero,
85- icon: const Icon (
86- Icons .location_on,
87- size: 16 ,
88- ),
89- onPressed: () => model.init (cityName: null ),
90- ),
91- ),
92- titleSpacing: 0 ,
93- title: const Padding (
94- padding: EdgeInsets .only (right: 15 ),
95- child: CitySearchField (),
96- ),
87+ title: const CitySearchField (),
9788 ),
9889 );
9990 }
0 commit comments