Add macOS support (#23)
* Add macOS support * Update README * Update to v0.2.0 * Document breaking changes * Delete widget tests
This commit is contained in:
@@ -19,7 +19,7 @@ class _IdleViewState extends State<IdleView> {
|
||||
@override
|
||||
void initState() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
context.read<AppService>().getSavedIOSDeviceName().then((value) {
|
||||
context.read<AppService>().getSavedDarwinDeviceName().then((value) {
|
||||
controller.text = value;
|
||||
controller.selection = TextSelection.collapsed(offset: value.length);
|
||||
setState(() {
|
||||
@@ -56,7 +56,7 @@ class _IdleViewState extends State<IdleView> {
|
||||
return Center(
|
||||
child: Column(
|
||||
children: [
|
||||
if (Platform.isIOS)
|
||||
if (Platform.isIOS || Platform.isMacOS)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 10.0),
|
||||
child: TextFormField(
|
||||
|
||||
@@ -19,7 +19,7 @@ class ReadyView extends StatelessWidget {
|
||||
title: 'Start discover peers',
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
if (Platform.isIOS)
|
||||
if (Platform.isIOS || Platform.isMacOS)
|
||||
ActionButton(
|
||||
onTap: () {
|
||||
context.read<AppService>().updateState(AppState.selectClientType);
|
||||
|
||||
@@ -34,8 +34,8 @@ class _PeersBody extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Selector<AppService, bool>(
|
||||
selector: (context, service) => service.isIOSBrowser,
|
||||
builder: (context, isIOSBrowser, _) {
|
||||
selector: (context, service) => service.isDarwinBrowser,
|
||||
builder: (context, isDarwinBrowser, _) {
|
||||
return Selector<AppService, List<NearbyDevice>?>(
|
||||
selector: (context, service) => service.peers,
|
||||
builder: (context, peers, _) {
|
||||
@@ -55,7 +55,7 @@ class _PeersBody extends StatelessWidget {
|
||||
],
|
||||
)
|
||||
: Text(
|
||||
Platform.isAndroid || isIOSBrowser
|
||||
Platform.isAndroid || isDarwinBrowser
|
||||
? 'No one here ('
|
||||
: "Wait until someone invites you!",
|
||||
textAlign: TextAlign.center,
|
||||
|
||||
Reference in New Issue
Block a user