Last active
June 24, 2019 08:54
-
-
Save sbis04/d83a4ad7f292ff9cceb1b8514d44ed42 to your computer and use it in GitHub Desktop.
flutter_os_main_done
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( | |
title: 'Flutter Wear App', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: WatchScreen(), | |
debugShowCheckedModeBanner: false, | |
); | |
} | |
class WatchScreen extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) => WatchShape( | |
builder: (context, shape) => InheritedShape( | |
shape: shape, | |
child: AmbientMode( | |
builder: (context, mode) => | |
mode == Mode.active ? StartScreen() : AmbientWatchFace(), | |
), | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment