time_text 0.1.0-nullsafety.0 time_text: ^0.1.0-nullsafety.0 copied to clipboard
A time text widget. You can use it to show current time.
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:wakelock/wakelock.dart';
import 'package:time_text/time_text.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
SystemChrome.setEnabledSystemUIOverlays([]);
Wakelock.enable();
return MaterialApp(
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
MyHomePage({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
body: Center(
child: TimeText(
style: TextStyle(
fontSize: 100,
fontWeight: FontWeight.bold,
color: Colors.lightBlue),
),
),
);
}
}