Compare commits

..

No commits in common. 'b208dfd21f1c283acfec5a6be2858a79643ccce4' and 'ebd663f782cfc10499186234659cc0088cd1e60c' have entirely different histories.

@ -17,7 +17,7 @@ class MyApp extends StatelessWidget {
return MaterialApp( return MaterialApp(
title: 'PowerLogger\nDemo', title: 'PowerLogger\nDemo',
home: MyHomePage(title: 'PowerLogger Demo'), home: MyHomePage(title: 'PowerLogger Demo'),
theme: ThemeData.dark(), //theme: ThemeData.dark(),
); );
} }
} }

@ -5,121 +5,121 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.7.0" version: "2.6.1"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.1" version: "1.2.0"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.15.0" version: "1.15.0"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.3" version: "1.0.2"
device_info_plus: device_info_plus:
dependency: transitive dependency: transitive
description: description:
name: device_info_plus name: device_info_plus
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.0.1"
device_info_plus_linux: device_info_plus_linux:
dependency: transitive dependency: transitive
description: description:
name: device_info_plus_linux name: device_info_plus_linux
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.0.0"
device_info_plus_macos: device_info_plus_macos:
dependency: transitive dependency: transitive
description: description:
name: device_info_plus_macos name: device_info_plus_macos
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.0.0"
device_info_plus_platform_interface: device_info_plus_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: device_info_plus_platform_interface name: device_info_plus_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.0.0"
device_info_plus_web: device_info_plus_web:
dependency: transitive dependency: transitive
description: description:
name: device_info_plus_web name: device_info_plus_web
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.0.0"
device_info_plus_windows: device_info_plus_windows:
dependency: transitive dependency: transitive
description: description:
name: device_info_plus_windows name: device_info_plus_windows
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.0.0"
dio: dio:
dependency: "direct main" dependency: "direct main"
description: description:
name: dio name: dio
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.0.0" version: "4.0.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
ffi: ffi:
dependency: transitive dependency: transitive
description: description:
name: ffi name: ffi
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.2" version: "1.0.0"
file: file:
dependency: transitive dependency: transitive
description: description:
name: file name: file
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "6.1.2" version: "6.1.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -129,7 +129,7 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: flutter_highlight name: flutter_highlight
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.7.0" version: "0.7.0"
flutter_test: flutter_test:
@ -146,121 +146,121 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: get name: get
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.3.8" version: "4.1.4"
highlight: highlight:
dependency: transitive dependency: transitive
description: description:
name: highlight name: highlight
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.7.0" version: "0.7.0"
http: http:
dependency: transitive dependency: transitive
description: description:
name: http name: http
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.13.3" version: "0.13.1"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
name: http_parser name: http_parser
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.0.0" version: "4.0.0"
js: js:
dependency: transitive dependency: transitive
description: description:
name: js name: js
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.6.3" version: "0.6.3"
logger: logger:
dependency: transitive dependency: transitive
description: description:
name: logger name: logger
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.0.0"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.10" version: "0.12.10"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.4.0" version: "1.3.0"
package_info_plus: package_info_plus:
dependency: transitive dependency: transitive
description: description:
name: package_info_plus name: package_info_plus
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.6" version: "1.0.3"
package_info_plus_linux: package_info_plus_linux:
dependency: transitive dependency: transitive
description: description:
name: package_info_plus_linux name: package_info_plus_linux
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.3" version: "1.0.0"
package_info_plus_macos: package_info_plus_macos:
dependency: transitive dependency: transitive
description: description:
name: package_info_plus_macos name: package_info_plus_macos
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.1" version: "1.1.0"
package_info_plus_platform_interface: package_info_plus_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: package_info_plus_platform_interface name: package_info_plus_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.2" version: "1.0.0"
package_info_plus_web: package_info_plus_web:
dependency: transitive dependency: transitive
description: description:
name: package_info_plus_web name: package_info_plus_web
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.4" version: "1.0.2"
package_info_plus_windows: package_info_plus_windows:
dependency: transitive dependency: transitive
description: description:
name: package_info_plus_windows name: package_info_plus_windows
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.3" version: "1.0.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0" version: "1.8.0"
pedantic: pedantic:
dependency: transitive dependency: transitive
description: description:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.11.1" version: "1.11.0"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.1" version: "2.0.0"
power_logger: power_logger:
dependency: "direct main" dependency: "direct main"
description: description:
@ -277,65 +277,65 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.1" version: "1.8.1"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.10.0" version: "1.10.0"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.4.1" version: "0.3.0"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
win32: win32:
dependency: transitive dependency: transitive
description: description:
name: win32 name: win32
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.2.9" version: "2.0.5"
sdks: sdks:
dart: ">=2.13.0 <3.0.0" dart: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0" flutter: ">=1.20.0"

