From 96b20933c22c611f9980373fceb062a0abb24f78 Mon Sep 17 00:00:00 2001 From: fuwa Date: Fri, 6 Nov 2020 13:01:20 +0000 Subject: [PATCH] use modern theme --- lolnode/lib/config/cyberwow.dart | 34 +++++++++-------------------- lolnode/lib/config/lolnode.dart | 36 ++++++++++--------------------- lolnode/lib/main.dart | 6 +++--- lolnode/lib/widget/exiting.dart | 6 +++--- lolnode/lib/widget/loading.dart | 6 +++--- lolnode/lib/widget/resyncing.dart | 2 +- lolnode/lib/widget/synced.dart | 16 +++++++------- lolnode/lib/widget/syncing.dart | 6 +++--- 8 files changed, 42 insertions(+), 70 deletions(-) diff --git a/lolnode/lib/config/cyberwow.dart b/lolnode/lib/config/cyberwow.dart index f772fe9..fe96a04 100644 --- a/lolnode/lib/config/cyberwow.dart +++ b/lolnode/lib/config/cyberwow.dart @@ -26,63 +26,49 @@ import 'prototype.dart'; // const crtGreen = Color.fromRGBO(0, 255, 102, 1); const crtGreen = Color.fromRGBO(51, 255, 51, 0.9); -final _theme = ThemeData -( +final _theme = ThemeData( brightness: Brightness.dark, - primaryColor: crtGreen, hintColor: Colors.yellow, accentColor: crtGreen, cursorColor: crtGreen, - backgroundColor: Colors.black, scaffoldBackgroundColor: Colors.black, - - textTheme: TextTheme - ( - display1: TextStyle - ( + textTheme: TextTheme( + headline4: TextStyle( fontFamily: 'RobotoMono', fontSize: 35, fontWeight: FontWeight.bold, ), - display2: TextStyle - ( + headline3: TextStyle( fontFamily: 'RobotoMono', fontSize: 22, ), - title: TextStyle - ( + headline6: TextStyle( fontFamily: 'VT323', fontSize: 22, ), - subhead: TextStyle - ( + subtitle1: TextStyle( fontFamily: 'RobotoMono', fontSize: 17, fontWeight: FontWeight.bold, ), - body1: TextStyle - ( + bodyText2: TextStyle( fontFamily: 'VT323', fontSize: 17, height: 1, ), - body2: TextStyle - ( + bodyText1: TextStyle( fontFamily: 'RobotoMono', fontSize: 12.5, ), - ).apply - ( + ).apply( bodyColor: crtGreen, displayColor: crtGreen, ), ); - -final config = CryptoConfig -( +final config = CryptoConfig( 'liblolnerod.so', 'wownerod', 'Is this a test, sir?', diff --git a/lolnode/lib/config/lolnode.dart b/lolnode/lib/config/lolnode.dart index 6a6a834..1ee2f85 100644 --- a/lolnode/lib/config/lolnode.dart +++ b/lolnode/lib/config/lolnode.dart @@ -26,63 +26,49 @@ import 'prototype.dart'; // const crtGreen = Color.fromRGBO(0, 255, 102, 1); const crtGreen = Color.fromRGBO(51, 255, 51, 0.9); -final _theme = ThemeData -( +final _theme = ThemeData( brightness: Brightness.dark, - primaryColor: crtGreen, hintColor: Colors.yellow, accentColor: crtGreen, cursorColor: crtGreen, - backgroundColor: Colors.black, scaffoldBackgroundColor: Colors.black, - - textTheme: TextTheme - ( - display1: TextStyle - ( + textTheme: TextTheme( + headline4: TextStyle( fontFamily: 'RobotoMono', fontSize: 35, fontWeight: FontWeight.bold, ), - display2: TextStyle - ( + headline3: TextStyle( fontFamily: 'RobotoMono', fontSize: 22, ), - title: TextStyle - ( + headline6: TextStyle( fontFamily: 'VT323', fontSize: 22, ), - subhead: TextStyle - ( + subtitle1: TextStyle( fontFamily: 'RobotoMono', fontSize: 17, fontWeight: FontWeight.bold, ), - body1: TextStyle - ( + bodyText2: TextStyle( fontFamily: 'VT323', fontSize: 17, height: 1, ), - body2: TextStyle - ( + bodyText1: TextStyle( fontFamily: 'RobotoMono', fontSize: 12.5, ), - ).apply - ( + ).apply( bodyColor: crtGreen, displayColor: crtGreen, ), ); - -final config = CryptoConfig -( +final config = CryptoConfig( 'liblolnerod.so', 'lolnerod', 'Is this a test, sir?', @@ -96,4 +82,4 @@ final config = CryptoConfig ], '[1337@lol]: ', 6, -); \ No newline at end of file +); diff --git a/lolnode/lib/main.dart b/lolnode/lib/main.dart index 8719244..98d74ef 100644 --- a/lolnode/lib/main.dart +++ b/lolnode/lib/main.dart @@ -51,14 +51,14 @@ class CyberWOW_App extends StatelessWidget { title: 'CyberWOW', theme: config.c.theme, darkTheme: config.c.theme, - home: CyberWOW_Page(title: 'CyberWOW'), + home: CyberWOW_Page(headline6: 'CyberWOW'), ); } } class CyberWOW_Page extends StatefulWidget { - CyberWOW_Page({Key key, this.title}) : super(key: key); - final String title; + CyberWOW_Page({Key key, this.headline6}) : super(key: key); + final String headline6; @override _CyberWOW_PageState createState() => _CyberWOW_PageState(); diff --git a/lolnode/lib/widget/exiting.dart b/lolnode/lib/widget/exiting.dart index 3a6250a..5577792 100644 --- a/lolnode/lib/widget/exiting.dart +++ b/lolnode/lib/widget/exiting.dart @@ -27,8 +27,8 @@ Widget build(BuildContext context, ExitingState state) { return Scaffold( // appBar: AppBar // ( - // // title: Text(widget.title), - // title: Text('CyberWOW'), + // // headline6: Text(widget.headline6), + // headline6: Text('CyberWOW'), // ), body: Container( // padding: const EdgeInsets.all(10.0), @@ -44,7 +44,7 @@ Widget build(BuildContext context, ExitingState state) { reverse: true, child: Text( state.stdout.join(), - style: Theme.of(context).textTheme.body1, + style: Theme.of(context).textTheme.bodyText2, ))) ], ), diff --git a/lolnode/lib/widget/loading.dart b/lolnode/lib/widget/loading.dart index 7320bc5..566c800 100644 --- a/lolnode/lib/widget/loading.dart +++ b/lolnode/lib/widget/loading.dart @@ -26,8 +26,8 @@ import '../state.dart'; Widget build(BuildContext context, LoadingState state) { return Scaffold( // appBar: AppBar( - // // title: Text(widget.title), - // title: Text('WOW'), + // // headline6: Text(widget.headline6), + // headline6: Text('WOW'), // ), body: Container( padding: const EdgeInsets.all(40.0), @@ -41,7 +41,7 @@ Widget build(BuildContext context, LoadingState state) { ), Text( state.status, - style: Theme.of(context).textTheme.title, + style: Theme.of(context).textTheme.headline6, ), Spacer( flex: 1, diff --git a/lolnode/lib/widget/resyncing.dart b/lolnode/lib/widget/resyncing.dart index 33172a3..05daa7c 100644 --- a/lolnode/lib/widget/resyncing.dart +++ b/lolnode/lib/widget/resyncing.dart @@ -36,7 +36,7 @@ Widget build(BuildContext context, ReSyncingState state) { flex: 5, child: Text( state.stdout.last, - style: Theme.of(context).textTheme.body1, + style: Theme.of(context).textTheme.bodyText2, )), ]; diff --git a/lolnode/lib/widget/synced.dart b/lolnode/lib/widget/synced.dart index 61fabd8..4b34bf5 100644 --- a/lolnode/lib/widget/synced.dart +++ b/lolnode/lib/widget/synced.dart @@ -63,7 +63,7 @@ Widget summary(BuildContext context, SyncedState state) { duration: Duration(milliseconds: 500), child: Text( height, - style: Theme.of(context).textTheme.display1, + style: Theme.of(context).textTheme.headline4, key: ValueKey(state.height), ), ), @@ -83,7 +83,7 @@ Widget summary(BuildContext context, SyncedState state) { duration: Duration(milliseconds: 500), child: Text( txNotice, - style: Theme.of(context).textTheme.body2, + style: Theme.of(context).textTheme.bodyText1, key: ValueKey(poolLength), ), ), @@ -105,7 +105,7 @@ Widget summary(BuildContext context, SyncedState state) { ); } -Widget rpcView(BuildContext context, String title, String body) { +Widget rpcView(BuildContext context, String headline6, String body) { return Container( padding: const EdgeInsets.all(10.0), child: Align( @@ -124,8 +124,8 @@ Widget rpcView(BuildContext context, String title, String body) { margin: const EdgeInsets.only(bottom: 15), ), Text( - title, - style: Theme.of(context).textTheme.display1, + headline6, + style: Theme.of(context).textTheme.headline4, ), Container( height: 1, @@ -134,7 +134,7 @@ Widget rpcView(BuildContext context, String title, String body) { ), Text( body, - style: Theme.of(context).textTheme.body2, + style: Theme.of(context).textTheme.bodyText1, ) ], ))) @@ -163,7 +163,7 @@ Widget getConnections(BuildContext context, SyncedState state) { return rpcView(context, 'peers' + subTitle, state.getConnectionsCache); } -Widget terminalView(BuildContext context, String title, SyncedState state) { +Widget terminalView(BuildContext context, String headline6, SyncedState state) { final input = TextFormField( controller: state.textController, textInputAction: TextInputAction.next, @@ -228,7 +228,7 @@ Widget terminalView(BuildContext context, String title, SyncedState state) { children: [ Text( state.stdout.join('\n'), - style: Theme.of(context).textTheme.body2, + style: Theme.of(context).textTheme.bodyText1, ) ], ))), diff --git a/lolnode/lib/widget/syncing.dart b/lolnode/lib/widget/syncing.dart index 0bf07a7..83c72fd 100644 --- a/lolnode/lib/widget/syncing.dart +++ b/lolnode/lib/widget/syncing.dart @@ -27,8 +27,8 @@ Widget build(BuildContext context, SyncingState state) { return Scaffold( // appBar: AppBar // ( - // // title: Text(widget.title), - // title: Text('CyberWOW'), + // // headline6: Text(widget.headline6), + // headline6: Text('CyberWOW'), // ), body: Container( // padding: const EdgeInsets.all(10.0), @@ -44,7 +44,7 @@ Widget build(BuildContext context, SyncingState state) { reverse: true, child: Text( state.stdout.join('\n'), - style: Theme.of(context).textTheme.body1, + style: Theme.of(context).textTheme.bodyText2, ))), ], ),