Migrate `platform_channels` to Material 3 (#1623)

* Migrate platform_channels to Material 3

* fix tests

---------

Co-authored-by: Brett Morgan <brettmorgan@google.com>
pull/1633/head
Miguel Beltran 3 years ago committed by GitHub
parent aa40931a0c
commit 0f70826a71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,6 +25,7 @@ class PlatformChannelSample extends StatelessWidget {
snackBarTheme: SnackBarThemeData(
backgroundColor: Colors.blue[500],
),
useMaterial3: true,
),
routerConfig: router(),
);

@ -7,7 +7,7 @@ import 'package:flutter/services.dart';
import 'package:platform_channels/src/counter_method_channel.dart';
/// The widget demonstrates how to use [MethodChannel] to invoke platform methods.
/// It has two [ElevatedButton]s to increment and decrement the value of
/// It has two [FilledButton]s to increment and decrement the value of
/// [count], and a [Text] widget to display its value.
class MethodChannelDemo extends StatefulWidget {
const MethodChannelDemo({super.key});
@ -38,9 +38,9 @@ class _MethodChannelDemoState extends State<MethodChannelDemo> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
// Whenever users press the ElevatedButton, it invokes
// Whenever users press the FilledButton, it invokes
// Counter.increment method to increment the value of count.
ElevatedButton.icon(
FilledButton.icon(
onPressed: () async {
try {
final value = await Counter.increment(counterValue: count);
@ -56,9 +56,9 @@ class _MethodChannelDemoState extends State<MethodChannelDemo> {
label: const Text('Increment'),
),
// Whenever users press the ElevatedButton, it invokes
// Whenever users press the FilledButton, it invokes
// Counter.decrement method to decrement the value of count.
ElevatedButton.icon(
FilledButton.icon(
onPressed: () async {
try {
final value = await Counter.decrement(counterValue: count);

@ -60,7 +60,7 @@ class _PlatformImageDemoState extends State<PlatformImageDemo> {
const SizedBox(
height: 16,
),
ElevatedButton(
FilledButton(
onPressed: imageData != null
? null
: () {

@ -29,7 +29,7 @@ void main() {
expect(find.byType(Image), findsNothing);
// Tap on ElevatedButton to get Image.
await tester.tap(find.byType(ElevatedButton));
await tester.tap(find.byType(FilledButton));
await tester.pumpAndSettle();
expect(find.byType(Placeholder), findsNothing);

Loading…
Cancel
Save