-
Notifications
You must be signed in to change notification settings - Fork 44
update for new textTheme #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
romreed
wants to merge
1
commit into
flutterplugin:dependabot/pub/dio-5.0.3
from
romreed:dependabot/pub/dio-5.0.3
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
.dart_tool/version
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 3.0.1 | ||
| 3.22.1 |
61 changes: 61 additions & 0 deletions
.history/example/lib/home_page_20240919135301.dart
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import 'package:dio_log/dio_log.dart'; | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| import 'http_utils.dart'; | ||
|
|
||
| class MyHomePage extends StatefulWidget { | ||
| MyHomePage({Key key, this.title}) : super(key: key); | ||
|
|
||
| final String title; | ||
|
|
||
| @override | ||
| _MyHomePageState createState() => _MyHomePageState(); | ||
| } | ||
|
|
||
| class _MyHomePageState extends State<MyHomePage> { | ||
| TextEditingController controller = TextEditingController(); | ||
|
|
||
| String url = 'https://api.github.com/users'; | ||
|
|
||
| @override | ||
| void initState() { | ||
| super.initState(); | ||
| showDebugBtn(context, btnColor: Colors.blue); | ||
| controller.text = url; | ||
| } | ||
|
|
||
| @override | ||
| void dispose() { | ||
| super.dispose(); | ||
| } | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Scaffold( | ||
| appBar: AppBar( | ||
| title: Text(widget.title), | ||
| ), | ||
| body: Center( | ||
| child: Column( | ||
| mainAxisAlignment: MainAxisAlignment.center, | ||
| children: <Widget>[ | ||
| Text( | ||
| 'enter the requesr you want to send and press the send button', | ||
| ), | ||
| TextField( | ||
| controller: controller, | ||
| ), | ||
| ], | ||
| ), | ||
| ), | ||
| floatingActionButton: FloatingActionButton( | ||
| onPressed: _sendRequest, | ||
| child: Icon(Icons.send), | ||
| ), // This trailing comma makes auto-formatting nicer for build methods. | ||
| ); | ||
| } | ||
|
|
||
| _sendRequest() async { | ||
| httpGet(controller.text); | ||
| } | ||
| } |
61 changes: 61 additions & 0 deletions
.history/example/lib/home_page_20240919135427.dart
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import 'package:dio_log/dio_log.dart'; | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| import 'http_utils.dart'; | ||
|
|
||
| class MyHomePage extends StatefulWidget { | ||
| MyHomePage({Key? key, required this.title}) : super(key: key); | ||
|
|
||
| final String title; | ||
|
|
||
| @override | ||
| _MyHomePageState createState() => _MyHomePageState(); | ||
| } | ||
|
|
||
| class _MyHomePageState extends State<MyHomePage> { | ||
| TextEditingController controller = TextEditingController(); | ||
|
|
||
| String url = 'https://api.github.com/users'; | ||
|
|
||
| @override | ||
| void initState() { | ||
| super.initState(); | ||
| showDebugBtn(context, btnColor: Colors.blue); | ||
| controller.text = url; | ||
| } | ||
|
|
||
| @override | ||
| void dispose() { | ||
| super.dispose(); | ||
| } | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Scaffold( | ||
| appBar: AppBar( | ||
| title: Text(widget.title), | ||
| ), | ||
| body: Center( | ||
| child: Column( | ||
| mainAxisAlignment: MainAxisAlignment.center, | ||
| children: <Widget>[ | ||
| Text( | ||
| 'enter the requesr you want to send and press the send button', | ||
| ), | ||
| TextField( | ||
| controller: controller, | ||
| ), | ||
| ], | ||
| ), | ||
| ), | ||
| floatingActionButton: FloatingActionButton( | ||
| onPressed: _sendRequest, | ||
| child: Icon(Icons.send), | ||
| ), // This trailing comma makes auto-formatting nicer for build methods. | ||
| ); | ||
| } | ||
|
|
||
| _sendRequest() async { | ||
| httpGet(controller.text); | ||
| } | ||
| } |
138 changes: 138 additions & 0 deletions
.history/lib/http_log_list_widget_20240919135301.dart
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| import 'dart:collection'; | ||
|
|
||
| import 'package:flutter/material.dart'; | ||
|
|
||
| import 'bean/net_options.dart'; | ||
| import 'dio_log.dart'; | ||
| import 'page/log_widget.dart'; | ||
|
|
||
| ///网络请求日志列表 | ||
| class HttpLogListWidget extends StatefulWidget { | ||
| @override | ||
| _HttpLogListWidgetState createState() => _HttpLogListWidgetState(); | ||
| } | ||
|
|
||
| class _HttpLogListWidgetState extends State<HttpLogListWidget> { | ||
| LinkedHashMap<String, NetOptions>? logMap; | ||
| List<String>? keys; | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| logMap = LogPoolManager.getInstance().logMap; | ||
| keys = LogPoolManager.getInstance().keys; | ||
| final theme = Theme.of(context); | ||
| return Scaffold( | ||
| appBar: AppBar( | ||
| title: Text( | ||
| 'Request Logs', | ||
| ), | ||
| backgroundColor: theme.scaffoldBackgroundColor, | ||
| elevation: 1.0, | ||
| iconTheme: theme.iconTheme, | ||
| actions: <Widget>[ | ||
| InkWell( | ||
| onTap: () { | ||
| if (debugBtnIsShow()) { | ||
| dismissDebugBtn(); | ||
| } else { | ||
| showDebugBtn(context); | ||
| } | ||
| setState(() {}); | ||
| }, | ||
| child: Container( | ||
| padding: EdgeInsets.symmetric(horizontal: 8), | ||
| child: Align( | ||
| child: Text( | ||
| debugBtnIsShow() ? 'close overlay' : 'open overlay', | ||
| style: theme.textTheme.caption! | ||
| .copyWith(fontWeight: FontWeight.bold), | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
| InkWell( | ||
| onTap: () { | ||
| LogPoolManager.getInstance().clear(); | ||
| setState(() {}); | ||
| }, | ||
| child: Container( | ||
| padding: EdgeInsets.symmetric(horizontal: 8), | ||
| child: Align( | ||
| child: Text( | ||
| 'clear', | ||
| style: theme.textTheme.caption! | ||
| .copyWith(fontWeight: FontWeight.bold), | ||
| ), | ||
| ), | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| body: logMap!.length < 1 | ||
| ? Center( | ||
| child: Text('no request log'), | ||
| ) | ||
| : ListView.builder( | ||
| reverse: false, | ||
| itemCount: keys!.length, | ||
| itemBuilder: (BuildContext context, int index) { | ||
| NetOptions item = logMap![keys![index]]!; | ||
| return _buildItem(item); | ||
| }, | ||
| ), | ||
| ); | ||
| } | ||
|
|
||
| ///构建请求的简易信息 | ||
| Widget _buildItem(NetOptions item) { | ||
| var resOpt = item.resOptions; | ||
| var reqOpt = item.reqOptions!; | ||
|
|
||
| ///格式化请求时间 | ||
| var requestTime = getTimeStr1(reqOpt.requestTime!); | ||
|
|
||
| Color? textColor = LogPoolManager.getInstance().isError(item) | ||
| ? Colors.red | ||
| : Theme.of(context).textTheme.bodyText1!.color; | ||
| return Card( | ||
| margin: EdgeInsets.all(8), | ||
| elevation: 6, | ||
| child: InkWell( | ||
| onTap: () { | ||
| Navigator.push(context, MaterialPageRoute(builder: (context) { | ||
| return LogWidget(item); | ||
| })); | ||
| }, | ||
| child: Container( | ||
| width: double.infinity, | ||
| padding: EdgeInsets.all(8.0), | ||
| child: Column( | ||
| crossAxisAlignment: CrossAxisAlignment.start, | ||
| children: <Widget>[ | ||
| Text( | ||
| 'url: ${reqOpt.url}', | ||
| style: TextStyle( | ||
| color: textColor, | ||
| ), | ||
| ), | ||
| Divider(height: 2), | ||
| Text( | ||
| 'status: ${resOpt?.statusCode}', | ||
| style: TextStyle( | ||
| color: textColor, | ||
| ), | ||
| ), | ||
| Divider(height: 2), | ||
| Text( | ||
| 'requestTime: $requestTime duration: ${resOpt?.duration ?? 0}ms', | ||
| style: TextStyle( | ||
| color: textColor, | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| ), | ||
| ), | ||
| ); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.