Skip to content

Instantly share code, notes, and snippets.

@sbis04
Last active June 24, 2019 08:54
Show Gist options
  • Save sbis04/d83a4ad7f292ff9cceb1b8514d44ed42 to your computer and use it in GitHub Desktop.
Save sbis04/d83a4ad7f292ff9cceb1b8514d44ed42 to your computer and use it in GitHub Desktop.
flutter_os_main_done
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