update readme

null_safety
小赖 4 years ago
parent b4bebc87e6
commit 7fd6040598

@ -1,5 +1,7 @@
{ {
"cSpell.words": [ "cSpell.words": [
"ansu" "ansu",
"easyrefresh",
"screenutil"
] ]
} }

@ -9,6 +9,7 @@
### 生成关键代码 ### 生成关键代码
```bash ```bash
cd example
flutter pub run grinder update-code-segments flutter pub run grinder update-code-segments
``` ```
@ -28,17 +29,27 @@ minSdkVersion 21
* [x] Scaffold * [x] Scaffold
* [x] Button * [x] Button
* [ ] Extension * [ ] Extension
* [ ] num ext
* [ ] string ext
* [ ] widget ext
* [ ] image ext
* [ ] list ext
* [ ] text ext
* [ ] text style ext
* [ ] Badge * [ ] Badge
* [ ] Bars * [ ] Bars
* [ ] Box * [x] TabBar
* [ ] NavigationBar
* [ ] CheckBox
* [ ] Dialog * [ ] Dialog
* [ ] Divider * [ ] Divider
* [ ] Drawer * [ ] Drawer
* [ ] ListTile * [ ] ListTile
* [ ] Pickers * [ ] Pickers
* [x] numeric Picker
* [ ] PopUpMenu * [ ] PopUpMenu
* [ ] Refresh * [ ] Refresh
* [ ] Tag * [x] Tag
* [ ] TextField * [ ] TextField
* [ ] Toast * [ ] Toast
* [ ] Utils * [ ] Utils

@ -27,12 +27,11 @@ class _CodeViewState extends State<CodeView> {
baseStyle: codeTheme.copyWith(color: Colors.white70), baseStyle: codeTheme.copyWith(color: Colors.white70),
numberStyle: codeTheme.copyWith(color: const Color(0xFFBD93F9)), numberStyle: codeTheme.copyWith(color: const Color(0xFFBD93F9)),
commentStyle: codeTheme.copyWith(color: const Color(0xFF808080)), commentStyle: codeTheme.copyWith(color: const Color(0xFF808080)),
keywordStyle: codeTheme.copyWith(color: const Color(0xFF1CDEC9)), keywordStyle: codeTheme.copyWith(color: Colors.blue),
stringStyle: codeTheme.copyWith(color: const Color(0xFFFFA65C)), stringStyle: codeTheme.copyWith(color: Colors.green),
punctuationStyle: punctuationStyle: codeTheme.copyWith(color: Colors.teal),
codeTheme.copyWith(color: const Color(0xFF8BE9FD)), classStyle: codeTheme.copyWith(color: Colors.yellow),
classStyle: codeTheme.copyWith(color: const Color(0xFFD65BAD)), constantStyle: codeTheme.copyWith(color: Colors.pink),
constantStyle: codeTheme.copyWith(color: const Color(0xFFFF8383)),
child: child:
Builder(builder: (context) => Text.rich(widget.text(context))), Builder(builder: (context) => Text.rich(widget.text(context))),
)), )),

@ -1,6 +1,10 @@
import 'package:ansu_ui/ansu_ui.dart'; import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'codeviewer/code_segments.dart';
import 'common/code_view.dart';
class ExampleBottomButton extends StatefulWidget { class ExampleBottomButton extends StatefulWidget {
ExampleBottomButton({Key key}) : super(key: key); ExampleBottomButton({Key key}) : super(key: key);
@ -14,10 +18,24 @@ class _ExampleBottomButtonState extends State<ExampleBottomButton> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ASScaffold( return ASScaffold(
title: 'ASBottomButton', title: 'ASBottomButton',
actions: [
IconButton(
icon: Icon(
Icons.code,
color: Colors.black54,
),
onPressed: () => Get.to(
CodeView(
text: (context) => CodeSegments.bottomButton(context),
),
),
)
],
body: Center(), body: Center(),
bottomNavigationBar: Column( bottomNavigationBar: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
// BEGIN bottomButton
ASBottomButton.infinity( ASBottomButton.infinity(
title: '无渐变infinity', title: '无渐变infinity',
onPressed: () {}, onPressed: () {},
@ -42,6 +60,7 @@ class _ExampleBottomButtonState extends State<ExampleBottomButton> {
)) ))
], ],
) )
// END
], ],
), ),
); );