@ -6,7 +6,6 @@ import 'package:power_logger/src/view/dio_error_view.dart';
class DioErrorBuilder extends StatelessWidget { class DioErrorBuilder extends StatelessWidget {
final DioError data; final DioError data;
final DateTime date; final DateTime date;
DioErrorBuilder({Key? key, required this.data, required this.date}) DioErrorBuilder({Key? key, required this.data, required this.date})
: super(key: key); : super(key: key);
@ -22,14 +21,14 @@ class DioErrorBuilder extends StatelessWidget {
), ),
); );
}, },
title: Text(data.requestOptions.path), title: Text(data.requestOptions.path,style: TextStyle(fontSize: 16,color: Color(0xFF333333)),),
subtitle: Text('${data.message}\n$date'), subtitle: Text('${data.message}\n$date',style: TextStyle(fontSize: 14,color: Color(0xFF666666)),),
trailing: Row( trailing: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Chip( Chip(
backgroundColor: Colors.blue.withOpacity(0.4), backgroundColor: Colors.blue.withOpacity(0.4),
label: Text(data.requestOptions.method), label: Text(data.requestOptions.method,style: TextStyle(fontSize: 14,color: Colors.black),),
), ),
], ],
), ),

@ -18,14 +18,14 @@ class DioResponseBuilder extends StatelessWidget {
builder: (context) => DioResponseView(data: data), builder: (context) => DioResponseView(data: data),
), ),
), ),
title: Text(data.requestOptions.path), title: Text(data.requestOptions.path,style: TextStyle(fontSize: 16,color: Color(0xFF333333)),),
subtitle: Text(date.toString()), subtitle: Text(date.toString(),style: TextStyle(fontSize: 14,color: Color(0xFF666666)),),
trailing: Row( trailing: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Chip( Chip(
backgroundColor: Colors.blue.withOpacity(0.8), backgroundColor: Colors.blue.withOpacity(0.8),
label: Text(data.requestOptions.method), label: Text(data.requestOptions.method,style: TextStyle(fontSize: 14,color: Colors.black),),
), ),
], ],
), ),

@ -9,8 +9,8 @@ class FlutterErrorBuilder extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListTile( return ListTile(
tileColor: Colors.red.withOpacity(0.4), tileColor: Colors.red.withOpacity(0.4),
title: Text(details.exception.toString()), title: Text(details.exception.toString(),style: TextStyle(fontSize: 14,color: Colors.black),),
trailing: Chip(label: Text('EXCEPTION'), backgroundColor: Colors.red), trailing: Chip(label: Text('EXCEPTION',style: TextStyle(fontSize: 14,color: Colors.black),), backgroundColor: Colors.red),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,

@ -1,39 +1,32 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:power_logger/src/theme/custom_theme.dart';
/// UnfocusParser /// UnfocusParser
class UnfocusParser extends StatelessWidget { class UnfocusParser extends StatelessWidget {
final dynamic data; final dynamic data;
final String? tag; final String? tag;
const UnfocusParser({Key? key, required this.data, this.tag}) const UnfocusParser({Key? key, required this.data, this.tag})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Material( return Material(
color: Theme.of(context).brightness == Brightness.light color: Colors.white10,
? Colors.black12
: Colors.white10,
child: ListTile( child: ListTile(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => Theme( builder: (context) => Scaffold(
data: CustomTheme.instance.customTheme ?? Theme.of(context),
child: Scaffold(
appBar: AppBar(title: Text(data.runtimeType.toString())), appBar: AppBar(title: Text(data.runtimeType.toString())),
body: Text(data.toString()), body: Text(data.toString(),style: TextStyle(fontSize: 16,color: Colors.black),),
),
), ),
), ),
), ),
title: Text( title: Text(
data.toString(), data.toString(),
maxLines: 1, maxLines: 1, style: TextStyle(fontSize: 16,color: Colors.black),
), ),
trailing: Chip( trailing: Chip(
label: Text(tag ?? data.runtimeType.toString()), label: Text(tag ?? data.runtimeType.toString(),style: TextStyle(fontSize: 16,color: Colors.black),),
), ),
), ),
); );

