wear 0.1.0 wear: ^0.1.0 copied to clipboard
A plugin that offers Flutter support for Wear OS by Google
import 'package:flutter/material.dart';
import 'package:wear/wear.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: WatchShape(
builder: (context, shape, child) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Shape: ${shape == WearShape.round ? 'round' : 'square'}',
),
child,
],
);
},
child: AmbientMode(
builder: (context, mode, child) {
return Text(
'Mode: ${mode == WearMode.active ? 'Active' : 'Ambient'}',
);
},
),
),
),
),
);
}
}