All checks were successful
ci/woodpecker/push/build Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@posteo.com>
31 lines
831 B
Dart
31 lines
831 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import '../application/test_controller.dart';
|
|
|
|
class PingPage extends ConsumerWidget {
|
|
const PingPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final state = ref.watch(pingControllerProvider);
|
|
|
|
return Scaffold(
|
|
appBar: AppBar(title: const Text('gRPC Ping')),
|
|
body: Center(
|
|
child: state.when(
|
|
data: (value) => Text(value),
|
|
loading: () => const CircularProgressIndicator(),
|
|
error: (e, _) => Text('Error: $e'),
|
|
),
|
|
),
|
|
floatingActionButton: FloatingActionButton(
|
|
onPressed: () {
|
|
ref.read(pingControllerProvider.notifier).ping();
|
|
},
|
|
child: const Icon(Icons.send),
|
|
),
|
|
);
|
|
}
|
|
}
|