@ -1,6 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:power_logger/power_logger.dart'; import 'package:power_logger/power_logger.dart';
import 'package:power_logger/src/theme/custom_theme.dart';
import 'package:power_logger/src/views/info_view.dart'; import 'package:power_logger/src/views/info_view.dart';
import 'package:power_logger/src/views/logger_view.dart'; import 'package:power_logger/src/views/logger_view.dart';
import 'package:power_logger/src/views/settings_view.dart'; import 'package:power_logger/src/views/settings_view.dart';
@ -17,14 +16,12 @@ class _PowerLoggerViewState extends State<PowerLoggerView> {
PageController _pageController = PageController(); PageController _pageController = PageController();
int _currentIndex = 0; int _currentIndex = 0;
void Function(void Function())? _setState; void Function(void Function())? _setState;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Theme( return Scaffold(
data: CustomTheme.instance.customTheme ?? Theme.of(context),
child: Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text('Logger View'), title: Text('Logger View'),
backgroundColor: Colors.blue,
actions: [ actions: [
IconButton( IconButton(
icon: Icon(Icons.clear_all_rounded), icon: Icon(Icons.clear_all_rounded),
@ -44,16 +41,19 @@ class _PowerLoggerViewState extends State<PowerLoggerView> {
children: [ children: [
LoggerView(), LoggerView(),
InfoView(), InfoView(),
SettingsView( SettingsView(),
stateRefresh: () => setState(() {}),
),
], ],
), ),
bottomNavigationBar: StatefulBuilder( bottomNavigationBar: StatefulBuilder(
builder: (context, kSetState) { builder: (context, kSetState) {
_setState = kSetState; _setState = kSetState;
return BottomNavigationBar( return BottomNavigationBar(
backgroundColor: Colors.white,
currentIndex: _currentIndex, currentIndex: _currentIndex,
selectedLabelStyle: TextStyle(fontSize: 14),
selectedItemColor: Colors.blue,
unselectedItemColor: Color(0xFF666666),
unselectedLabelStyle: TextStyle(fontSize: 12),
onTap: (index) { onTap: (index) {
_currentIndex = index; _currentIndex = index;
kSetState(() {}); kSetState(() {});
@ -65,20 +65,19 @@ class _PowerLoggerViewState extends State<PowerLoggerView> {
}, },
items: [ items: [
BottomNavigationBarItem( BottomNavigationBarItem(
icon: Icon(Icons.assessment), label: 'Log'), icon: Icon(Icons.assessment,color: Color(0xFF666666),),activeIcon: Icon(Icons.assessment,color: Colors.blue,), label: '日志'),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: Icon(Icons.perm_device_information), icon: Icon(Icons.perm_device_information,color: Color(0xFF666666),),activeIcon: Icon(Icons.perm_device_information,color: Colors.blue,),
label: 'Info', label: '信息',
), ),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: Icon(Icons.settings), icon: Icon(Icons.settings,color: Color(0xFF666666),),activeIcon: Icon(Icons.settings,color: Colors.blue,),
label: 'Settings', label: '设置',
), ),
], ],
); );
}, },
), ),
),
); );
} }
} }

@ -1,24 +0,0 @@
import 'package:flutter/material.dart';
class CustomTheme {
factory CustomTheme() => _instance;
static CustomTheme get instance => _instance;
static late CustomTheme _instance = CustomTheme._();
CustomTheme._() {
follow = true;
}
ThemeData? customTheme;
late bool follow;
void setThemeData(bool state) {
follow = state;
if (follow) {
customTheme = null;
} else {
customTheme = ThemeData.light();
}
}
}

@ -21,12 +21,12 @@ class BoxView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
DefaultTextStyle( DefaultTextStyle(
style: Theme.of(context).textTheme.caption!, style: TextStyle(fontSize: 16,color: Colors.red),
child: title, child: title,
), ),
child == null ? SizedBox() : SizedBox(height: 10), child == null ? SizedBox() : SizedBox(height: 10),
DefaultTextStyle( DefaultTextStyle(
style: Theme.of(context).textTheme.bodyText2!, style: TextStyle(fontSize: 15,color: Color(0xFF333333)),
child: child ?? SizedBox(), child: child ?? SizedBox(),
), ),
children == null ? SizedBox() : SizedBox(height: 10), children == null ? SizedBox() : SizedBox(height: 10),

