Kishan Rathore 59ba3087e4
Deprecate: Mark AppBarTheme & AppBarThemeData color parameter as deprecated in favor of backgroundColor (#170624)
Deprecate: Mark AppBarTheme color parameter as deprecated in favor of
backgroundColor
fixes: #169918

## 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.

---------

Co-authored-by: Qun Cheng <36861262+QuncCccccc@users.noreply.github.com>
2025-07-02 18:22:32 +00:00

39 lines
1.6 KiB
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/material.dart';
void main() {
// Changes made in https://github.com/flutter/flutter/pull/86198
AppBarTheme appBarTheme = AppBarTheme();
appBarTheme = AppBarTheme(brightness: Brightness.light);
appBarTheme = AppBarTheme(brightness: Brightness.dark);
appBarTheme = AppBarTheme(error: '');
appBarTheme = appBarTheme.copyWith(error: '');
appBarTheme = appBarTheme.copyWith(brightness: Brightness.light);
appBarTheme = appBarTheme.copyWith(brightness: Brightness.dark);
appBarTheme.brightness;
TextTheme myTextTheme = TextTheme();
AppBarTheme appBarTheme = AppBarTheme();
appBarTheme = AppBarTheme(textTheme: myTextTheme);
appBarTheme = AppBarTheme(textTheme: myTextTheme);
appBarTheme = appBarTheme.copyWith(textTheme: myTextTheme);
appBarTheme = appBarTheme.copyWith(textTheme: myTextTheme);
AppBarTheme appBarTheme = AppBarTheme();
appBarTheme = AppBarTheme(backwardsCompatibility: true);
appBarTheme = AppBarTheme(backwardsCompatibility: false);
appBarTheme = appBarTheme.copyWith(backwardsCompatibility: true);
appBarTheme = appBarTheme.copyWith(backwardsCompatibility: false);
appBarTheme.backwardsCompatibility; // Removing field reference not supported.
AppBarTheme appBarTheme = AppBarTheme();
appBarTheme.color;
AppBarTheme appBarTheme = AppBarTheme(color: Colors.red);
AppBarThemeData appBarThemeData = AppBarThemeData(color: Colors.red);
}