This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'dart:async'; | |
import 'package:audioplayers/audio_cache.dart'; | |
import 'package:audioplayers/audioplayers.dart'; | |
const img = 'assets/images/'; | |
class PlayRoute extends StatefulWidget { | |
final String sound; | |
const PlayRoute({Key key, this.sound}) : super(key: key); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_os/screens/ambient_screen.dart'; | |
import 'package:flutter_os/screens/relax_menu.dart'; | |
import 'package:wear/wear.dart'; | |
class NameScreen extends StatelessWidget { | |
final screenHeight; | |
final screenWidth; | |
NameScreen(this.screenHeight, this.screenWidth); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double boxInsetLength(double radius) => radius * 1.4142; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_os/screens/name_screen.dart'; | |
import 'package:flutter_os/utils.dart'; | |
import 'package:wear/wear.dart'; | |
class StartScreen extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
backgroundColor: Colors.white, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WatchShape( | |
builder: (context, shape) { | |
var screenSize = MediaQuery.of(context).size; | |
final shape = InheritedShape.of(context).shape; | |
if (shape == Shape.round) { | |
// boxInsetLength requires radius, so divide by 2 | |
screenSize = Size(boxInsetLength(screenSize.width / 2), | |
boxInsetLength(screenSize.height / 2)); | |
} | |
var screenHeight = screenSize.height; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class AmbientWatchFace extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) => Scaffold( | |
backgroundColor: Colors.black, | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
crossAxisAlignment: CrossAxisAlignment.center, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_os/screens/ambient_screen.dart'; | |
import 'package:flutter_os/screens/start_screen.dart'; | |
import 'package:wear/wear.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) => MaterialApp( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:wear/wear.dart'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity: FlutterActivity(), AmbientMode.AmbientCallbackProvider { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
GeneratedPluginRegistrant.registerWith(this) | |
// Wire up the activity for ambient callbacks | |
AmbientMode.attachAmbientSupport(this) | |
} | |
override fun getAmbientCallback(): AmbientMode.AmbientCallback { |