@ -1,7 +1,6 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:power_logger/src/theme/custom_theme.dart';
import 'package:power_logger/src/view/box_view.dart'; import 'package:power_logger/src/view/box_view.dart';
import 'package:power_logger/src/view/table_view.dart'; import 'package:power_logger/src/view/table_view.dart';
import 'package:power_logger/src/view/title_view.dart'; import 'package:power_logger/src/view/title_view.dart';
@ -67,9 +66,7 @@ class _DioErrorViewState extends State<DioErrorView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Theme( return Scaffold(
data: CustomTheme.instance.customTheme ?? Theme.of(context),
child: Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Theme.of(context).brightness == Brightness.light backgroundColor: Theme.of(context).brightness == Brightness.light
? Colors.red[100] ? Colors.red[100]
@ -97,7 +94,6 @@ class _DioErrorViewState extends State<DioErrorView> {
_buildStatus(), _buildStatus(),
], ],
), ),
),
); );
} }
} }

@ -7,7 +7,6 @@ import 'package:flutter_highlight/themes/atom-one-dark.dart';
import 'package:flutter_highlight/themes/atom-one-light.dart'; import 'package:flutter_highlight/themes/atom-one-light.dart';
import 'package:power_logger/external_lib/pretty_json.dart'; import 'package:power_logger/external_lib/pretty_json.dart';
import 'package:power_logger/src/parser/dio_parser/dio_parser.dart'; import 'package:power_logger/src/parser/dio_parser/dio_parser.dart';
import 'package:power_logger/src/theme/custom_theme.dart';
import 'package:power_logger/src/view/box_view.dart'; import 'package:power_logger/src/view/box_view.dart';
import 'package:power_logger/src/view/table_view.dart'; import 'package:power_logger/src/view/table_view.dart';
import 'package:power_logger/src/view/title_view.dart'; import 'package:power_logger/src/view/title_view.dart';
@ -80,9 +79,8 @@ class _DioResponseViewState extends State<DioResponseView> {
child: HighlightView( child: HighlightView(
widget.data!.data, widget.data!.data,
language: _dioParser.highlight, language: _dioParser.highlight,
theme: Theme.of(context).brightness == Brightness.light theme: atomOneLightTheme
? atomOneLightTheme ,
: atomOneDarkTheme,
), ),
); );
case ContentType.JSON: case ContentType.JSON:
@ -151,9 +149,7 @@ class _DioResponseViewState extends State<DioResponseView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Theme( return Scaffold(
data: CustomTheme.instance.customTheme ?? Theme.of(context),
child: Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.green[600], backgroundColor: Colors.green[600],
title: Text(widget.data!.requestOptions.path), title: Text(widget.data!.requestOptions.path),
@ -195,7 +191,6 @@ class _DioResponseViewState extends State<DioResponseView> {
), ),
], ],
), ),
),
); );
} }
} }

@ -1,9 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:power_logger/src/theme/custom_theme.dart';
class FlutterErrorView extends StatefulWidget { class FlutterErrorView extends StatefulWidget {
final FlutterErrorDetails details; final FlutterErrorDetails details;
FlutterErrorView({Key? key, required this.details}) : super(key: key); FlutterErrorView({Key? key, required this.details}) : super(key: key);
@override @override
@ -24,9 +22,7 @@ class _FlutterErrorViewState extends State<FlutterErrorView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Theme( return Scaffold(
data: CustomTheme.instance.customTheme ?? Theme.of(context),
child: Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text('Flutter Error'), title: Text('Flutter Error'),
), ),
@ -56,7 +52,6 @@ class _FlutterErrorViewState extends State<FlutterErrorView> {
), ),
], ],
), ),
),
); );
} }
} }

