mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-06-21 04:47:58 +08:00
format code
This commit is contained in:
@ -6,7 +6,6 @@
|
|||||||
* email: zhu.yan@alibaba-inc.com
|
* email: zhu.yan@alibaba-inc.com
|
||||||
* tartget: FlatButton 的示例
|
* tartget: FlatButton 的示例
|
||||||
*/
|
*/
|
||||||
import 'package:fluro/fluro.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import '../routers/application.dart';
|
|
||||||
|
|
||||||
class ListViewItem extends StatelessWidget {
|
class ListViewItem extends StatelessWidget {
|
||||||
final String itemUrl;
|
final String itemUrl;
|
||||||
@ -11,15 +10,13 @@ class ListViewItem extends StatelessWidget {
|
|||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
void _launchURL(String url, BuildContext context) async {
|
void _launchURL(String url, BuildContext context) async {
|
||||||
if (url.contains("https") || url.contains("http")) {
|
|
||||||
if (await canLaunch(url)) {
|
if (await canLaunch(url)) {
|
||||||
await launch(url);
|
await launch(url);
|
||||||
} else {
|
} else {
|
||||||
throw 'Could not launch $url';
|
throw 'Could not launch $url';
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Application.router.navigateTo(context, "${url}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -69,7 +69,7 @@ class Sql extends BaseModel {
|
|||||||
/// @mods [And, Or] default is Or
|
/// @mods [And, Or] default is Or
|
||||||
/// search({'name': "hanxu', 'id': 1};
|
/// search({'name': "hanxu', 'id': 1};
|
||||||
///
|
///
|
||||||
Future<List> search({Map<String, dynamic> conditions, String Mods = 'Or'}) async {
|
Future<List> search({Map<String, dynamic> conditions, String mods = 'Or'}) async {
|
||||||
if (conditions == null || conditions.isEmpty) {
|
if (conditions == null || conditions.isEmpty) {
|
||||||
return this.get();
|
return this.get();
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ class Sql extends BaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (index >= 0 && index < conditions.length -1) {
|
if (index >= 0 && index < conditions.length -1) {
|
||||||
stringConditions = '$stringConditions $Mods';
|
stringConditions = '$stringConditions $mods';
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import '../routers/application.dart';
|
|
||||||
|
|
||||||
class WidgetDemo extends StatelessWidget {
|
class WidgetDemo extends StatelessWidget {
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
@ -33,7 +33,6 @@ class WidgetDemo extends StatefulWidget {
|
|||||||
class _WidgetDemoState extends State<WidgetDemo> {
|
class _WidgetDemoState extends State<WidgetDemo> {
|
||||||
bool _hasCollected = false;
|
bool _hasCollected = false;
|
||||||
CollectionControlModel _collectionControl = new CollectionControlModel();
|
CollectionControlModel _collectionControl = new CollectionControlModel();
|
||||||
Collection _collection;
|
|
||||||
Color _collectionColor;
|
Color _collectionColor;
|
||||||
List widgetDemosList = new WidgetDemoList().getDemos();
|
List widgetDemosList = new WidgetDemoList().getDemos();
|
||||||
String _router = '';
|
String _router = '';
|
||||||
@ -86,10 +85,10 @@ class _WidgetDemoState extends State<WidgetDemo> {
|
|||||||
_router = item.routerName;
|
_router = item.routerName;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(this.mounted){
|
if (this.mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_hasCollected = list.length > 0;
|
_hasCollected = list.length > 0;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -104,7 +103,11 @@ class _WidgetDemoState extends State<WidgetDemo> {
|
|||||||
_hasCollected = false;
|
_hasCollected = false;
|
||||||
});
|
});
|
||||||
showInSnackBar('已取消收藏');
|
showInSnackBar('已取消收藏');
|
||||||
ApplicationEvent.event.fire(CollectionEvent(widget.title,true));
|
|
||||||
|
if (ApplicationEvent.event != null) {
|
||||||
|
ApplicationEvent.event
|
||||||
|
.fire(CollectionEvent(widget.title, _router, true));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
print('删除错误');
|
print('删除错误');
|
||||||
@ -118,13 +121,19 @@ class _WidgetDemoState extends State<WidgetDemo> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_hasCollected = true;
|
_hasCollected = true;
|
||||||
});
|
});
|
||||||
ApplicationEvent.event.fire(CollectionEvent(widget.title,false));
|
|
||||||
|
if (ApplicationEvent.event != null) {
|
||||||
|
ApplicationEvent.event
|
||||||
|
.fire(CollectionEvent(widget.title, _router, false));
|
||||||
|
}
|
||||||
|
|
||||||
showInSnackBar('收藏成功');
|
showInSnackBar('收藏成功');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (_hasCollected) {
|
if (_hasCollected) {
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_rookie_book/views/Detail.dart';
|
import 'package:flutter_rookie_book/views/Detail.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CompList extends StatefulWidget {
|
class CompList extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
State<StatefulWidget> createState() {
|
State<StatefulWidget> createState() {
|
||||||
// TODO: implement createState
|
|
||||||
return new ListState();
|
return new ListState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
* tartget: FlatButton 的示例
|
* tartget: FlatButton 的示例
|
||||||
*/
|
*/
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'dart:math';
|
|
||||||
|
|
||||||
class ListRefresh extends StatefulWidget {
|
class ListRefresh extends StatefulWidget {
|
||||||
final renderItem;
|
final renderItem;
|
||||||
|
@ -8,7 +8,7 @@ import '../model/story.dart';
|
|||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
class Pagination extends StatelessWidget {
|
class Pagination extends StatelessWidget {
|
||||||
static const String routeName = '/material/page-selector';
|
static final String routeName = '/material/page-selector';
|
||||||
static final List<Icon> icons = <Icon>[
|
static final List<Icon> icons = <Icon>[
|
||||||
const Icon(Icons.event, semanticLabel: 'Event'),
|
const Icon(Icons.event, semanticLabel: 'Event'),
|
||||||
const Icon(Icons.home, semanticLabel: 'Home'),
|
const Icon(Icons.home, semanticLabel: 'Home'),
|
||||||
@ -18,9 +18,9 @@ class Pagination extends StatelessWidget {
|
|||||||
const Icon(Icons.language, semanticLabel: 'Language'),
|
const Icon(Icons.language, semanticLabel: 'Language'),
|
||||||
];
|
];
|
||||||
|
|
||||||
List<StoryModel> bannerStories = [];
|
final List<StoryModel> bannerStories = [];
|
||||||
|
|
||||||
List<dynamic> arr = [
|
final List<dynamic> arr = [
|
||||||
{'image': 'https://img.alicdn.com/tfs/TB1W4hMAwHqK1RjSZJnXXbNLpXa-519-260.jpg', 'type': 0, 'id': 9695909, 'url': 'https://www.zhihu.com/question/294145797/answer/551162834', 'title': '为什么阿里巴巴、腾讯和 Google 之类的企业都在使用 Flutter 开发 App?'},
|
{'image': 'https://img.alicdn.com/tfs/TB1W4hMAwHqK1RjSZJnXXbNLpXa-519-260.jpg', 'type': 0, 'id': 9695909, 'url': 'https://www.zhihu.com/question/294145797/answer/551162834', 'title': '为什么阿里巴巴、腾讯和 Google 之类的企业都在使用 Flutter 开发 App?'},
|
||||||
{'image': 'https://img.alicdn.com/tfs/TB1XmFIApzqK1RjSZSgXXcpAVXa-720-338.jpg', 'type': 0, 'id': 9695859, 'url': 'https://zhuanlan.zhihu.com/p/51696594', 'title': 'Flutter 1.0 正式发布: Google 的便携 UI 工具包'},
|
{'image': 'https://img.alicdn.com/tfs/TB1XmFIApzqK1RjSZSgXXcpAVXa-720-338.jpg', 'type': 0, 'id': 9695859, 'url': 'https://zhuanlan.zhihu.com/p/51696594', 'title': 'Flutter 1.0 正式发布: Google 的便携 UI 工具包'},
|
||||||
{'image': 'https://img.alicdn.com/tfs/TB1mClCABLoK1RjSZFuXXXn0XXa-600-362.jpg', 'type': 0, 'id': 96956491409, 'url':'https://zhuanlan.zhihu.com/p/53497167','title': 'Flutter 示范应用现已开源 — 万物起源(The History of Everything)'},
|
{'image': 'https://img.alicdn.com/tfs/TB1mClCABLoK1RjSZFuXXXn0XXa-600-362.jpg', 'type': 0, 'id': 96956491409, 'url':'https://zhuanlan.zhihu.com/p/53497167','title': 'Flutter 示范应用现已开源 — 万物起源(The History of Everything)'},
|
||||||
@ -35,7 +35,7 @@ class Pagination extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> _PageSelector(BuildContext context) {
|
List<Widget> _pageSelector(BuildContext context) {
|
||||||
List<Widget> list = [];
|
List<Widget> list = [];
|
||||||
/// super.initState();
|
/// super.initState();
|
||||||
arr.forEach((item) {
|
arr.forEach((item) {
|
||||||
@ -57,7 +57,7 @@ class Pagination extends StatelessWidget {
|
|||||||
Column(
|
Column(
|
||||||
//physics: AlwaysScrollableScrollPhysics(),
|
//physics: AlwaysScrollableScrollPhysics(),
|
||||||
//padding: EdgeInsets.only(),
|
//padding: EdgeInsets.only(),
|
||||||
children: _PageSelector(context)
|
children: _pageSelector(context)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,6 @@ class _MaterialSearchState<T> extends State<MaterialSearch> {
|
|||||||
_loading = true;
|
_loading = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
//TODO: debounce widget.results too
|
|
||||||
var results = await widget.getResults(_criteria);
|
var results = await widget.getResults(_criteria);
|
||||||
|
|
||||||
if (!mounted) {
|
if (!mounted) {
|
||||||
|
@ -8,7 +8,6 @@ final hightlighter = new HighLight();
|
|||||||
class HighLight extends md.SyntaxHighlighter {
|
class HighLight extends md.SyntaxHighlighter {
|
||||||
@override
|
@override
|
||||||
TextSpan format(String source) {
|
TextSpan format(String source) {
|
||||||
// TODO: implement format
|
|
||||||
final SyntaxHighlighterStyle style = SyntaxHighlighterStyle.lightThemeStyle();
|
final SyntaxHighlighterStyle style = SyntaxHighlighterStyle.lightThemeStyle();
|
||||||
return TextSpan(
|
return TextSpan(
|
||||||
style: const TextStyle(fontSize: 10.0),
|
style: const TextStyle(fontSize: 10.0),
|
||||||
@ -22,11 +21,10 @@ class HighLight extends md.SyntaxHighlighter {
|
|||||||
|
|
||||||
|
|
||||||
class MarkdownBody extends StatelessWidget {
|
class MarkdownBody extends StatelessWidget {
|
||||||
String data;
|
final String data;
|
||||||
MarkdownBody(this.data);
|
MarkdownBody(this.data);
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// TODO: implement build
|
|
||||||
return md.MarkdownBody(data: data, syntaxHighlighter: new HighLight());
|
return md.MarkdownBody(data: data, syntaxHighlighter: new HighLight());
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -72,16 +72,16 @@ class WidgetItem extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.symmetric(vertical: 30.0, horizontal: 10.0),
|
padding: const EdgeInsets.symmetric(vertical: 30.0, horizontal: 10.0),
|
||||||
height: 150.0,
|
height: 150.0,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
widgetIcon,
|
widgetIcon,
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 8.0,
|
height: 8.0,
|
||||||
),
|
),
|
||||||
Text(_widgetName),
|
Text(_widgetName),
|
||||||
],
|
],
|
||||||
) ,
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ class WidgetItemContainer extends StatelessWidget {
|
|||||||
final List<dynamic> categories;
|
final List<dynamic> categories;
|
||||||
final bool isWidgetPoint;
|
final bool isWidgetPoint;
|
||||||
// 所有的可用demos;
|
// 所有的可用demos;
|
||||||
List widgetDemosList = new WidgetDemoList().getDemos();
|
final List widgetDemosList = new WidgetDemoList().getDemos();
|
||||||
|
|
||||||
WidgetItemContainer(
|
WidgetItemContainer(
|
||||||
{Key key,
|
{Key key,
|
||||||
@ -41,7 +41,7 @@ class WidgetItemContainer extends StatelessWidget {
|
|||||||
targetRouter = item.routerName;
|
targetRouter = item.routerName;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Application.router.navigateTo(context, "${targetRouter}");
|
Application.router.navigateTo(context, "$targetRouter");
|
||||||
} else {
|
} else {
|
||||||
Application.router
|
Application.router
|
||||||
.navigateTo(context, "/category/${item.name}");
|
.navigateTo(context, "/category/${item.name}");
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
class CollectionEvent{
|
class CollectionEvent{
|
||||||
final String widgetName;
|
final String widgetName;
|
||||||
|
final String router;
|
||||||
final bool isRemove;
|
final bool isRemove;
|
||||||
// token uid...
|
// token uid...
|
||||||
CollectionEvent(this.widgetName,this.isRemove);
|
CollectionEvent(this.widgetName,this.router,this.isRemove);
|
||||||
}
|
}
|
@ -4,7 +4,6 @@ import 'package:flutter/rendering.dart';
|
|||||||
|
|
||||||
import 'views/FirstPage.dart';
|
import 'views/FirstPage.dart';
|
||||||
import 'views/widgetPage.dart';
|
import 'views/widgetPage.dart';
|
||||||
import 'views/ThirdPage.dart';
|
|
||||||
import 'views/FourthPage.dart';
|
import 'views/FourthPage.dart';
|
||||||
import 'views/collection_page.dart';
|
import 'views/collection_page.dart';
|
||||||
import 'routers/routers.dart';
|
import 'routers/routers.dart';
|
||||||
@ -83,7 +82,6 @@ class _MyHomePageState extends State<MyHomePage>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
// TODO: implement initState
|
|
||||||
super.initState();
|
super.initState();
|
||||||
controller = new TabController(
|
controller = new TabController(
|
||||||
initialIndex: 0, vsync: this, length: 4); // 这里的length 决定有多少个底导 submenus
|
initialIndex: 0, vsync: this, length: 4); // 这里的length 决定有多少个底导 submenus
|
||||||
@ -113,7 +111,7 @@ class _MyHomePageState extends State<MyHomePage>
|
|||||||
targetRouter = item.routerName;
|
targetRouter = item.routerName;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Application.router.navigateTo(context, "${targetRouter}");
|
Application.router.navigateTo(context, "$targetRouter");
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildSearchInput(BuildContext context) {
|
Widget buildSearchInput(BuildContext context) {
|
||||||
@ -186,11 +184,11 @@ class _MyHomePageState extends State<MyHomePage>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onDataChange(val) {
|
// void _onDataChange(val) {
|
||||||
if (this.mounted) {
|
// if (this.mounted) {
|
||||||
setState(() {
|
// setState(() {
|
||||||
data = val;
|
// data = val;
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import 'package:sqflite/sqflite.dart';
|
import 'package:sqflite/sqflite.dart';
|
||||||
import 'dart:async';
|
|
||||||
|
|
||||||
class BaseModel{
|
class BaseModel{
|
||||||
Database db;
|
Database db;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import 'base.dart';
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
|
||||||
import '../common/sql.dart';
|
import '../common/sql.dart';
|
||||||
|
|
||||||
abstract class CatInterface{
|
abstract class CatInterface{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import 'base.dart';
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import '../common/sql.dart';
|
import '../common/sql.dart';
|
||||||
import "package:flutter/material.dart";
|
import "package:flutter/material.dart";
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import 'package:fluro/fluro.dart';
|
import 'package:fluro/fluro.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../widgets/index.dart';
|
|
||||||
class Application {
|
class Application {
|
||||||
static Router router;
|
static Router router;
|
||||||
static TabController controller;
|
static TabController controller;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
import 'package:fluro/fluro.dart';
|
import 'package:fluro/fluro.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../widgets/index.dart';
|
import '../widgets/index.dart';
|
||||||
import '../model/widget.dart';
|
|
||||||
import './router_handler.dart';
|
import './router_handler.dart';
|
||||||
|
|
||||||
class Routes {
|
class Routes {
|
||||||
|
@ -1,19 +1,11 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_rookie_book/common/list_view_item.dart';
|
import 'package:flutter_rookie_book/common/list_view_item.dart';
|
||||||
//import 'package:flutter_rookie_book/components/CompList.dart';
|
|
||||||
import 'package:flutter_rookie_book/components/ListRefresh.dart' as listComp;
|
import 'package:flutter_rookie_book/components/ListRefresh.dart' as listComp;
|
||||||
import 'package:flutter_rookie_book/components/Pagination.dart';
|
import 'package:flutter_rookie_book/components/Pagination.dart';
|
||||||
|
|
||||||
import './widgetFeature/FirstPageItem.dart';
|
import './widgetFeature/FirstPageItem.dart';
|
||||||
import '../common/net_utils.dart';
|
import '../common/net_utils.dart';
|
||||||
|
|
||||||
import 'package:flutter_rookie_book/common/iconNames.dart';
|
import 'package:flutter_rookie_book/common/iconNames.dart';
|
||||||
import '../common/sql.dart';
|
|
||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
|
||||||
|
|
||||||
class FirstPage extends StatefulWidget {
|
class FirstPage extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
@ -24,12 +16,10 @@ class FirstPageState extends State<FirstPage> with AutomaticKeepAliveClientMixin
|
|||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
// TODO: implement wantKeepAlive
|
|
||||||
bool get wantKeepAlive => true;
|
bool get wantKeepAlive => true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
// TODO: implement initState
|
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../components/CompList.dart';
|
import '../components/CompList.dart';
|
||||||
|
@ -1,69 +0,0 @@
|
|||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import '../common/eventBus.dart';
|
|
||||||
|
|
||||||
class ThirdPage extends StatefulWidget {
|
|
||||||
ThirdPage({Key key, this.data2ThirdPage, this.callback}) : super(key: key);
|
|
||||||
final callback;
|
|
||||||
String data2ThirdPage;
|
|
||||||
|
|
||||||
@override
|
|
||||||
ThirdPageState createState() => new ThirdPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class ThirdPageState extends State<ThirdPage> {
|
|
||||||
|
|
||||||
String data = '';
|
|
||||||
String inputTxt;
|
|
||||||
TextEditingController controller = new TextEditingController();
|
|
||||||
|
|
||||||
void initState() {
|
|
||||||
//print('data4Two' + widget.data2ThirdPage);
|
|
||||||
data = widget.data2ThirdPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
void firedA() {
|
|
||||||
widget.callback('$inputTxt');
|
|
||||||
}
|
|
||||||
|
|
||||||
void firedB() {
|
|
||||||
eventBus.fire(new MyEvent('$inputTxt'));
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onChanged(String value) {
|
|
||||||
setState(() {
|
|
||||||
inputTxt = value;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return new Center(
|
|
||||||
child: new Column(children: <Widget>[
|
|
||||||
new Container(
|
|
||||||
padding: new EdgeInsets.only(bottom: 15.0),
|
|
||||||
child: new Text('子组件2'),
|
|
||||||
),
|
|
||||||
new Container(
|
|
||||||
padding: new EdgeInsets.only(bottom: 10.0),
|
|
||||||
child: new Text('父传子:' + data),
|
|
||||||
),
|
|
||||||
new Container(
|
|
||||||
margin: new EdgeInsets.only(bottom: 40.0),
|
|
||||||
child: new TextField(
|
|
||||||
controller: controller,
|
|
||||||
onChanged: _onChanged,
|
|
||||||
decoration: (new InputDecoration(labelText: '请输入你要发送的值')))),
|
|
||||||
new Container(
|
|
||||||
child: new RaisedButton(
|
|
||||||
onPressed: firedA, child: new Text('to父组件'))),
|
|
||||||
new Container(
|
|
||||||
child: new RaisedButton(
|
|
||||||
onPressed: firedB, child: new Text('to兄弟组件')))
|
|
||||||
]
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -61,7 +61,6 @@ class _CategoryHome extends State<CategoryHome> {
|
|||||||
// 假设进入这个界面的parent一定存在
|
// 假设进入这个界面的parent一定存在
|
||||||
Cat parentCat = catHistory.last;
|
Cat parentCat = catHistory.last;
|
||||||
|
|
||||||
int depth = catHistory.length;
|
|
||||||
|
|
||||||
// 继续搜索显示下一级depth: depth + 1, parentId: parentCat.id
|
// 继续搜索显示下一级depth: depth + 1, parentId: parentCat.id
|
||||||
List<Cat> _categories =
|
List<Cat> _categories =
|
||||||
@ -92,7 +91,7 @@ class _CategoryHome extends State<CategoryHome> {
|
|||||||
targetRouter = item.routerName;
|
targetRouter = item.routerName;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Application.router.navigateTo(context, "${targetRouter}");
|
Application.router.navigateTo(context, "$targetRouter");
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildContent() {
|
Widget _buildContent() {
|
||||||
|
@ -15,18 +15,18 @@ class CollectionPage extends StatefulWidget {
|
|||||||
_CollectionPageState createState() => _CollectionPageState();
|
_CollectionPageState createState() => _CollectionPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _CollectionPageState extends State<CollectionPage> with AutomaticKeepAliveClientMixin{
|
class _CollectionPageState extends State<CollectionPage>
|
||||||
|
with AutomaticKeepAliveClientMixin {
|
||||||
_CollectionPageState() {
|
_CollectionPageState() {
|
||||||
final eventBus = new EventBus();
|
final eventBus = new EventBus();
|
||||||
ApplicationEvent.event = eventBus;
|
ApplicationEvent.event = eventBus;
|
||||||
}
|
}
|
||||||
CollectionControlModel _collectionControl = new CollectionControlModel();
|
CollectionControlModel _collectionControl = new CollectionControlModel();
|
||||||
List<Collection> _collectionList;
|
List<Collection> _collectionList = [];
|
||||||
ScrollController _scrollController = new ScrollController();
|
ScrollController _scrollController = new ScrollController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
// TODO: implement wantKeepAlive
|
bool get wantKeepAlive => true;
|
||||||
bool get wantKeepAlive => true;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -44,7 +44,7 @@ class _CollectionPageState extends State<CollectionPage> with AutomaticKeepAlive
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _getList() {
|
void _getList() {
|
||||||
_collectionList = [];
|
_collectionList.clear();
|
||||||
_collectionControl.getAllCollection().then((resultList) {
|
_collectionControl.getAllCollection().then((resultList) {
|
||||||
resultList.forEach((item) {
|
resultList.forEach((item) {
|
||||||
_collectionList.add(item);
|
_collectionList.add(item);
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* @Author: 一凨
|
||||||
|
* @Date: 2019-01-11 14:39:48
|
||||||
|
* @Last Modified by: 一凨
|
||||||
|
* @Last Modified time: 2019-01-11 14:40:09
|
||||||
|
*/
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'widgetPage/cate_card.dart';
|
import 'widgetPage/cate_card.dart';
|
||||||
import '../model/cat.dart';
|
import '../model/cat.dart';
|
||||||
@ -24,7 +30,6 @@ class SecondPageState extends State<WidgetPage> with AutomaticKeepAliveClientMix
|
|||||||
List<Cat> categories = [];
|
List<Cat> categories = [];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
// TODO: implement wantKeepAlive
|
|
||||||
bool get wantKeepAlive => true;
|
bool get wantKeepAlive => true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -46,7 +51,6 @@ class SecondPageState extends State<WidgetPage> with AutomaticKeepAliveClientMix
|
|||||||
Widget buildGrid() {
|
Widget buildGrid() {
|
||||||
// 存放最后的widget
|
// 存放最后的widget
|
||||||
List<Widget> tiles = [];
|
List<Widget> tiles = [];
|
||||||
Widget content;
|
|
||||||
for (Cat item in categories) {
|
for (Cat item in categories) {
|
||||||
tiles.add(new CateCard(category: item));
|
tiles.add(new CateCard(category: item));
|
||||||
}
|
}
|
||||||
@ -69,10 +73,4 @@ class SecondPageState extends State<WidgetPage> with AutomaticKeepAliveClientMix
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onChanged(String value) {
|
|
||||||
setState(() {
|
|
||||||
active = value;
|
|
||||||
data = '90';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
* tartget: AppBar 的示例
|
* tartget: AppBar 的示例
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../common/widget-demo.dart';
|
import '../../../../common/widget-demo.dart';
|
||||||
import '../../../../routers/application.dart';
|
import '../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
@ -55,7 +54,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 AppBar widget
|
* 所有的 AppBar widget
|
||||||
* context: 运行上下文
|
* context: 运行上下文
|
||||||
* that: 指向有状态的 StatefulWidget
|
* that: 指向有状态的 StatefulWidget
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
* tartget: BottomAppBar 的示例
|
* tartget: BottomAppBar 的示例
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../common/widget-demo.dart';
|
import '../../../../common/widget-demo.dart';
|
||||||
import '../../../../routers/application.dart';
|
import '../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
@ -26,11 +25,6 @@ const String _Text1 =
|
|||||||
> 通常与Scaffold和FloatingActionButton一起使用。
|
> 通常与Scaffold和FloatingActionButton一起使用。
|
||||||
""";
|
""";
|
||||||
|
|
||||||
const String _Text2 =
|
|
||||||
"""### **进阶用法**
|
|
||||||
> BottomAppBar
|
|
||||||
-
|
|
||||||
""";
|
|
||||||
|
|
||||||
class Demo extends StatefulWidget {
|
class Demo extends StatefulWidget {
|
||||||
static const String routeName = '/components//Bar/BottomAppBar';
|
static const String routeName = '/components//Bar/BottomAppBar';
|
||||||
@ -51,7 +45,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 BottomAppBar widget
|
* 所有的 BottomAppBar widget
|
||||||
* context: 运行上下文
|
* context: 运行上下文
|
||||||
* that: 指向有状态的 StatefulWidget
|
* that: 指向有状态的 StatefulWidget
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
* tartget: ButtonBar 的示例
|
* tartget: ButtonBar 的示例
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../common/widget-demo.dart';
|
import '../../../../common/widget-demo.dart';
|
||||||
import '../../../../routers/application.dart';
|
import '../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
@ -27,11 +26,6 @@ const String _Text1 =
|
|||||||
- 当Directionality为TextDirection.ltr时,按钮栏的子项右对齐,最后一个子项成为最右边的子项。当Directionality TextDirection.rtl时,子项被左对齐,最后一个子项成为最左边的子项。
|
- 当Directionality为TextDirection.ltr时,按钮栏的子项右对齐,最后一个子项成为最右边的子项。当Directionality TextDirection.rtl时,子项被左对齐,最后一个子项成为最左边的子项。
|
||||||
""";
|
""";
|
||||||
|
|
||||||
const String _Text2 =
|
|
||||||
"""### **进阶用法**
|
|
||||||
> ButtonBar
|
|
||||||
-
|
|
||||||
""";
|
|
||||||
|
|
||||||
class Demo extends StatefulWidget {
|
class Demo extends StatefulWidget {
|
||||||
static const String routeName = '/components/Bar/ButtonBar';
|
static const String routeName = '/components/Bar/ButtonBar';
|
||||||
@ -53,7 +47,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 ButtonBar widget
|
* 所有的 ButtonBar widget
|
||||||
* context: 运行上下文
|
* context: 运行上下文
|
||||||
* that: 指向有状态的 StatefulWidget
|
* that: 指向有状态的 StatefulWidget
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* tartget: FlexibleSpaceBar 的示例
|
* tartget: FlexibleSpaceBar 的示例
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../common/widget-demo.dart';
|
import '../../../../common/widget-demo.dart';
|
||||||
import '../../../../routers/application.dart';
|
import '../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
@ -28,11 +27,6 @@ const String _Text1 =
|
|||||||
- 要调整 AppBar 大小,必须将其包装在 FlexibleSpaceBar.createSettings 返回的 widget 中 ,以将大小调整信息传递给 FlexibleSpaceBar。
|
- 要调整 AppBar 大小,必须将其包装在 FlexibleSpaceBar.createSettings 返回的 widget 中 ,以将大小调整信息传递给 FlexibleSpaceBar。
|
||||||
""";
|
""";
|
||||||
|
|
||||||
const String _Text2 =
|
|
||||||
"""### **进阶用法**
|
|
||||||
> FlexibleSpaceBar
|
|
||||||
-
|
|
||||||
""";
|
|
||||||
|
|
||||||
class Demo extends StatefulWidget {
|
class Demo extends StatefulWidget {
|
||||||
static const String routeName = '/components//Bar/FlexibleSpaceBar';
|
static const String routeName = '/components//Bar/FlexibleSpaceBar';
|
||||||
@ -54,7 +48,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 FlexibleSpaceBar widget
|
* 所有的 FlexibleSpaceBar widget
|
||||||
* context: 运行上下文
|
* context: 运行上下文
|
||||||
* that: 指向有状态的 StatefulWidget
|
* that: 指向有状态的 StatefulWidget
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
* tartget: SliverAppBar 的示例
|
* tartget: SliverAppBar 的示例
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../common/widget-demo.dart';
|
import '../../../../common/widget-demo.dart';
|
||||||
import '../../../../routers/application.dart';
|
import '../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
@ -48,7 +47,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 SliverAppBar widget
|
* 所有的 SliverAppBar widget
|
||||||
* context: 运行上下文
|
* context: 运行上下文
|
||||||
* that: 指向有状态的 StatefulWidget
|
* that: 指向有状态的 StatefulWidget
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../common/widget-demo.dart';
|
import '../../../../common/widget-demo.dart';
|
||||||
import '../../../../routers/application.dart';
|
import '../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
@ -28,11 +27,6 @@ const String _Text1 =
|
|||||||
- 要控制SnackBar保持可见的时间,请指定持续时间。
|
- 要控制SnackBar保持可见的时间,请指定持续时间。
|
||||||
""";
|
""";
|
||||||
|
|
||||||
const String _Text2 =
|
|
||||||
"""### **进阶用法**
|
|
||||||
> SnackBar
|
|
||||||
-
|
|
||||||
""";
|
|
||||||
|
|
||||||
class Demo extends StatefulWidget {
|
class Demo extends StatefulWidget {
|
||||||
static const String routeName = '/components//Bar/SnackBar';
|
static const String routeName = '/components//Bar/SnackBar';
|
||||||
@ -53,7 +47,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 SnackBar widget
|
* 所有的 SnackBar widget
|
||||||
* context: 运行上下文
|
* context: 运行上下文
|
||||||
* that: 指向有状态的 StatefulWidget
|
* that: 指向有状态的 StatefulWidget
|
||||||
|
@ -7,10 +7,8 @@
|
|||||||
* tartget: SnackBarAction 的示例
|
* tartget: SnackBarAction 的示例
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'dart:async';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'demo.dart';
|
|
||||||
|
|
||||||
class SnackBarActionDemo extends StatefulWidget {
|
class SnackBarActionDemo extends StatefulWidget {
|
||||||
_Demo createState() => _Demo();
|
_Demo createState() => _Demo();
|
||||||
|
@ -7,11 +7,7 @@
|
|||||||
* tartget: SnackBarAction 的示例
|
* tartget: SnackBarAction 的示例
|
||||||
*/
|
*/
|
||||||
import '../../../../common/widget_demo.dart';
|
import '../../../../common/widget_demo.dart';
|
||||||
import '../../../../routers/application.dart';
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../../../../components/markdown.dart';
|
|
||||||
import './demo.dart' as SnackBarDemo;
|
import './demo.dart' as SnackBarDemo;
|
||||||
|
|
||||||
const String _Text0 = """
|
const String _Text0 = """
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
* tartget: TabBar 的示例
|
* tartget: TabBar 的示例
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class TabBarDemo extends StatefulWidget {
|
class TabBarDemo extends StatefulWidget {
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
* tartget: SnackBarAction 的示例
|
* tartget: SnackBarAction 的示例
|
||||||
*/
|
*/
|
||||||
import '../../../../common/widget_demo.dart';
|
import '../../../../common/widget_demo.dart';
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import './demo.dart';
|
import './demo.dart';
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
* tartget: Card 的示例
|
* tartget: Card 的示例
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../common/widget-demo.dart';
|
import '../../../../common/widget-demo.dart';
|
||||||
import '../../../../routers/application.dart';
|
import '../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
@ -26,11 +25,6 @@ const String _Text1 =
|
|||||||
> 此示例显示了创建卡片窗口组件,其中显示了相册信息和两个操作
|
> 此示例显示了创建卡片窗口组件,其中显示了相册信息和两个操作
|
||||||
""";
|
""";
|
||||||
|
|
||||||
const String _Text2 =
|
|
||||||
"""### **进阶用法**
|
|
||||||
> Card
|
|
||||||
-
|
|
||||||
""";
|
|
||||||
|
|
||||||
class Demo extends StatefulWidget {
|
class Demo extends StatefulWidget {
|
||||||
static const String routeName = '/components/Card/Card';
|
static const String routeName = '/components/Card/Card';
|
||||||
@ -52,7 +46,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 Card widget
|
* 所有的 Card widget
|
||||||
* context: 运行上下文
|
* context: 运行上下文
|
||||||
* that: 指向有状态的 StatefulWidget
|
* that: 指向有状态的 StatefulWidget
|
||||||
|
@ -27,8 +27,7 @@ final List<InputEntry> _lists=<InputEntry>[
|
|||||||
const InputEntry('web', 'W'),
|
const InputEntry('web', 'W'),
|
||||||
];
|
];
|
||||||
|
|
||||||
List<String> _inputs=<String>[];
|
Iterable<Widget> get _rawChipWidget sync*{
|
||||||
Iterable<Widget> get RawChipWidget sync*{
|
|
||||||
for(InputEntry value in _lists){
|
for(InputEntry value in _lists){
|
||||||
yield Padding(
|
yield Padding(
|
||||||
padding: const EdgeInsets.all(4.0),
|
padding: const EdgeInsets.all(4.0),
|
||||||
@ -57,7 +56,7 @@ Iterable<Widget> get RawChipWidget sync*{
|
|||||||
return Column(
|
return Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Wrap(
|
Wrap(
|
||||||
children: RawChipWidget.toList(),
|
children: _rawChipWidget.toList(),
|
||||||
),
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
* tartget: xxx
|
* tartget: xxx
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'dart:async';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
* tartget: xxx
|
* tartget: xxx
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'dart:async';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
* tartget: xxx
|
* tartget: xxx
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'dart:async';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
|
||||||
@ -72,7 +70,7 @@ class _DialogMoreDemo extends State<DialogMoreDemo> {
|
|||||||
value += 1;
|
value += 1;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Text("我是一个Dialog, 点我更新value: ${value}"),
|
child: Text("我是一个Dialog, 点我更新value: $value"),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -105,3 +103,4 @@ class _DialogMoreDemo extends State<DialogMoreDemo> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
* tartget: xxx
|
* tartget: xxx
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'dart:async';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
* tartget: xxx
|
* tartget: xxx
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'dart:async';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
* tartget: xxx
|
* tartget: xxx
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'dart:async';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
* tartget: xxx
|
* tartget: xxx
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'dart:async';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import './model.dart';
|
import './model.dart';
|
||||||
|
@ -40,7 +40,6 @@ class Demo extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _DemoState extends State<Demo> {
|
class _DemoState extends State<Demo> {
|
||||||
var animatedList = null;
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return WidgetDemo(
|
return WidgetDemo(
|
||||||
@ -52,7 +51,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 AnimatedList widget
|
* 所有的 AnimatedList widget
|
||||||
* context: 运行上下文
|
* context: 运行上下文
|
||||||
* that: 指向有状态的 StatefulWidget
|
* that: 指向有状态的 StatefulWidget
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
* tartget: ListBody 的示例
|
* tartget: ListBody 的示例
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../common/widget-demo.dart';
|
import '../../../../common/widget-demo.dart';
|
||||||
import '../../../../routers/application.dart';
|
import '../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
@ -50,7 +49,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 ListBody widget
|
* 所有的 ListBody widget
|
||||||
* context: 运行上下文
|
* context: 运行上下文
|
||||||
* that: 指向有状态的 StatefulWidget
|
* that: 指向有状态的 StatefulWidget
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
* tartget: ListView 的示例
|
* tartget: ListView 的示例
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -87,8 +86,8 @@ class ListViewLessDefault extends StatelessWidget {
|
|||||||
dense:true, // item 直观感受是整体大小
|
dense:true, // item 直观感受是整体大小
|
||||||
contentPadding: EdgeInsets.all(10.0),// item 内容内边距
|
contentPadding: EdgeInsets.all(10.0),// item 内容内边距
|
||||||
enabled:true,
|
enabled:true,
|
||||||
onTap:(){print('点击:${index}');},// item onTap 点击事件
|
onTap:(){print('点击:$index');},// item onTap 点击事件
|
||||||
onLongPress:(){print('长按:${index}');},// item onLongPress 长按事件
|
onLongPress:(){print('长按:$index');},// item onLongPress 长按事件
|
||||||
selected:false, // item 是否选中状态
|
selected:false, // item 是否选中状态
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -112,8 +111,8 @@ class ListViewLessDefault extends StatelessWidget {
|
|||||||
dense:true, // item 直观感受是整体大小
|
dense:true, // item 直观感受是整体大小
|
||||||
contentPadding: EdgeInsets.all(10.0),// item 内容内边距
|
contentPadding: EdgeInsets.all(10.0),// item 内容内边距
|
||||||
enabled:true,
|
enabled:true,
|
||||||
onTap:(){print('点击:${index}');},// item onTap 点击事件
|
onTap:(){print('点击:$index');},// item onTap 点击事件
|
||||||
onLongPress:(){print('长按:${index}');},// item onLongPress 长按事件
|
onLongPress:(){print('长按:$index');},// item onLongPress 长按事件
|
||||||
selected:false, // item 是否选中状态
|
selected:false, // item 是否选中状态
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../common/widget-demo.dart';
|
import '../../../../common/widget-demo.dart';
|
||||||
import '../../../../routers/application.dart';
|
import '../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
@ -76,7 +75,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 ListView widget
|
* 所有的 ListView widget
|
||||||
* context: 运行上下文
|
* context: 运行上下文
|
||||||
* that: 指向有状态的 StatefulWidget
|
* that: 指向有状态的 StatefulWidget
|
||||||
|
@ -13,7 +13,6 @@ class CheckedPopupMenuItemDemo extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _CheckedPopupMenuItemDemoState extends State<CheckedPopupMenuItemDemo> {
|
class _CheckedPopupMenuItemDemoState extends State<CheckedPopupMenuItemDemo> {
|
||||||
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
|
||||||
List<String> _checkedValues;
|
List<String> _checkedValues;
|
||||||
|
|
||||||
final String _checkedValue1 = 'One';
|
final String _checkedValue1 = 'One';
|
||||||
|
@ -12,7 +12,6 @@ import './DropdownMenuItem/index.dart' as DropdownMenuItem;
|
|||||||
import './PopupMenuButton/index.dart' as PopupMenuButton;
|
import './PopupMenuButton/index.dart' as PopupMenuButton;
|
||||||
import './PopupMenuDivider/index.dart' as PopupMenuDivider;
|
import './PopupMenuDivider/index.dart' as PopupMenuDivider;
|
||||||
import './PopupMenuEntry/index.dart' as PopupMenuEntry;
|
import './PopupMenuEntry/index.dart' as PopupMenuEntry;
|
||||||
import './PopupMenuItem/index.dart' as PopupMenuItem;
|
|
||||||
import './PopupMenuItemState/index.dart' as PopupMenuItemState;
|
import './PopupMenuItemState/index.dart' as PopupMenuItemState;
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
* tartget: BottomNavigationBar 的示例
|
* tartget: BottomNavigationBar 的示例
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
import '../customDemo.dart';
|
import '../customDemo.dart';
|
||||||
import '../../../../routers/application.dart';
|
import '../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
@ -51,7 +50,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 BottomNavigationBar widget
|
* 所有的 BottomNavigationBar widget
|
||||||
* context: 运行上下文
|
* context: 运行上下文
|
||||||
* that: 指向有状态的 StatefulWidget
|
* that: 指向有状态的 StatefulWidget
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
* tartget: BottomNavigationBarItem 的示例
|
* tartget: BottomNavigationBarItem 的示例
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../common/widget-demo.dart';
|
import '../../../../common/widget-demo.dart';
|
||||||
import '../../../../routers/application.dart';
|
import '../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
@ -26,11 +25,6 @@ const String _Text1 =
|
|||||||
> 这个类很少单独使用。通常嵌入在上面的一个底部 bottom navigation widgets 中。
|
> 这个类很少单独使用。通常嵌入在上面的一个底部 bottom navigation widgets 中。
|
||||||
""";
|
""";
|
||||||
|
|
||||||
const String _Text2 =
|
|
||||||
"""### **进阶用法**
|
|
||||||
> BottomNavigationBarItem
|
|
||||||
-
|
|
||||||
""";
|
|
||||||
|
|
||||||
class Demo extends StatefulWidget {
|
class Demo extends StatefulWidget {
|
||||||
static const String routeName = '/components/Navigation/BottomNavigationBarItem';
|
static const String routeName = '/components/Navigation/BottomNavigationBarItem';
|
||||||
@ -51,7 +45,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 BottomNavigationBarItem widget
|
* 所有的 BottomNavigationBarItem widget
|
||||||
* context: 运行上下文
|
* context: 运行上下文
|
||||||
* that: 指向有状态的 StatefulWidget
|
* that: 指向有状态的 StatefulWidget
|
||||||
|
@ -15,7 +15,7 @@ enum Location {
|
|||||||
typedef DemoItemBodyBuilder<T> = Widget Function(DemoItem<T> item);
|
typedef DemoItemBodyBuilder<T> = Widget Function(DemoItem<T> item);
|
||||||
typedef ValueToString<T> = String Function(T value);
|
typedef ValueToString<T> = String Function(T value);
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* google flutter 详情多个例子地址:
|
* google flutter 详情多个例子地址:
|
||||||
* https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart
|
* https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart
|
||||||
*/
|
*/
|
||||||
@ -135,11 +135,6 @@ class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> {
|
|||||||
hint: 'Select location',
|
hint: 'Select location',
|
||||||
valueToString: (Location location) => location.toString().split('.')[1],
|
valueToString: (Location location) => location.toString().split('.')[1],
|
||||||
builder: (DemoItem<Location> item) {
|
builder: (DemoItem<Location> item) {
|
||||||
void close() {
|
|
||||||
setState(() {
|
|
||||||
item.isExpanded = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return Form(
|
return Form(
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: xiaojia.dxj
|
* @Author: xiaojia.dxj
|
||||||
* @Date: 2018-12-17 15:37:32
|
* @Date: 2018-12-17 15:37:32
|
||||||
* @Last Modified by: xiaojia.dxj
|
* @Last Modified by: 一凨
|
||||||
* @Last Modified time: 2018-12-18 19:12:32
|
* @Last Modified time: 2019-01-11 15:17:26
|
||||||
*/
|
*/
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
*/
|
*/
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../../../common/widget_demo.dart';
|
import '../../../../common/widget_demo.dart';
|
||||||
import 'demo.dart';
|
|
||||||
|
|
||||||
const String content0 = '''
|
const String content0 = '''
|
||||||
### **简介**
|
### **简介**
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
* @Last Modified time: 2018-12-15 21:26:11
|
* @Last Modified time: 2018-12-15 21:26:11
|
||||||
*/
|
*/
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import '../../../../common/widget_demo.dart';
|
import '../../../../common/widget_demo.dart';
|
||||||
import './demo.dart';
|
import './demo.dart';
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
* email: zhu.yan@alibaba-inc.com
|
* email: zhu.yan@alibaba-inc.com
|
||||||
* tartget: DropdownButton 的示例
|
* tartget: DropdownButton 的示例
|
||||||
*/
|
*/
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -14,15 +13,15 @@ import 'package:flutter/material.dart';
|
|||||||
* isDisabled:是否是禁用,isDisabled 默认为true
|
* isDisabled:是否是禁用,isDisabled 默认为true
|
||||||
* */
|
* */
|
||||||
class DropdownButtonDefault extends StatelessWidget {
|
class DropdownButtonDefault extends StatelessWidget {
|
||||||
List<DropdownMenuItem> generateItemList() {
|
List<DropdownMenuItem> generateItemList() {
|
||||||
List<DropdownMenuItem> items = new List();
|
final List<DropdownMenuItem> items = new List();
|
||||||
DropdownMenuItem item1 = new DropdownMenuItem(
|
final DropdownMenuItem item1 = new DropdownMenuItem(
|
||||||
value: '张三', child: new Text('张三'));
|
value: '张三', child: new Text('张三'));
|
||||||
DropdownMenuItem item2 = new DropdownMenuItem(
|
final DropdownMenuItem item2 = new DropdownMenuItem(
|
||||||
value: '李四', child: new Text('李四'));
|
value: '李四', child: new Text('李四'));
|
||||||
DropdownMenuItem item3 = new DropdownMenuItem(
|
final DropdownMenuItem item3 = new DropdownMenuItem(
|
||||||
value: '王二', child: new Text('王二'));
|
value: '王二', child: new Text('王二'));
|
||||||
DropdownMenuItem item4 = new DropdownMenuItem(
|
final DropdownMenuItem item4 = new DropdownMenuItem(
|
||||||
value: '麻子', child: new Text('麻子'));
|
value: '麻子', child: new Text('麻子'));
|
||||||
items.add(item1);
|
items.add(item1);
|
||||||
items.add(item2);
|
items.add(item2);
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../../common/widget-demo.dart';
|
import '../../../../../common/widget-demo.dart';
|
||||||
import '../../../../../routers/application.dart';
|
import '../../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
@ -58,7 +57,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 DropdownButton 按钮
|
* 所有的 DropdownButton 按钮
|
||||||
*/
|
*/
|
||||||
Widget allDropdownButtons(BuildContext context,_DemoState that){
|
Widget allDropdownButtons(BuildContext context,_DemoState that){
|
||||||
|
@ -16,7 +16,7 @@ import 'package:flutter/material.dart';
|
|||||||
class FlatButtonDefault extends StatelessWidget {
|
class FlatButtonDefault extends StatelessWidget {
|
||||||
final bool isDisabled;
|
final bool isDisabled;
|
||||||
|
|
||||||
const FlatButtonDefault([bool this.isDisabled = true])
|
const FlatButtonDefault([ this.isDisabled = true])
|
||||||
: assert(isDisabled != null),
|
: assert(isDisabled != null),
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ class FlatButtonIconDefault extends StatelessWidget {
|
|||||||
final IconData icon;
|
final IconData icon;
|
||||||
|
|
||||||
const FlatButtonIconDefault(
|
const FlatButtonIconDefault(
|
||||||
[bool this.isDisabled = true, IconData this.icon = Icons.add_circle])
|
[ this.isDisabled = true, this.icon = Icons.add_circle])
|
||||||
: super();
|
: super();
|
||||||
|
|
||||||
Color _randomColor() {
|
Color _randomColor() {
|
||||||
@ -73,10 +73,10 @@ class FlatButtonCustom extends StatelessWidget {
|
|||||||
final VoidCallback onPressed;
|
final VoidCallback onPressed;
|
||||||
|
|
||||||
const FlatButtonCustom([
|
const FlatButtonCustom([
|
||||||
String this.txt = '自定义按钮',
|
this.txt = '自定义按钮',
|
||||||
Color this.color = Colors.blueAccent,
|
this.color = Colors.blueAccent,
|
||||||
ShapeBorder this.shape,
|
this.shape,
|
||||||
VoidCallback this.onPressed
|
this.onPressed
|
||||||
]) :super();
|
]) :super();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -9,40 +9,11 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../../common/widget-demo.dart';
|
import '../../../../../common/widget-demo.dart';
|
||||||
import '../../../../../routers/application.dart';
|
import '../../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
import './demo.dart' as flatButton;
|
import './demo.dart' as flatButton;
|
||||||
|
|
||||||
const String _markdownData = """# Markdown Example
|
|
||||||
Markdown allows you to easily include formatted text, images, and even formatted Dart code in your app.
|
|
||||||
## Styling
|
|
||||||
Style text as _italic_, __bold__, or `inline code`.
|
|
||||||
- Use bulleted lists
|
|
||||||
- To better clarify
|
|
||||||
- Your points
|
|
||||||
## Links
|
|
||||||
You can use [hyperlinks](hyperlink) in markdown
|
|
||||||
## Images
|
|
||||||
You can include images:
|
|
||||||

|
|
||||||
## Markdown widget
|
|
||||||
This is an example of how to create your own Markdown widget:
|
|
||||||
new Markdown(data: 'Hello _world_!');
|
|
||||||
## Code blocks
|
|
||||||
Formatted Dart code looks really pretty too:
|
|
||||||
```
|
|
||||||
void main() {
|
|
||||||
runApp(new MaterialApp(
|
|
||||||
home: new Scaffold(
|
|
||||||
body: new Markdown(data: markdownData)
|
|
||||||
)
|
|
||||||
));
|
|
||||||
}
|
|
||||||
```
|
|
||||||
Enjoy!
|
|
||||||
""";
|
|
||||||
|
|
||||||
|
|
||||||
const String _flatText0 =
|
const String _flatText0 =
|
||||||
@ -90,7 +61,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 FlatButton 按钮
|
* 所有的 FlatButton 按钮
|
||||||
*/
|
*/
|
||||||
Widget allFlatButtons(BuildContext context){
|
Widget allFlatButtons(BuildContext context){
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
* email: zhu.yan@alibaba-inc.com
|
* email: zhu.yan@alibaba-inc.com
|
||||||
* tartget: OutlineButton 的示例
|
* tartget: OutlineButton 的示例
|
||||||
*/
|
*/
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -16,7 +15,7 @@ import 'package:flutter/material.dart';
|
|||||||
class FloatingActionButtonDefault extends StatelessWidget {
|
class FloatingActionButtonDefault extends StatelessWidget {
|
||||||
final bool isDisabled;
|
final bool isDisabled;
|
||||||
|
|
||||||
const FloatingActionButtonDefault([bool this.isDisabled = true])
|
const FloatingActionButtonDefault([ this.isDisabled = true])
|
||||||
: assert(isDisabled != null),
|
: assert(isDisabled != null),
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@ -41,10 +40,10 @@ class FloatingActionButtonCustom extends StatelessWidget {
|
|||||||
final VoidCallback onPressed;
|
final VoidCallback onPressed;
|
||||||
|
|
||||||
const FloatingActionButtonCustom(
|
const FloatingActionButtonCustom(
|
||||||
[String this.txt = '自定义按钮',
|
[ this.txt = '自定义按钮',
|
||||||
Color this.color = Colors.orange,
|
this.color = Colors.orange,
|
||||||
ShapeBorder this.shape,
|
this.shape,
|
||||||
VoidCallback this.onPressed])
|
this.onPressed])
|
||||||
: super();
|
: super();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -93,10 +92,10 @@ class FloatingActionButtonCustom2 extends StatelessWidget {
|
|||||||
final VoidCallback onPressed;
|
final VoidCallback onPressed;
|
||||||
|
|
||||||
const FloatingActionButtonCustom2(
|
const FloatingActionButtonCustom2(
|
||||||
[String this.txt = '自定义按钮',
|
[ this.txt = '自定义按钮',
|
||||||
Color this.color = Colors.orange,
|
this.color = Colors.orange,
|
||||||
ShapeBorder this.shape,
|
this.shape,
|
||||||
VoidCallback this.onPressed])
|
this.onPressed])
|
||||||
: super();
|
: super();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -15,8 +15,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
import './demo.dart' as floatingActionButton;
|
import './demo.dart' as floatingActionButton;
|
||||||
|
|
||||||
const String _floatingActionTitle =
|
|
||||||
'FloatingAction Button 示例';
|
|
||||||
|
|
||||||
const String _floatingActionText0 =
|
const String _floatingActionText0 =
|
||||||
"""### **简介**
|
"""### **简介**
|
||||||
@ -70,7 +68,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 FloatingActionButton 按钮
|
* 所有的 FloatingActionButton 按钮
|
||||||
*/
|
*/
|
||||||
Widget allFloatingActionButtons(BuildContext context,_DemoState that){
|
Widget allFloatingActionButtons(BuildContext context,_DemoState that){
|
||||||
@ -107,26 +105,26 @@ Widget allFloatingActionButtons(BuildContext context,_DemoState that){
|
|||||||
* alert 弹框
|
* alert 弹框
|
||||||
* context:容器的父级
|
* context:容器的父级
|
||||||
* */
|
* */
|
||||||
void _showMessage(String name, BuildContext context) {
|
// void _showMessage(String name, BuildContext context) {
|
||||||
showDialog(
|
// showDialog(
|
||||||
// alert 的父级
|
// // alert 的父级
|
||||||
context: context,
|
// context: context,
|
||||||
builder: (BuildContext context) {
|
// builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
// return AlertDialog(
|
||||||
title: new Text('提示'),
|
// title: new Text('提示'),
|
||||||
content: new Text(name),
|
// content: new Text(name),
|
||||||
actions: <Widget>[
|
// actions: <Widget>[
|
||||||
new FlatButton(
|
// new FlatButton(
|
||||||
// alert 的取消按钮
|
// // alert 的取消按钮
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
// 取消的事件
|
// // 取消的事件
|
||||||
Navigator.of(context).pop(true);
|
// Navigator.of(context).pop(true);
|
||||||
},
|
// },
|
||||||
child: new Text('取消'))
|
// child: new Text('取消'))
|
||||||
]);
|
// ]);
|
||||||
}
|
// }
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 带align的text
|
* 带align的text
|
||||||
|
@ -19,7 +19,7 @@ final int len = IconNames.Names.length;
|
|||||||
class IconButtonDefault extends StatelessWidget {
|
class IconButtonDefault extends StatelessWidget {
|
||||||
final bool isDisabled;
|
final bool isDisabled;
|
||||||
|
|
||||||
const IconButtonDefault([bool this.isDisabled = true])
|
const IconButtonDefault([ this.isDisabled = true])
|
||||||
: assert(isDisabled != null),
|
: assert(isDisabled != null),
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@ -43,10 +43,10 @@ class IconButtonCustom extends StatelessWidget {
|
|||||||
final VoidCallback onPressed;
|
final VoidCallback onPressed;
|
||||||
|
|
||||||
const IconButtonCustom(
|
const IconButtonCustom(
|
||||||
[String this.txt = '自定义按钮',
|
[ this.txt = '自定义按钮',
|
||||||
Color this.color = Colors.blueAccent,
|
this.color = Colors.blueAccent,
|
||||||
ShapeBorder this.shape,
|
this.shape,
|
||||||
VoidCallback this.onPressed])
|
this.onPressed])
|
||||||
: super();
|
: super();
|
||||||
|
|
||||||
getIcons(){
|
getIcons(){
|
||||||
|
@ -61,7 +61,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 IconButton 按钮
|
* 所有的 IconButton 按钮
|
||||||
*/
|
*/
|
||||||
Widget allIconButtons(BuildContext context,_DemoState that){
|
Widget allIconButtons(BuildContext context,_DemoState that){
|
||||||
|
@ -16,7 +16,7 @@ import 'package:flutter/material.dart';
|
|||||||
class OutlineButtonDefault extends StatelessWidget {
|
class OutlineButtonDefault extends StatelessWidget {
|
||||||
final bool isDisabled;
|
final bool isDisabled;
|
||||||
|
|
||||||
const OutlineButtonDefault([bool this.isDisabled = true])
|
const OutlineButtonDefault([ this.isDisabled = true])
|
||||||
: assert(isDisabled != null),
|
: assert(isDisabled != null),
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ class OutlineButtonIconDefault extends StatelessWidget {
|
|||||||
final IconData icon;
|
final IconData icon;
|
||||||
|
|
||||||
const OutlineButtonIconDefault(
|
const OutlineButtonIconDefault(
|
||||||
[bool this.isDisabled = true, IconData this.icon = Icons.add_circle])
|
[ this.isDisabled = true, this.icon = Icons.add_circle])
|
||||||
: super();
|
: super();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -66,10 +66,10 @@ class OutlineButtonCustom extends StatelessWidget {
|
|||||||
final VoidCallback onPressed;
|
final VoidCallback onPressed;
|
||||||
|
|
||||||
const OutlineButtonCustom(
|
const OutlineButtonCustom(
|
||||||
[String this.txt = '自定义按钮',
|
[ this.txt = '自定义按钮',
|
||||||
Color this.color = Colors.blueAccent,
|
this.color = Colors.blueAccent,
|
||||||
ShapeBorder this.shape,
|
this.shape,
|
||||||
VoidCallback this.onPressed])
|
this.onPressed])
|
||||||
: super();
|
: super();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -70,7 +70,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 OutlineButton 按钮
|
* 所有的 OutlineButton 按钮
|
||||||
*/
|
*/
|
||||||
Widget allOutlineButtons(BuildContext context,_DemoState that){
|
Widget allOutlineButtons(BuildContext context,_DemoState that){
|
||||||
@ -131,26 +131,26 @@ Widget allOutlineButtons(BuildContext context,_DemoState that){
|
|||||||
* alert 弹框
|
* alert 弹框
|
||||||
* context:容器的父级
|
* context:容器的父级
|
||||||
* */
|
* */
|
||||||
void _showMessage(String name, BuildContext context) {
|
// void _showMessage(String name, BuildContext context) {
|
||||||
showDialog(
|
// showDialog(
|
||||||
// alert 的父级
|
// // alert 的父级
|
||||||
context: context,
|
// context: context,
|
||||||
builder: (BuildContext context) {
|
// builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
// return AlertDialog(
|
||||||
title: new Text('提示'),
|
// title: new Text('提示'),
|
||||||
content: new Text(name),
|
// content: new Text(name),
|
||||||
actions: <Widget>[
|
// actions: <Widget>[
|
||||||
new FlatButton(
|
// new FlatButton(
|
||||||
// alert 的取消按钮
|
// // alert 的取消按钮
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
// 取消的事件
|
// // 取消的事件
|
||||||
Navigator.of(context).pop(true);
|
// Navigator.of(context).pop(true);
|
||||||
},
|
// },
|
||||||
child: new Text('取消'))
|
// child: new Text('取消'))
|
||||||
]);
|
// ]);
|
||||||
}
|
// }
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 带align的text
|
* 带align的text
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
* email: zhu.yan@alibaba-inc.com
|
* email: zhu.yan@alibaba-inc.com
|
||||||
* tartget: RaisedButton 的示例
|
* tartget: RaisedButton 的示例
|
||||||
*/
|
*/
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -20,7 +19,7 @@ class PopupMenuButtonDefault extends StatelessWidget {
|
|||||||
final String type;
|
final String type;
|
||||||
|
|
||||||
const PopupMenuButtonDefault(
|
const PopupMenuButtonDefault(
|
||||||
[String this.type = 'default1', bool this.isDisabled = true])
|
[ this.type = 'default1', this.isDisabled = true])
|
||||||
: assert(isDisabled != null),
|
: assert(isDisabled != null),
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@ -107,7 +106,7 @@ class PopupMenuButtonCustom extends StatelessWidget {
|
|||||||
label: Text(
|
label: Text(
|
||||||
'自定义按钮', style: TextStyle(color: Colors.white),
|
'自定义按钮', style: TextStyle(color: Colors.white),
|
||||||
semanticsLabel: 'FLAT BUTTON'),
|
semanticsLabel: 'FLAT BUTTON'),
|
||||||
// onPressed:(){} // 激活状态按钮
|
onPressed:(){} // 激活状态按钮
|
||||||
),
|
),
|
||||||
// 打开时放置菜单的z坐标。这可以控制菜单下方阴影的大小。
|
// 打开时放置菜单的z坐标。这可以控制菜单下方阴影的大小。
|
||||||
elevation:10.0,
|
elevation:10.0,
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
import '../../../../../common/widget-demo.dart';
|
import '../../../../../common/widget-demo.dart';
|
||||||
import '../../../../../routers/application.dart';
|
import '../../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
import './demo.dart' as popupMenuButton;
|
import './demo.dart' as popupMenuButton;
|
||||||
@ -38,8 +37,9 @@ const String _titleText2 = """
|
|||||||
class Demo extends StatefulWidget {
|
class Demo extends StatefulWidget {
|
||||||
static const String routeName = '/element/Form/Button/PopupMenuButton';
|
static const String routeName = '/element/Form/Button/PopupMenuButton';
|
||||||
final Map<String,String> options = {'defaultSelect': '选项二的内容'};
|
final Map<String,String> options = {'defaultSelect': '选项二的内容'};
|
||||||
@override
|
|
||||||
final _DemoState self = _DemoState();
|
final _DemoState self = _DemoState();
|
||||||
|
|
||||||
|
@override
|
||||||
_DemoState createState() => self;
|
_DemoState createState() => self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ import 'package:flutter/material.dart';
|
|||||||
class RaisedButtonDefault extends StatelessWidget {
|
class RaisedButtonDefault extends StatelessWidget {
|
||||||
final bool isDisabled;
|
final bool isDisabled;
|
||||||
|
|
||||||
const RaisedButtonDefault([bool this.isDisabled = true])
|
const RaisedButtonDefault([ this.isDisabled = true])
|
||||||
: assert(isDisabled != null),
|
: assert(isDisabled != null),
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ class RaisedButtonIconDefault extends StatelessWidget {
|
|||||||
final IconData icon;
|
final IconData icon;
|
||||||
|
|
||||||
const RaisedButtonIconDefault(
|
const RaisedButtonIconDefault(
|
||||||
[bool this.isDisabled = true, IconData this.icon = Icons.add_circle])
|
[ this.isDisabled = true, this.icon = Icons.add_circle])
|
||||||
: super();
|
: super();
|
||||||
|
|
||||||
Color _randomColor() {
|
Color _randomColor() {
|
||||||
@ -73,10 +73,10 @@ class RaisedButtonCustom extends StatelessWidget {
|
|||||||
final VoidCallback onPressed;
|
final VoidCallback onPressed;
|
||||||
|
|
||||||
const RaisedButtonCustom(
|
const RaisedButtonCustom(
|
||||||
[String this.txt = '自定义按钮',
|
[ this.txt = '自定义按钮',
|
||||||
Color this.color = Colors.blueAccent,
|
this.color = Colors.blueAccent,
|
||||||
ShapeBorder this.shape,
|
this.shape,
|
||||||
VoidCallback this.onPressed])
|
this.onPressed])
|
||||||
: super();
|
: super();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -70,7 +70,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 RaisedButton 按钮
|
* 所有的 RaisedButton 按钮
|
||||||
*/
|
*/
|
||||||
Widget allRaisedButtons(BuildContext context,_DemoState that){
|
Widget allRaisedButtons(BuildContext context,_DemoState that){
|
||||||
@ -131,26 +131,26 @@ Widget allRaisedButtons(BuildContext context,_DemoState that){
|
|||||||
* alert 弹框
|
* alert 弹框
|
||||||
* context:容器的父级
|
* context:容器的父级
|
||||||
* */
|
* */
|
||||||
void _showMessage(String name, BuildContext context) {
|
// void _showMessage(String name, BuildContext context) {
|
||||||
showDialog(
|
// showDialog(
|
||||||
// alert 的父级
|
// // alert 的父级
|
||||||
context: context,
|
// context: context,
|
||||||
builder: (BuildContext context) {
|
// builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
// return AlertDialog(
|
||||||
title: new Text('提示'),
|
// title: new Text('提示'),
|
||||||
content: new Text(name),
|
// content: new Text(name),
|
||||||
actions: <Widget>[
|
// actions: <Widget>[
|
||||||
new FlatButton(
|
// new FlatButton(
|
||||||
// alert 的取消按钮
|
// // alert 的取消按钮
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
// 取消的事件
|
// // 取消的事件
|
||||||
Navigator.of(context).pop(true);
|
// Navigator.of(context).pop(true);
|
||||||
},
|
// },
|
||||||
child: new Text('取消'))
|
// child: new Text('取消'))
|
||||||
]);
|
// ]);
|
||||||
}
|
// }
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 带align的text
|
* 带align的text
|
||||||
|
@ -16,7 +16,7 @@ import 'package:flutter/material.dart';
|
|||||||
class RawMaterialButtonDefault extends StatelessWidget {
|
class RawMaterialButtonDefault extends StatelessWidget {
|
||||||
final bool isDisabled;
|
final bool isDisabled;
|
||||||
|
|
||||||
const RawMaterialButtonDefault([bool this.isDisabled = true])
|
const RawMaterialButtonDefault([ this.isDisabled = true])
|
||||||
: assert(isDisabled != null),
|
: assert(isDisabled != null),
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@ -39,10 +39,10 @@ class RawMaterialButtonCustom extends StatelessWidget {
|
|||||||
final VoidCallback onPressed;
|
final VoidCallback onPressed;
|
||||||
|
|
||||||
const RawMaterialButtonCustom(
|
const RawMaterialButtonCustom(
|
||||||
[String this.txt = '自定义按钮',
|
[ this.txt = '自定义按钮',
|
||||||
Color this.color = Colors.blueAccent,
|
this.color = Colors.blueAccent,
|
||||||
ShapeBorder this.shape,
|
this.shape,
|
||||||
VoidCallback this.onPressed])
|
this.onPressed])
|
||||||
: super();
|
: super();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -59,7 +59,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 RawMaterialButton 按钮
|
* 所有的 RawMaterialButton 按钮
|
||||||
*/
|
*/
|
||||||
Widget allRawMaterialButtons(BuildContext context,_DemoState that){
|
Widget allRawMaterialButtons(BuildContext context,_DemoState that){
|
||||||
@ -103,26 +103,26 @@ Widget allRawMaterialButtons(BuildContext context,_DemoState that){
|
|||||||
* alert 弹框
|
* alert 弹框
|
||||||
* context:容器的父级
|
* context:容器的父级
|
||||||
* */
|
* */
|
||||||
void _showMessage(String name, BuildContext context) {
|
// void _showMessage(String name, BuildContext context) {
|
||||||
showDialog(
|
// showDialog(
|
||||||
// alert 的父级
|
// // alert 的父级
|
||||||
context: context,
|
// context: context,
|
||||||
builder: (BuildContext context) {
|
// builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
// return AlertDialog(
|
||||||
title: new Text('提示'),
|
// title: new Text('提示'),
|
||||||
content: new Text(name),
|
// content: new Text(name),
|
||||||
actions: <Widget>[
|
// actions: <Widget>[
|
||||||
new FlatButton(
|
// new FlatButton(
|
||||||
// alert 的取消按钮
|
// // alert 的取消按钮
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
// 取消的事件
|
// // 取消的事件
|
||||||
Navigator.of(context).pop(true);
|
// Navigator.of(context).pop(true);
|
||||||
},
|
// },
|
||||||
child: new Text('取消'))
|
// child: new Text('取消'))
|
||||||
]);
|
// ]);
|
||||||
}
|
// }
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 带align的text
|
* 带align的text
|
||||||
|
@ -16,7 +16,7 @@ import 'package:flutter/material.dart';
|
|||||||
class CheckboxDefault extends StatefulWidget{
|
class CheckboxDefault extends StatefulWidget{
|
||||||
final int index;
|
final int index;
|
||||||
final parent;
|
final parent;
|
||||||
const CheckboxDefault([this.parent,int this.index = -1]) : super();
|
const CheckboxDefault([this.parent, this.index = -1]) : super();
|
||||||
@override
|
@override
|
||||||
State<StatefulWidget> createState() =>_CheckboxDefault();
|
State<StatefulWidget> createState() =>_CheckboxDefault();
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ class CheckboxSelect extends StatelessWidget {
|
|||||||
final widget;
|
final widget;
|
||||||
final parent;
|
final parent;
|
||||||
|
|
||||||
const CheckboxSelect([this.widget,this.parent,int this.index = -1])
|
const CheckboxSelect([this.widget,this.parent, this.index = -1])
|
||||||
: super();
|
: super();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../../common/widget-demo.dart';
|
import '../../../../../common/widget-demo.dart';
|
||||||
import '../../../../../routers/application.dart';
|
import '../../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
@ -55,7 +54,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 Checkbox 按钮
|
* 所有的 Checkbox 按钮
|
||||||
*/
|
*/
|
||||||
Widget allCheckboxs(BuildContext context,_DemoState that){
|
Widget allCheckboxs(BuildContext context,_DemoState that){
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
* tartget: CheckboxListTile 的示例
|
* tartget: CheckboxListTile 的示例
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,9 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
import '../../../../../common/widget-demo.dart';
|
import '../../../../../common/widget-demo.dart';
|
||||||
import '../../../../../routers/application.dart';
|
import '../../../../../routers/application.dart';
|
||||||
import 'dart:math';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
|
||||||
|
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
import './demo.dart' as CheckboxListTileDemo;
|
import './demo.dart' as CheckboxListTileDemo;
|
||||||
@ -39,7 +37,7 @@ const String _CheckboxListTileText2 =
|
|||||||
|
|
||||||
class Demo extends StatefulWidget {
|
class Demo extends StatefulWidget {
|
||||||
static const String routeName = '/element/Form/Checkbox/CheckboxListTile';
|
static const String routeName = '/element/Form/Checkbox/CheckboxListTile';
|
||||||
bool valBool = true;
|
final bool valBool = true;
|
||||||
@override
|
@override
|
||||||
_DemoState createState() => _DemoState();
|
_DemoState createState() => _DemoState();
|
||||||
}
|
}
|
||||||
@ -56,7 +54,7 @@ class _DemoState extends State<Demo> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* 所有的 CheckboxListTile widget
|
* 所有的 CheckboxListTile widget
|
||||||
* context: 运行上下文
|
* context: 运行上下文
|
||||||
* that: 指向有状态的 StatefulWidget
|
* that: 指向有状态的 StatefulWidget
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../../../../common/widget_demo.dart';
|
import '../../../../../common/widget_demo.dart';
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
|
||||||
import 'demo.dart';
|
import 'demo.dart';
|
||||||
const content1 = """
|
const content1 = """
|
||||||
# Radio
|
# Radio
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Author: xiaojia.dxj
|
* Author: xiaojia.dxj
|
||||||
* Date: 2018/11/22
|
* Date: 2018/11/22
|
||||||
* Email: xiaojia.dxj@alibaba-inc.com
|
* Email: xiaojia.dxj@alibaba-inc.com
|
||||||
@ -14,7 +14,7 @@ class AlignAlignment extends StatelessWidget {
|
|||||||
final Alignment status;
|
final Alignment status;
|
||||||
final String dec;
|
final String dec;
|
||||||
|
|
||||||
const AlignAlignment(Alignment this.status, String this.dec) : super();
|
const AlignAlignment( this.status, this.dec) : super();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -39,8 +39,8 @@ class AlignFactor extends StatelessWidget {
|
|||||||
final double hFactor;
|
final double hFactor;
|
||||||
final String dec;
|
final String dec;
|
||||||
|
|
||||||
const AlignFactor(Alignment this.status, double this.wFactor,
|
const AlignFactor( this.status, this.wFactor,
|
||||||
double this.hFactor, String this.dec)
|
this.hFactor, this.dec)
|
||||||
: super();
|
: super();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -41,12 +41,12 @@ class _DemoState extends State<Demo> {
|
|||||||
contentList: [
|
contentList: [
|
||||||
_flatText0,
|
_flatText0,
|
||||||
_flatText1,
|
_flatText1,
|
||||||
_AlignCreate()
|
_alignCreate()
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Column _AlignCreate() {
|
Column _alignCreate() {
|
||||||
return new Column(
|
return new Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(height: 10.0),
|
SizedBox(height: 10.0),
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import '../../../../../common/widget-demo.dart';
|
|
||||||
|
|
||||||
class Demo extends StatefulWidget {
|
|
||||||
static const String routeName = '/element/Frame/Axis/crossAxis';
|
|
||||||
_DemoState createState() => _DemoState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DemoState extends State<Demo> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return WidgetDemo(
|
|
||||||
title: 'crossAxis',
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Container(
|
|
||||||
height: 20.0,
|
|
||||||
width: 20.0,
|
|
||||||
color: Colors.blueAccent,
|
|
||||||
margin: const EdgeInsets.all(10.0),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 20.0,
|
|
||||||
width: 20.0,
|
|
||||||
color: Colors.blueAccent,
|
|
||||||
margin: const EdgeInsets.all(10.0),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 20.0,
|
|
||||||
width: 20.0,
|
|
||||||
color: Colors.blueAccent,
|
|
||||||
margin: const EdgeInsets.all(10.0),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 20.0,
|
|
||||||
width: 20.0,
|
|
||||||
color: Colors.blueAccent,
|
|
||||||
margin: const EdgeInsets.all(10.0),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
docUrl: 'https://docs.flutter.io/flutter/widgets/Padding-class.html',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,79 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import '../../../../../common/widget-demo.dart';
|
|
||||||
|
|
||||||
class Demo extends StatefulWidget {
|
|
||||||
static const String routeName = '/element/Frame/Axis/flipAxis';
|
|
||||||
_DemoState createState() => _DemoState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DemoState extends State<Demo> {
|
|
||||||
Axis _direction ;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
// TODO: implement initState
|
|
||||||
super.initState();
|
|
||||||
_direction = Axis.horizontal;
|
|
||||||
}
|
|
||||||
|
|
||||||
Axis flipAxis() {
|
|
||||||
assert(_direction != null);
|
|
||||||
switch (_direction) {
|
|
||||||
case Axis.horizontal:
|
|
||||||
return Axis.vertical;
|
|
||||||
case Axis.vertical:
|
|
||||||
return Axis.horizontal;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
_changeDirection(){
|
|
||||||
setState(() {
|
|
||||||
_direction=flipAxis();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return WidgetDemo(
|
|
||||||
title: 'flipAxis',
|
|
||||||
child: Flex(
|
|
||||||
direction: _direction,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
Container(
|
|
||||||
height: 20.0,
|
|
||||||
width: 20.0,
|
|
||||||
color: Colors.blueAccent,
|
|
||||||
margin: const EdgeInsets.all(10.0),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 20.0,
|
|
||||||
width: 20.0,
|
|
||||||
color: Colors.blueAccent,
|
|
||||||
margin: const EdgeInsets.all(10.0),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 20.0,
|
|
||||||
width: 20.0,
|
|
||||||
color: Colors.blueAccent,
|
|
||||||
margin: const EdgeInsets.all(10.0),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 20.0,
|
|
||||||
width: 20.0,
|
|
||||||
color: Colors.blueAccent,
|
|
||||||
margin: const EdgeInsets.all(10.0),
|
|
||||||
),
|
|
||||||
RaisedButton(
|
|
||||||
child: Text('change direction'),
|
|
||||||
onPressed: _changeDirection,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
docUrl: 'https://docs.flutter.io/flutter/painting/flipAxis.html',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import '../../../../model/widget.dart';
|
|
||||||
|
|
||||||
import './crossAxis/index.dart' as crossAxis;
|
|
||||||
import './flipAxis/index.dart' as flipAxis;
|
|
||||||
import './mainAxis/index.dart' as mainAxis;
|
|
||||||
|
|
||||||
List<WidgetPoint> widgetPoints = [
|
|
||||||
WidgetPoint(
|
|
||||||
name: 'crossAxis',
|
|
||||||
routerName: crossAxis.Demo.routeName,
|
|
||||||
buildRouter: (BuildContext context) => crossAxis.Demo(),
|
|
||||||
),
|
|
||||||
WidgetPoint(
|
|
||||||
name: 'flipAxis',
|
|
||||||
routerName: flipAxis.Demo.routeName,
|
|
||||||
buildRouter: (BuildContext context) => flipAxis.Demo(),
|
|
||||||
),
|
|
||||||
WidgetPoint(
|
|
||||||
name: 'mainAxis',
|
|
||||||
routerName: mainAxis.Demo.routeName,
|
|
||||||
buildRouter: (BuildContext context) => mainAxis.Demo(),
|
|
||||||
),
|
|
||||||
];
|
|
@ -1,50 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import '../../../../../common/widget-demo.dart';
|
|
||||||
|
|
||||||
class Demo extends StatefulWidget {
|
|
||||||
static const String routeName = '/element/Frame/Axis/Table';
|
|
||||||
_DemoState createState() => _DemoState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DemoState extends State<Demo> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return WidgetDemo(
|
|
||||||
title: 'mainAxis',
|
|
||||||
child: Flex(
|
|
||||||
direction: Axis.vertical,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
Container(
|
|
||||||
height: 20.0,
|
|
||||||
width: 20.0,
|
|
||||||
color: Colors.blueAccent,
|
|
||||||
margin: const EdgeInsets.all(10.0),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 20.0,
|
|
||||||
width: 20.0,
|
|
||||||
color: Colors.blueAccent,
|
|
||||||
margin: const EdgeInsets.all(10.0),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 20.0,
|
|
||||||
width: 20.0,
|
|
||||||
color: Colors.blueAccent,
|
|
||||||
margin: const EdgeInsets.all(10.0),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 20.0,
|
|
||||||
width: 20.0,
|
|
||||||
color: Colors.blueAccent,
|
|
||||||
margin: const EdgeInsets.all(10.0),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
docUrl:
|
|
||||||
'https://docs.flutter.io/flutter/material/MergeableMaterial/mainAxis.html',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Author: xiaojia.dxj
|
* Author: xiaojia.dxj
|
||||||
* Date: 2018/11/22
|
* Date: 2018/11/22
|
||||||
* Email: xiaojia.dxj@alibaba-inc.com
|
* Email: xiaojia.dxj@alibaba-inc.com
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Author: xiaojia.dxj
|
* Author: xiaojia.dxj
|
||||||
* Date: 2018/11/22
|
* Date: 2018/11/22
|
||||||
* Email: xiaojia.dxj@alibaba-inc.com
|
* Email: xiaojia.dxj@alibaba-inc.com
|
||||||
|
@ -32,13 +32,13 @@ class _DemoState extends State<Demo> {
|
|||||||
contentList: [
|
contentList: [
|
||||||
_Text,
|
_Text,
|
||||||
_Text1,
|
_Text1,
|
||||||
_DecoratedBoxCreate(),
|
_decoratedBoxCreate(),
|
||||||
],
|
],
|
||||||
docUrl: 'https://docs.flutter.io/flutter/widgets/DecoratedBox-class.html',
|
docUrl: 'https://docs.flutter.io/flutter/widgets/DecoratedBox-class.html',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Column _DecoratedBoxCreate() {
|
Column _decoratedBoxCreate() {
|
||||||
return new Column(
|
return new Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Author: xiaojia.dxj
|
* Author: xiaojia.dxj
|
||||||
* Date: 2018/12/2
|
* Date: 2018/12/2
|
||||||
* Email: xiaojia.dxj@alibaba-inc.com
|
* Email: xiaojia.dxj@alibaba-inc.com
|
||||||
@ -13,9 +13,9 @@ import 'package:flutter/widgets.dart';
|
|||||||
|
|
||||||
class FittedBoxDefault extends StatelessWidget {
|
class FittedBoxDefault extends StatelessWidget {
|
||||||
final BoxFit curfit;
|
final BoxFit curfit;
|
||||||
String dec;
|
final String dec;
|
||||||
|
|
||||||
FittedBoxDefault({Key key, BoxFit this.curfit, this.dec});
|
FittedBoxDefault({Key key, this.curfit, this.dec});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -42,12 +42,12 @@ class _DemoState extends State<Demo> {
|
|||||||
contentList: [
|
contentList: [
|
||||||
Text0,
|
Text0,
|
||||||
Text1,
|
Text1,
|
||||||
_FittedBoxCreate(),
|
_fittedBoxCreate(),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Column _FittedBoxCreate() {
|
Column _fittedBoxCreate() {
|
||||||
return Column(
|
return Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Row(
|
Row(
|
||||||
|
@ -2,19 +2,19 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
class OverflowBoxDefault extends StatelessWidget {
|
class OverflowBoxDefault extends StatelessWidget {
|
||||||
double curmaxHeight;
|
final double curmaxHeight;
|
||||||
double curmaxWidth;
|
final double curmaxWidth;
|
||||||
double curHeight;
|
final double curHeight;
|
||||||
double curWidth;
|
final double curWidth;
|
||||||
AlignmentGeometry curalignment;
|
final AlignmentGeometry curalignment;
|
||||||
|
|
||||||
OverflowBoxDefault(
|
OverflowBoxDefault(
|
||||||
{Key key,
|
{Key key,
|
||||||
double this.curmaxHeight,
|
this.curmaxHeight,
|
||||||
double this.curmaxWidth,
|
this.curmaxWidth,
|
||||||
double this.curWidth,
|
this.curWidth,
|
||||||
double this.curHeight,
|
this.curHeight,
|
||||||
AlignmentGeometry this.curalignment})
|
this.curalignment})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
* @Last Modified time: 2019-01-08 15:56:31
|
* @Last Modified time: 2019-01-08 15:56:31
|
||||||
*/
|
*/
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
|
||||||
import '../../../../../common/widget_demo.dart';
|
import '../../../../../common/widget_demo.dart';
|
||||||
import './demo.dart' as overflowBox;
|
import './demo.dart' as overflowBox;
|
||||||
|
|
||||||
@ -39,12 +38,12 @@ class _DemoState extends State<Demo> {
|
|||||||
contentList: [
|
contentList: [
|
||||||
Text0,
|
Text0,
|
||||||
Text1,
|
Text1,
|
||||||
_OverflowBoxCreate(),
|
_overflowBoxCreate(),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Row _OverflowBoxCreate() {
|
Row _overflowBoxCreate() {
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user