Victor Sanni
96d1b99211
Condense nav bar large title in landscape mode ( #166956 )
...
## Rotation demo
https://github.com/user-attachments/assets/b59d6875-dff7-4b40-9525-565dfd8a2554
### Portrait mode .automatic
https://github.com/user-attachments/assets/88f4f3a2-0f13-4c92-b601-20c20e13f7dc
### Landscape mode .automatic
https://github.com/user-attachments/assets/dd5e2373-82e3-41fc-8e83-4002ce5e848e
### Portrait mode .always
https://github.com/user-attachments/assets/623d131a-f71b-430d-b84c-0b4519919f56
### Landscape mode .always
https://github.com/user-attachments/assets/5980e8fe-a981-482d-9f77-97f9ab7495c7
Fixes [CupertinoSliverNavigationBar doesn't become compact in landscape
mode](https://github.com/flutter/flutter/issues/39254 )
<details>
<summary>Sample code</summary>
```dart
import 'package:flutter/cupertino.dart';
void main() => runApp(const NavBarBlueApp());
class NavBarBlueApp extends StatelessWidget {
const NavBarBlueApp({super.key});
@override
Widget build(BuildContext context) {
return CupertinoApp(
theme: CupertinoThemeData(),
home: MainPage(),
);
}
}
class MainPage extends StatelessWidget {
const MainPage({super.key});
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
child: SafeArea(
child: CustomScrollView(
slivers: [
CupertinoSliverNavigationBar.search(
stretch: true,
searchField: CupertinoSearchTextField(
suffixMode: OverlayVisibilityMode.always,
suffixIcon: Icon(
CupertinoIcons.mic_solid,
)),
largeTitle: Text('Lists'),
bottomMode: NavigationBarBottomMode.always,
),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return CupertinoListTile(
title: Text('Entry $index'),
);
},
childCount: 20,
),
),
],
),
),
);
}
}
```
</details>
2025-05-01 04:42:56 +00:00
Ramon Farizel
339f550081
Update CupertinoSliverNavigationBar Docs ( #167148 )
...
Update CupertinoSliverNavigationBar docs
https://github.com/flutter/flutter/issues/164137
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Mitchell Goodwin <58190796+MitchellGoodwin@users.noreply.github.com>
2025-04-30 18:45:56 +00:00
Victor Sanni
2deb3b4be0
CupertinoSliverNavigationBar.search fidelity updates ( #163089 )
...
## Native iOS overlaid on Flutter view
| Inactive search state | Active search state |
| --- | --- |
| <img alt="Screenshot 2025-02-11 at 3 31 40 PM"
src="https://github.com/user-attachments/assets/eefa539e-8e78-4047-8876-c16db26f59df "
/> | <img alt="Screenshot 2025-02-11 at 3 34 01 PM"
src="https://github.com/user-attachments/assets/2b4b9a20-5a99-493d-b343-ac38b039efa7 "
/> |
Animation curve and duration values gotten from xcode.
Addresses some of the issues in
https://github.com/flutter/flutter/issues/163020
2025-02-21 00:03:58 +00:00
Victor Sanni
41c3008afb
Support CupertinoSliverNavigationBar.search with condensed large title ( #159120 )
...
https://github.com/user-attachments/assets/70f48a0e-c87e-4399-ad7b-4dfac4376938
Fixes [Suggestion: CupertinoSliverNavigationBar allow forcing condensed
title](https://github.com/flutter/flutter/issues/59525 )
Fixes [Expose search field in
CupertinoSliverNavigationBar.search](https://github.com/flutter/flutter/issues/161556 )
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-02-07 19:02:24 +00:00
Michael Goderbauer
5491c8c146
Auto-format Framework ( #160545 )
...
This auto-formats all *.dart files in the repository outside of the
`engine` subdirectory and enforces that these files stay formatted with
a presubmit check.
**Reviewers:** Please carefully review all the commits except for the
one titled "formatted". The "formatted" commit was auto-generated by
running `dev/tools/format.sh -a -f`. The other commits were hand-crafted
to prepare the repo for the formatting change. I recommend reviewing the
commits one-by-one via the "Commits" tab and avoiding Github's "Files
changed" tab as it will likely slow down your browser because of the
size of this PR.
---------
Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
2024-12-19 20:06:21 +00:00
Kate Lovett
2c20325af4
Update CupertinoNavigationBar to support large layout ( #157133 )
...
Fixes https://github.com/flutter/flutter/issues/149625
This adds a new constructor CupertinoNavigationBar.large for the large style navigation bar. CupertinoSliverNavigationBar enables dynamically changing between the smaller and larger layouts for native iOS headers in response to scrolling, this change makes it possible to configure the static navigation bar in one style or the other.
2024-10-25 19:08:12 +00:00
Victor Sanni
f9eebe0319
Add bottom to CupertinoNavigationBar to allow for a double-row nav bar ( #155959 )
...
Fixes [Support segmented controls in nav bars and double row nav bars](https://github.com/flutter/flutter/issues/10469 )
<img width="270" height="600" alt="Screenshot 2024-09-30 at 3 09 04â¯PM" src="https://github.com/user-attachments/assets/4003116f-69dd-4f8f-a185-6ca151b74d2d ">
2024-10-16 19:36:55 +00:00
Victor Sanni
293ae2e5ab
Add bottom to CupertinoSliverNavigationBar ( #155841 )
...
Fixes [Support search box inside large title nav bar](https://github.com/flutter/flutter/issues/18103 )
Part of [Support segmented controls in nav bars and double row nav bars](https://github.com/flutter/flutter/issues/10469 )
## None mode (Current default)
https://github.com/user-attachments/assets/d798314e-940f-4311-9a9a-fe999c65f280
## Always mode
https://github.com/user-attachments/assets/950a85aa-8ca2-42ea-bf8b-3cb8f95e616e
## Automatic mode
https://github.com/user-attachments/assets/c7c7240b-d493-4036-a987-30f61d02bac3
## With CupertinoSlidingSegmentedControl
https://github.com/user-attachments/assets/59f4aec4-8d9c-4223-915b-97b73cb25dc8
<details>
<summary>Sample Code</summary>
```dart
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/cupertino.dart';
/// Flutter code sample for [CupertinoSliverNavigationBar].
void main() => runApp(const SliverNavBarApp());
class SliverNavBarApp extends StatelessWidget {
const SliverNavBarApp({super.key});
@override
Widget build(BuildContext context) {
return const CupertinoApp(
theme: CupertinoThemeData(brightness: Brightness.light),
home: SliverNavBarExample(),
);
}
}
class SliverNavBarExample extends StatelessWidget {
const SliverNavBarExample({super.key});
@override
Widget build(BuildContext context) {
return const CupertinoPageScaffold(
// A ScrollView that creates custom scroll effects using slivers.
child: SafeArea(
child: CustomScrollView(
// A list of sliver widgets.
slivers: <Widget>[
CupertinoSliverNavigationBar(
leading: SizedBox(
width: 100,
child: Row(
children: [
Icon(CupertinoIcons.back),
Text(
'Lists',
style: TextStyle(color: CupertinoColors.activeBlue),
),
],
),
),
trailing: Icon(CupertinoIcons.plus),
largeTitle: Text('iPhone'),
// Change to desired mode.
drawerMode: NavigationDrawerMode.none,
drawer: Padding(
padding: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 16.0),
child: CupertinoSearchTextField(),
),
),
SliverFillRemaining(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Text('Drag me up', textAlign: TextAlign.center),
],
),
),
],
),
),
);
}
}
```
</details>
2024-10-16 18:25:06 +00:00
ivirtex
ef40e3ea6f
Add CupertinoSliverNavigationBar
large title magnification on over scroll ( #110127 )
...
* Add magnification of CupertinoSliverNavigationBar large title
* Fix padding in maximum scale computation
* Apply magnification by using RenderBox
* Do not pass key to the superclass constructor
* Use `clampDouble` instead of `clamp` extension method
* Remove trailing whitespaces to make linter happy
* Name test variables more precisely
* Move transform computation to `performLayout` and implement `hitTestChildren`
* Address comments
* Address comments
* Address comments
* Update comment about scale
* Fix hit-testing
* Fix hit-testing again
* Make linter happy
* Implement magnifying without using LayoutBuilder
* Remove trailing spaces
* Add hit-testing of the large title
* Remove whitespaces
* Fix scale computation and some tests
* Fix remaining tests
* Refactor and fix comments
* Update comments
2022-12-08 17:15:09 +00:00
Taha Tesser
803f9959d8
Update Cupertino examples and add missing tests ( #103128 )
2022-05-07 00:29:10 -07:00
Taha Tesser
d80f3e3921
Cupertino examples improvements and clean up ( #103044 )
2022-05-05 08:22:53 +02:00
Taha Tesser
d1daa5ddc2
CupertinoSliverNavigationBar
: Add example (#99384 )
...
Part of #72926
2022-03-02 18:31:50 -08:00