Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/cupertino_ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT

* Updates minimum supported SDK version to Flutter 3.38/Dart 3.10.
* Fixes cross imports of `material_ui` in the `cupertino_ui` API examples.

## 0.0.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

// #region body
import 'package:cupertino_ui/cupertino_ui.dart';
import 'package:material_ui/material_ui.dart';

/// Flutter code sample for [CupertinoListTile].

Expand All @@ -25,37 +24,32 @@ class CupertinoListTileExample extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('CupertinoListTile Sample'),
),
navigationBar: const CupertinoNavigationBar(middle: Text('CupertinoListTile Sample')),
child: ListView(
children: const <Widget>[
CupertinoListTile(title: Text('One-line CupertinoListTile')),
CupertinoListTile(
leading: FlutterLogo(),
title: Text('One-line with leading widget'),
),
CupertinoListTile(leading: FlutterLogo(), title: Text('One-line with leading widget')),
CupertinoListTile(
title: Text('One-line with trailing widget'),
trailing: Icon(Icons.more_vert),
trailing: Icon(CupertinoIcons.ellipsis_vertical),
),
CupertinoListTile(
leading: FlutterLogo(),
title: Text('One-line with both widgets'),
trailing: Icon(Icons.more_vert),
trailing: Icon(CupertinoIcons.ellipsis_vertical),
),
CupertinoListTile(
leading: FlutterLogo(size: 56.0),
title: Text('Two-line CupertinoListTile'),
subtitle: Text('Here is a subtitle'),
trailing: Icon(Icons.more_vert),
additionalInfo: Icon(Icons.info),
trailing: Icon(CupertinoIcons.ellipsis_vertical),
additionalInfo: Icon(CupertinoIcons.info),
),
CupertinoListTile(
key: Key('CupertinoListTile with background color'),
leading: FlutterLogo(size: 56.0),
title: Text('CupertinoListTile with background color'),
backgroundColor: Colors.lightBlue,
backgroundColor: Color(0xFF0000FF),
),
],
),
Expand Down
1 change: 1 addition & 0 deletions packages/cupertino_ui/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies:
test: ^1.31.0
vector_math: ^2.2.0
web: ^1.1.1
cupertino_icons: ^1.0.9

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the examples were relying on the Material Icons, I opted to switch to CupertinoIcons to fix those cross imports.

cupertino_ui:
path: ..
material_ui:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since all cross-imports of material_ui have been removed from the cupertino_ui examples and tests, the material_ui dependency (and its path override) in pubspec.yaml is no longer needed and can be safely removed to keep the dependencies clean.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not true, since there are @docImports of material_ui, which this PR does not fix.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:material_ui/material_ui.dart';
import 'package:cupertino_ui_examples/context_menu/cupertino_context_menu.0.dart'
as example;
import 'package:cupertino_ui/cupertino_ui.dart';
import 'package:cupertino_ui_examples/context_menu/cupertino_context_menu.0.dart' as example;
import 'package:flutter_test/flutter_test.dart';

void main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:material_ui/material_ui.dart';
import 'package:cupertino_ui_examples/context_menu/cupertino_context_menu.1.dart'
as example;
import 'package:cupertino_ui/cupertino_ui.dart';
import 'package:cupertino_ui_examples/context_menu/cupertino_context_menu.1.dart' as example;
import 'package:flutter_test/flutter_test.dart';

void main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
// found in the LICENSE file.

import 'package:cupertino_ui/cupertino_ui.dart';
import 'package:material_ui/material_ui.dart';
import 'package:cupertino_ui_examples/list_tile/cupertino_list_tile.0.dart'
as example;
import 'package:cupertino_ui_examples/list_tile/cupertino_list_tile.0.dart' as example;
import 'package:flutter_test/flutter_test.dart';

void main() {
testWidgets('CupertinoListTile respects properties', (
WidgetTester tester,
) async {
testWidgets('CupertinoListTile respects properties', (WidgetTester tester) async {
await tester.pumpWidget(const example.CupertinoListTileApp());

expect(find.text('CupertinoListTile Sample'), findsOne);
Expand All @@ -26,17 +22,10 @@ void main() {
expect(find.text('Two-line CupertinoListTile'), findsOne);
expect(find.text('Here is a subtitle'), findsOne);
expect(find.text('CupertinoListTile with background color'), findsOne);
expect(find.byIcon(Icons.more_vert), findsNWidgets(3));
expect(find.byIcon(Icons.info), findsOne);
expect(find.byIcon(CupertinoIcons.ellipsis_vertical), findsNWidgets(3));
expect(find.byIcon(CupertinoIcons.info), findsOne);

final Finder tileWithBackgroundFinder = find.byKey(
const Key('CupertinoListTile with background color'),
);
expect(
tester
.firstWidget<CupertinoListTile>(tileWithBackgroundFinder)
.backgroundColor,
Colors.lightBlue,
);
final Finder tileWithBackgroundFinder = find.byKey(const Key('CupertinoListTile with background color'));
expect(tester.firstWidget<CupertinoListTile>(tileWithBackgroundFinder).backgroundColor, const Color(0xFF0000FF));
});
}
Loading