@ -1,5 +1,8 @@
import 'package:ansu_ui/ansu_ui.dart'; import 'package:ansu_ui/ansu_ui.dart';
import 'package:example/codeviewer/code_segments.dart';
import 'package:example/common/code_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart';
class ExampleNumericButton extends StatefulWidget { class ExampleNumericButton extends StatefulWidget {
ExampleNumericButton({Key key}) : super(key: key); ExampleNumericButton({Key key}) : super(key: key);
@ -16,15 +19,28 @@ class _ExampleNumericButtonState extends State<ExampleNumericButton> {
} }
int _pickedValue = 0; int _pickedValue = 0;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ASScaffold( return ASScaffold(
title: '数量选择器', title: '数量选择器',
actions: [
IconButton(
icon: Icon(
Icons.code,
color: Colors.black54,
),
onPressed: () => Get.to(
CodeView(
text: (context) => CodeSegments.numericButton(context),
),
),
)
],
body: Builder( body: Builder(
builder: (context) { builder: (context) {
return ListView( return ListView(
children: [ children: [
// BEGIN numericButton
ListTile( ListTile(
title: Text(_pickedValue.toString()), title: Text(_pickedValue.toString()),
subtitle: Text('一般用法'), subtitle: Text('一般用法'),
@ -44,6 +60,8 @@ class _ExampleNumericButtonState extends State<ExampleNumericButton> {
}, },
), ),
), ),
// END
], ],
); );
}, },

@ -4,6 +4,9 @@ import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'codeviewer/code_segments.dart';
import 'common/code_view.dart';
class ExamplePicker extends StatefulWidget { class ExamplePicker extends StatefulWidget {
ExamplePicker({Key key}) : super(key: key); ExamplePicker({Key key}) : super(key: key);
@ -16,8 +19,22 @@ class _ExamplePickerState extends State<ExamplePicker> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ASScaffold( return ASScaffold(
title: '选择器', title: '选择器',
actions: [
IconButton(
icon: Icon(
Icons.code,
color: Colors.black54,
),
onPressed: () => Get.to(
CodeView(
text: (context) => CodeSegments.picker(context),
),
),
)
],
body: ListView( body: ListView(
children: [ children: [
// BEGIN picker
ListTile( ListTile(
title: Text('日期选择器'), title: Text('日期选择器'),
subtitle: Text('DatePicker'), subtitle: Text('DatePicker'),
@ -74,6 +91,7 @@ class _ExamplePickerState extends State<ExamplePicker> {
}, },
), ),
), ),
// END
], ],
), ),
); );

@ -1,5 +1,8 @@
import 'package:ansu_ui/ansu_ui.dart'; import 'package:ansu_ui/ansu_ui.dart';
import 'package:example/codeviewer/code_segments.dart';
import 'package:example/common/code_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart';
class ExampleTabBar extends StatefulWidget { class ExampleTabBar extends StatefulWidget {
ExampleTabBar({Key key}) : super(key: key); ExampleTabBar({Key key}) : super(key: key);
@ -36,11 +39,23 @@ class _ExampleTabBarState extends State<ExampleTabBar>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ASScaffold( return ASScaffold(
title: '选项卡 TabBar', title: '选项卡 TabBar',
actions: [
IconButton(
icon: Icon(
Icons.code,
color: Colors.black54,
),
onPressed: () => Get.to(
CodeView(text: (context) => CodeSegments.tabBar(context)),
),
)
],
body: Material( body: Material(
color: kForegroundColor, color: kForegroundColor,
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
// BEGIN tabBar
ASTabBar( ASTabBar(
items: ['全部', 'Part1', 'Part2'], items: ['全部', 'Part1', 'Part2'],
controller: _tabController1, controller: _tabController1,
@ -61,6 +76,8 @@ class _ExampleTabBarState extends State<ExampleTabBar>
.toList(), .toList(),
controller: _tabController4, controller: _tabController4,
), ),
// END
], ],
), ),
), ),

@ -1,6 +1,10 @@
import 'package:ansu_ui/ansu_ui.dart'; import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'codeviewer/code_segments.dart';
import 'common/code_view.dart';
class ExampleTag extends StatefulWidget { class ExampleTag extends StatefulWidget {
ExampleTag({Key key}) : super(key: key); ExampleTag({Key key}) : super(key: key);
@ -15,8 +19,22 @@ class _ExampaleTagState extends State<ExampleTag> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ASScaffold( return ASScaffold(
title: 'ASTag', title: 'ASTag',
actions: [
IconButton(
icon: Icon(
Icons.code,
color: Colors.black54,
),
onPressed: () => Get.to(
CodeView(
text: (context) => CodeSegments.tag(context),
),
),
)
],
body: Column( body: Column(
children: [ children: [
// BEGIN tag
ListTile( ListTile(
title: Text('yellowSolid'), title: Text('yellowSolid'),
trailing: ASTag.yellowSolid( trailing: ASTag.yellowSolid(
@ -65,6 +83,7 @@ class _ExampaleTagState extends State<ExampleTag> {
text: 'TAG'.text, text: 'TAG'.text,
), ),
), ),
// END
], ],
)); ));
} }

Loading…
Cancel
Save