1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00

Migrate platform_channels to Material 3 (#1623)

* Migrate platform_channels to Material 3

* fix tests

---------

Co-authored-by: Brett Morgan <brettmorgan@google.com>
This commit is contained in:
Miguel Beltran
2023-02-06 04:57:43 +01:00
committed by GitHub
parent aa40931a0c
commit 0f70826a71
4 changed files with 8 additions and 7 deletions

View File

@@ -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);