Files
nearby_service/example_full/lib/presentation/view/ready_view.dart
T
Ben Hagen abe519dae7 Add macOS support (#23)
* Add macOS support

* Update README

* Update to v0.2.0

* Document breaking changes

* Delete widget tests
2025-05-13 16:24:58 +02:00

34 lines
991 B
Dart

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:nearby_service_example_full/domain/app_service.dart';
import 'package:nearby_service_example_full/domain/app_state.dart';
import 'package:nearby_service_example_full/uikit/uikit.dart';
import 'package:provider/provider.dart';
class ReadyView extends StatelessWidget {
const ReadyView({super.key});
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
ActionButton(
onTap: context.read<AppService>().discover,
title: 'Start discover peers',
),
const SizedBox(height: 10),
if (Platform.isIOS || Platform.isMacOS)
ActionButton(
onTap: () {
context.read<AppService>().updateState(AppState.selectClientType);
},
title: 'Reselect client type',
type: ActionType.warning,
),
],
);
}
}