@ -9,7 +9,7 @@ class TitleView extends StatelessWidget {
return Padding( return Padding(
padding: EdgeInsets.symmetric(horizontal: 5, vertical: 10), padding: EdgeInsets.symmetric(horizontal: 5, vertical: 10),
child: DefaultTextStyle( child: DefaultTextStyle(
style: Theme.of(context).textTheme.headline4!, style: TextStyle(fontSize: 26,color: Color(0xFF666666)),
child: title, child: title,
), ),
); );

@ -71,8 +71,8 @@ class _InfoViewState extends State<InfoView>
SliverList( SliverList(
delegate: SliverChildListDelegate([ delegate: SliverChildListDelegate([
ListTile( ListTile(
title: Text('Package Info'), title: Text('Package Info',style: TextStyle(fontSize: 18,color: Color(0xff333333))),
tileColor: Theme.of(context).accentColor.withOpacity(0.2), tileColor: Colors.blue.withOpacity(0.2),
), ),
InfoTile(title: 'appName', subTitle: packageInfo!.appName), InfoTile(title: 'appName', subTitle: packageInfo!.appName),
InfoTile( InfoTile(
@ -81,8 +81,8 @@ class _InfoViewState extends State<InfoView>
title: 'packageName', subTitle: packageInfo!.packageName), title: 'packageName', subTitle: packageInfo!.packageName),
InfoTile(title: 'version', subTitle: packageInfo!.version), InfoTile(title: 'version', subTitle: packageInfo!.version),
ListTile( ListTile(
title: Text('Device Info'), title: Text('Device Info',style: TextStyle(fontSize: 18,color: Color(0xff333333))),
tileColor: Theme.of(context).accentColor.withOpacity(0.1), tileColor: Colors.blue.withOpacity(0.1),
), ),
])), ])),
_buildView(), _buildView(),

@ -4,7 +4,6 @@ import 'package:power_logger/src/views/platform_specific/info_tile.dart';
class AndroidView extends StatelessWidget { class AndroidView extends StatelessWidget {
final AndroidDeviceInfo? androidInfo; final AndroidDeviceInfo? androidInfo;
AndroidView({Key? key, required this.androidInfo}) : super(key: key); AndroidView({Key? key, required this.androidInfo}) : super(key: key);
@override @override

@ -15,8 +15,8 @@ class InfoTile extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListTile( return ListTile(
title: Text(title), title: Text(title,style: TextStyle(fontSize: 14,color: Color(0xff333333)),),
subtitle: Text(subTitle), subtitle: Text(subTitle,style: TextStyle(fontSize: 14,color: Color(0xff666666))),
onLongPress: () async { onLongPress: () async {
ScaffoldMessenger.of(context).hideCurrentSnackBar(); ScaffoldMessenger.of(context).hideCurrentSnackBar();
Clipboard.setData(ClipboardData(text: subTitle)); Clipboard.setData(ClipboardData(text: subTitle));

@ -1,10 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:power_logger/power_logger.dart'; import 'package:power_logger/power_logger.dart';
import 'package:power_logger/src/theme/custom_theme.dart';
class SettingsView extends StatefulWidget { class SettingsView extends StatefulWidget {
final VoidCallback stateRefresh; SettingsView({Key? key}) : super(key: key);
SettingsView({Key? key, required this.stateRefresh}) : super(key: key);
@override @override
_SettingsViewState createState() => _SettingsViewState(); _SettingsViewState createState() => _SettingsViewState();
@ -16,7 +14,9 @@ class _SettingsViewState extends State<SettingsView> {
return ListView( return ListView(
children: [ children: [
SwitchListTile( SwitchListTile(
title: Text('终端日志'), inactiveThumbColor: Colors.white,
inactiveTrackColor: Color(0xFF999999),
title: Text('终端日志',style: TextStyle(fontSize: 16,color: Colors.black),),
subtitle: Text(''), subtitle: Text(''),
value: LoggerData.markLogger, value: LoggerData.markLogger,
onChanged: (state) { onChanged: (state) {
@ -24,15 +24,6 @@ class _SettingsViewState extends State<SettingsView> {
setState(() {}); setState(() {});
}, },
), ),
SwitchListTile(
title: Text(CustomTheme.instance.follow ? '跟随系统' : 'Light'),
subtitle: Text(''),
value: CustomTheme.instance.follow,
onChanged: (state) {
CustomTheme.instance.setThemeData(state);
widget.stateRefresh();
},
),
], ],
); );
} }

@ -105,7 +105,7 @@ class _FabButton extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondary, color: Colors.blue,
borderRadius: BorderRadius.circular(25), borderRadius: BorderRadius.circular(25),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(

Loading…
Cancel
Save