mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-06-03 00:14:22 +08:00
46
lib/common/example_code_parser.dart
Normal file
46
lib/common/example_code_parser.dart
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* @Author: 一凨
|
||||||
|
* @Date: 2019-01-14 11:42:36
|
||||||
|
* @Last Modified by: 一凨
|
||||||
|
* @Last Modified time: 2019-01-14 16:53:11
|
||||||
|
*/
|
||||||
|
// Copyright 2016 The Chromium Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
import '../routers/application.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
const String _kStartTag = '// START ';
|
||||||
|
const String _kEndTag = '// END';
|
||||||
|
|
||||||
|
Map<String, String> _exampleCode;
|
||||||
|
String _code;
|
||||||
|
|
||||||
|
void _launchURL(String url) async {
|
||||||
|
if (await canLaunch(url)) {
|
||||||
|
await launch(url);
|
||||||
|
} else {
|
||||||
|
throw 'Could not launch $url';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> getExampleCode(context,String filePath, AssetBundle bundle) async {
|
||||||
|
if (_exampleCode == null) await _parseExampleCode(context,filePath, bundle);
|
||||||
|
return _code;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _parseExampleCode(context,String filePath, AssetBundle bundle) async {
|
||||||
|
String code;
|
||||||
|
try {
|
||||||
|
code = await bundle.loadString('lib/widgets/$filePath');
|
||||||
|
} catch (err) {
|
||||||
|
print('${Application.github['widgetsURL']} $filePath');
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
_launchURL(Application.github['widgetsURL'] + filePath);
|
||||||
|
}
|
||||||
|
_code = code;
|
||||||
|
}
|
73
lib/common/full_screen_code_dialog.dart
Normal file
73
lib/common/full_screen_code_dialog.dart
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* @Author: 一凨
|
||||||
|
* @Date: 2019-01-14 11:42:32
|
||||||
|
* @Last Modified by: 一凨
|
||||||
|
* @Last Modified time: 2019-01-14 14:42:00
|
||||||
|
*/
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'example_code_parser.dart';
|
||||||
|
import 'syntax_highlighter.dart';
|
||||||
|
|
||||||
|
class FullScreenCodeDialog extends StatefulWidget {
|
||||||
|
const FullScreenCodeDialog({this.filePath});
|
||||||
|
|
||||||
|
final String filePath;
|
||||||
|
_FullScreenCodeDialogState createState() => _FullScreenCodeDialogState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FullScreenCodeDialogState extends State<FullScreenCodeDialog> {
|
||||||
|
String _exampleCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didChangeDependencies() {
|
||||||
|
getExampleCode(context,'${widget.filePath}', DefaultAssetBundle.of(context))
|
||||||
|
.then<void>((String code) {
|
||||||
|
if (mounted) {
|
||||||
|
setState(() {
|
||||||
|
_exampleCode = code ?? 'Example code not found';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
super.didChangeDependencies();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final SyntaxHighlighterStyle style =
|
||||||
|
Theme.of(context).brightness == Brightness.dark
|
||||||
|
? SyntaxHighlighterStyle.darkThemeStyle()
|
||||||
|
: SyntaxHighlighterStyle.lightThemeStyle();
|
||||||
|
|
||||||
|
Widget body;
|
||||||
|
if (_exampleCode == null) {
|
||||||
|
body = const Center(child: CircularProgressIndicator());
|
||||||
|
} else {
|
||||||
|
body = SingleChildScrollView(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
style: const TextStyle(fontFamily: 'monospace', fontSize: 10.0),
|
||||||
|
children: <TextSpan>[
|
||||||
|
DartSyntaxHighlighter(style).format(_exampleCode)
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
leading: IconButton(
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.clear,
|
||||||
|
semanticLabel: 'Close',
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
}),
|
||||||
|
title: const Text('Example code'),
|
||||||
|
),
|
||||||
|
body: body);
|
||||||
|
}
|
||||||
|
}
|
362
lib/common/syntax_highlighter.dart
Normal file
362
lib/common/syntax_highlighter.dart
Normal file
@ -0,0 +1,362 @@
|
|||||||
|
/*
|
||||||
|
* @Author: 一凨
|
||||||
|
* @Date: 2019-01-14 11:42:39
|
||||||
|
* @Last Modified by: 一凨
|
||||||
|
* @Last Modified time: 2019-01-14 11:42:39
|
||||||
|
*/
|
||||||
|
// Copyright 2016 The Chromium Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:string_scanner/string_scanner.dart';
|
||||||
|
|
||||||
|
class SyntaxHighlighterStyle {
|
||||||
|
SyntaxHighlighterStyle({
|
||||||
|
this.baseStyle,
|
||||||
|
this.numberStyle,
|
||||||
|
this.commentStyle,
|
||||||
|
this.keywordStyle,
|
||||||
|
this.stringStyle,
|
||||||
|
this.punctuationStyle,
|
||||||
|
this.classStyle,
|
||||||
|
this.constantStyle
|
||||||
|
});
|
||||||
|
|
||||||
|
static SyntaxHighlighterStyle lightThemeStyle() {
|
||||||
|
return SyntaxHighlighterStyle(
|
||||||
|
baseStyle: const TextStyle(color: Color(0xFF000000)),
|
||||||
|
numberStyle: const TextStyle(color: Color(0xFF1565C0)),
|
||||||
|
commentStyle: const TextStyle(color: Color(0xFF9E9E9E)),
|
||||||
|
keywordStyle: const TextStyle(color: Color(0xFF9C27B0)),
|
||||||
|
stringStyle: const TextStyle(color: Color(0xFF43A047)),
|
||||||
|
punctuationStyle: const TextStyle(color: Color(0xFF000000)),
|
||||||
|
classStyle: const TextStyle(color: Color(0xFF512DA8)),
|
||||||
|
constantStyle: const TextStyle(color: Color(0xFF795548))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static SyntaxHighlighterStyle darkThemeStyle() {
|
||||||
|
return SyntaxHighlighterStyle(
|
||||||
|
baseStyle: const TextStyle(color: Color(0xFFFFFFFF)),
|
||||||
|
numberStyle: const TextStyle(color: Color(0xFF1565C0)),
|
||||||
|
commentStyle: const TextStyle(color: Color(0xFF9E9E9E)),
|
||||||
|
keywordStyle: const TextStyle(color: Color(0xFF80CBC4)),
|
||||||
|
stringStyle: const TextStyle(color: Color(0xFF009688)),
|
||||||
|
punctuationStyle: const TextStyle(color: Color(0xFFFFFFFF)),
|
||||||
|
classStyle: const TextStyle(color: Color(0xFF009688)),
|
||||||
|
constantStyle: const TextStyle(color: Color(0xFF795548))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final TextStyle baseStyle;
|
||||||
|
final TextStyle numberStyle;
|
||||||
|
final TextStyle commentStyle;
|
||||||
|
final TextStyle keywordStyle;
|
||||||
|
final TextStyle stringStyle;
|
||||||
|
final TextStyle punctuationStyle;
|
||||||
|
final TextStyle classStyle;
|
||||||
|
final TextStyle constantStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class SyntaxHighlighter { // ignore: one_member_abstracts
|
||||||
|
TextSpan format(String src);
|
||||||
|
}
|
||||||
|
|
||||||
|
class DartSyntaxHighlighter extends SyntaxHighlighter {
|
||||||
|
DartSyntaxHighlighter([this._style]) {
|
||||||
|
_spans = <_HighlightSpan>[];
|
||||||
|
_style ??= SyntaxHighlighterStyle.darkThemeStyle();
|
||||||
|
}
|
||||||
|
|
||||||
|
SyntaxHighlighterStyle _style;
|
||||||
|
|
||||||
|
static const List<String> _keywords = <String>[
|
||||||
|
'abstract', 'as', 'assert', 'async', 'await', 'break', 'case', 'catch',
|
||||||
|
'class', 'const', 'continue', 'default', 'deferred', 'do', 'dynamic', 'else',
|
||||||
|
'enum', 'export', 'external', 'extends', 'factory', 'false', 'final',
|
||||||
|
'finally', 'for', 'get', 'if', 'implements', 'import', 'in', 'is', 'library',
|
||||||
|
'new', 'null', 'operator', 'part', 'rethrow', 'return', 'set', 'static',
|
||||||
|
'super', 'switch', 'sync', 'this', 'throw', 'true', 'try', 'typedef', 'var',
|
||||||
|
'void', 'while', 'with', 'yield'
|
||||||
|
];
|
||||||
|
|
||||||
|
static const List<String> _builtInTypes = <String>[
|
||||||
|
'int', 'double', 'num', 'bool'
|
||||||
|
];
|
||||||
|
|
||||||
|
String _src;
|
||||||
|
StringScanner _scanner;
|
||||||
|
|
||||||
|
List<_HighlightSpan> _spans;
|
||||||
|
|
||||||
|
@override
|
||||||
|
TextSpan format(String src) {
|
||||||
|
_src = src;
|
||||||
|
_scanner = StringScanner(_src);
|
||||||
|
|
||||||
|
if (_generateSpans()) {
|
||||||
|
// Successfully parsed the code
|
||||||
|
final List<TextSpan> formattedText = <TextSpan>[];
|
||||||
|
int currentPosition = 0;
|
||||||
|
|
||||||
|
for (_HighlightSpan span in _spans) {
|
||||||
|
if (currentPosition != span.start)
|
||||||
|
formattedText.add(TextSpan(text: _src.substring(currentPosition, span.start)));
|
||||||
|
|
||||||
|
formattedText.add(TextSpan(style: span.textStyle(_style), text: span.textForSpan(_src)));
|
||||||
|
|
||||||
|
currentPosition = span.end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentPosition != _src.length)
|
||||||
|
formattedText.add(TextSpan(text: _src.substring(currentPosition, _src.length)));
|
||||||
|
|
||||||
|
return TextSpan(style: _style.baseStyle, children: formattedText);
|
||||||
|
} else {
|
||||||
|
// Parsing failed, return with only basic formatting
|
||||||
|
return TextSpan(style: _style.baseStyle, text: src);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _generateSpans() {
|
||||||
|
int lastLoopPosition = _scanner.position;
|
||||||
|
|
||||||
|
while (!_scanner.isDone) {
|
||||||
|
// Skip White space
|
||||||
|
_scanner.scan(RegExp(r'\s+'));
|
||||||
|
|
||||||
|
// Block comments
|
||||||
|
if (_scanner.scan(RegExp(r'/\*(.|\n)*\*/'))) {
|
||||||
|
_spans.add(_HighlightSpan(
|
||||||
|
_HighlightType.comment,
|
||||||
|
_scanner.lastMatch.start,
|
||||||
|
_scanner.lastMatch.end
|
||||||
|
));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Line comments
|
||||||
|
if (_scanner.scan('//')) {
|
||||||
|
final int startComment = _scanner.lastMatch.start;
|
||||||
|
|
||||||
|
bool eof = false;
|
||||||
|
int endComment;
|
||||||
|
if (_scanner.scan(RegExp(r'.*\n'))) {
|
||||||
|
endComment = _scanner.lastMatch.end - 1;
|
||||||
|
} else {
|
||||||
|
eof = true;
|
||||||
|
endComment = _src.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
_spans.add(_HighlightSpan(
|
||||||
|
_HighlightType.comment,
|
||||||
|
startComment,
|
||||||
|
endComment
|
||||||
|
));
|
||||||
|
|
||||||
|
if (eof)
|
||||||
|
break;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Raw r"String"
|
||||||
|
if (_scanner.scan(RegExp(r'r".*"'))) {
|
||||||
|
_spans.add(_HighlightSpan(
|
||||||
|
_HighlightType.string,
|
||||||
|
_scanner.lastMatch.start,
|
||||||
|
_scanner.lastMatch.end
|
||||||
|
));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Raw r'String'
|
||||||
|
if (_scanner.scan(RegExp(r"r'.*'"))) {
|
||||||
|
_spans.add(_HighlightSpan(
|
||||||
|
_HighlightType.string,
|
||||||
|
_scanner.lastMatch.start,
|
||||||
|
_scanner.lastMatch.end
|
||||||
|
));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Multiline """String"""
|
||||||
|
if (_scanner.scan(RegExp(r'"""(?:[^"\\]|\\(.|\n))*"""'))) {
|
||||||
|
_spans.add(_HighlightSpan(
|
||||||
|
_HighlightType.string,
|
||||||
|
_scanner.lastMatch.start,
|
||||||
|
_scanner.lastMatch.end
|
||||||
|
));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Multiline '''String'''
|
||||||
|
if (_scanner.scan(RegExp(r"'''(?:[^'\\]|\\(.|\n))*'''"))) {
|
||||||
|
_spans.add(_HighlightSpan(
|
||||||
|
_HighlightType.string,
|
||||||
|
_scanner.lastMatch.start,
|
||||||
|
_scanner.lastMatch.end
|
||||||
|
));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// "String"
|
||||||
|
if (_scanner.scan(RegExp(r'"(?:[^"\\]|\\.)*"'))) {
|
||||||
|
_spans.add(_HighlightSpan(
|
||||||
|
_HighlightType.string,
|
||||||
|
_scanner.lastMatch.start,
|
||||||
|
_scanner.lastMatch.end
|
||||||
|
));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 'String'
|
||||||
|
if (_scanner.scan(RegExp(r"'(?:[^'\\]|\\.)*'"))) {
|
||||||
|
_spans.add(_HighlightSpan(
|
||||||
|
_HighlightType.string,
|
||||||
|
_scanner.lastMatch.start,
|
||||||
|
_scanner.lastMatch.end
|
||||||
|
));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Double
|
||||||
|
if (_scanner.scan(RegExp(r'\d+\.\d+'))) {
|
||||||
|
_spans.add(_HighlightSpan(
|
||||||
|
_HighlightType.number,
|
||||||
|
_scanner.lastMatch.start,
|
||||||
|
_scanner.lastMatch.end
|
||||||
|
));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Integer
|
||||||
|
if (_scanner.scan(RegExp(r'\d+'))) {
|
||||||
|
_spans.add(_HighlightSpan(
|
||||||
|
_HighlightType.number,
|
||||||
|
_scanner.lastMatch.start,
|
||||||
|
_scanner.lastMatch.end)
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Punctuation
|
||||||
|
if (_scanner.scan(RegExp(r'[\[\]{}().!=<>&\|\?\+\-\*/%\^~;:,]'))) {
|
||||||
|
_spans.add(_HighlightSpan(
|
||||||
|
_HighlightType.punctuation,
|
||||||
|
_scanner.lastMatch.start,
|
||||||
|
_scanner.lastMatch.end
|
||||||
|
));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Meta data
|
||||||
|
if (_scanner.scan(RegExp(r'@\w+'))) {
|
||||||
|
_spans.add(_HighlightSpan(
|
||||||
|
_HighlightType.keyword,
|
||||||
|
_scanner.lastMatch.start,
|
||||||
|
_scanner.lastMatch.end
|
||||||
|
));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Words
|
||||||
|
if (_scanner.scan(RegExp(r'\w+'))) {
|
||||||
|
_HighlightType type;
|
||||||
|
|
||||||
|
String word = _scanner.lastMatch[0];
|
||||||
|
if (word.startsWith('_'))
|
||||||
|
word = word.substring(1);
|
||||||
|
|
||||||
|
if (_keywords.contains(word))
|
||||||
|
type = _HighlightType.keyword;
|
||||||
|
else if (_builtInTypes.contains(word))
|
||||||
|
type = _HighlightType.keyword;
|
||||||
|
else if (_firstLetterIsUpperCase(word))
|
||||||
|
type = _HighlightType.klass;
|
||||||
|
else if (word.length >= 2 && word.startsWith('k') && _firstLetterIsUpperCase(word.substring(1)))
|
||||||
|
type = _HighlightType.constant;
|
||||||
|
|
||||||
|
if (type != null) {
|
||||||
|
_spans.add(_HighlightSpan(
|
||||||
|
type,
|
||||||
|
_scanner.lastMatch.start,
|
||||||
|
_scanner.lastMatch.end
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if this loop did anything
|
||||||
|
if (lastLoopPosition == _scanner.position) {
|
||||||
|
// Failed to parse this file, abort gracefully
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
lastLoopPosition = _scanner.position;
|
||||||
|
}
|
||||||
|
|
||||||
|
_simplify();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void _simplify() {
|
||||||
|
for (int i = _spans.length - 2; i >= 0; i -= 1) {
|
||||||
|
if (_spans[i].type == _spans[i + 1].type && _spans[i].end == _spans[i + 1].start) {
|
||||||
|
_spans[i] = _HighlightSpan(
|
||||||
|
_spans[i].type,
|
||||||
|
_spans[i].start,
|
||||||
|
_spans[i + 1].end
|
||||||
|
);
|
||||||
|
_spans.removeAt(i + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _firstLetterIsUpperCase(String str) {
|
||||||
|
if (str.isNotEmpty) {
|
||||||
|
final String first = str.substring(0, 1);
|
||||||
|
return first == first.toUpperCase();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum _HighlightType {
|
||||||
|
number,
|
||||||
|
comment,
|
||||||
|
keyword,
|
||||||
|
string,
|
||||||
|
punctuation,
|
||||||
|
klass,
|
||||||
|
constant
|
||||||
|
}
|
||||||
|
|
||||||
|
class _HighlightSpan {
|
||||||
|
_HighlightSpan(this.type, this.start, this.end);
|
||||||
|
final _HighlightType type;
|
||||||
|
final int start;
|
||||||
|
final int end;
|
||||||
|
|
||||||
|
String textForSpan(String src) {
|
||||||
|
return src.substring(start, end);
|
||||||
|
}
|
||||||
|
|
||||||
|
TextStyle textStyle(SyntaxHighlighterStyle style) {
|
||||||
|
if (type == _HighlightType.number)
|
||||||
|
return style.numberStyle;
|
||||||
|
else if (type == _HighlightType.comment)
|
||||||
|
return style.commentStyle;
|
||||||
|
else if (type == _HighlightType.keyword)
|
||||||
|
return style.keywordStyle;
|
||||||
|
else if (type == _HighlightType.string)
|
||||||
|
return style.stringStyle;
|
||||||
|
else if (type == _HighlightType.punctuation)
|
||||||
|
return style.punctuationStyle;
|
||||||
|
else if (type == _HighlightType.klass)
|
||||||
|
return style.classStyle;
|
||||||
|
else if (type == _HighlightType.constant)
|
||||||
|
return style.constantStyle;
|
||||||
|
else
|
||||||
|
return style.baseStyle;
|
||||||
|
}
|
||||||
|
}
|
@ -12,6 +12,10 @@ import '../widgets/index.dart';
|
|||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
import '../event/event-bus.dart';
|
import '../event/event-bus.dart';
|
||||||
import '../event/event-model.dart';
|
import '../event/event-model.dart';
|
||||||
|
import './full_screen_code_dialog.dart';
|
||||||
|
import '../routers/application.dart';
|
||||||
|
import '../routers/routers.dart';
|
||||||
|
import 'dart:core';
|
||||||
|
|
||||||
class WidgetDemo extends StatefulWidget {
|
class WidgetDemo extends StatefulWidget {
|
||||||
final List<dynamic> contentList;
|
final List<dynamic> contentList;
|
||||||
@ -141,7 +145,9 @@ class _WidgetDemoState extends State<WidgetDemo> {
|
|||||||
if(value == 'doc'){
|
if(value == 'doc'){
|
||||||
_launchURL(widget.docUrl);
|
_launchURL(widget.docUrl);
|
||||||
}else if(value =='code'){
|
}else if(value =='code'){
|
||||||
_launchURL(Application.github['widgetsURL'] + widget.codeUrl);
|
// _launchURL(Application.github['widgetsURL'] + widget.codeUrl);
|
||||||
|
Application.router.navigateTo(context, '${Routes.codeView}?filePath=${Uri.encodeComponent(widget.codeUrl)}');
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
_getCollection();
|
_getCollection();
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:fluro/fluro.dart';
|
import 'package:fluro/fluro.dart';
|
||||||
import '../views/category.dart';
|
import '../views/category.dart';
|
||||||
import '../widgets/404.dart';
|
import '../widgets/404.dart';
|
||||||
|
import '../common/full_screen_code_dialog.dart';
|
||||||
|
|
||||||
var categoryHandler = new Handler(
|
var categoryHandler = new Handler(
|
||||||
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
|
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
|
||||||
@ -16,3 +17,10 @@ var widgetNotFoundHandler = new Handler(
|
|||||||
return new WidgetNotFound();
|
return new WidgetNotFound();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
var fullScreenCodeDialog = new Handler(
|
||||||
|
handlerFunc: (BuildContext context,Map<String, List<String>> params){
|
||||||
|
String path = params['filePath']?.first;
|
||||||
|
return new FullScreenCodeDialog(filePath: path,);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
@ -7,6 +7,7 @@ import './router_handler.dart';
|
|||||||
class Routes {
|
class Routes {
|
||||||
static String root = "/";
|
static String root = "/";
|
||||||
static String widgetDemo = '/widget-demo';
|
static String widgetDemo = '/widget-demo';
|
||||||
|
static String codeView = '/code-view';
|
||||||
|
|
||||||
static void configureRoutes(Router router) {
|
static void configureRoutes(Router router) {
|
||||||
List widgetDemosList = new WidgetDemoList().getDemos();
|
List widgetDemosList = new WidgetDemoList().getDemos();
|
||||||
@ -17,13 +18,12 @@ class Routes {
|
|||||||
|
|
||||||
router.define('/category/:type', handler: categoryHandler);
|
router.define('/category/:type', handler: categoryHandler);
|
||||||
router.define('/category/error/404', handler: widgetNotFoundHandler);
|
router.define('/category/error/404', handler: widgetNotFoundHandler);
|
||||||
|
router.define(codeView,handler:fullScreenCodeDialog);
|
||||||
widgetDemosList.forEach((demo) {
|
widgetDemosList.forEach((demo) {
|
||||||
Handler handler = new Handler(
|
Handler handler = new Handler(
|
||||||
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
|
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
|
||||||
return demo.buildRouter(context);
|
return demo.buildRouter(context);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
router.define('${demo.routerName}', handler: handler);
|
router.define('${demo.routerName}', handler: handler);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: xiaojia.dxj
|
* @Author: xiaojia.dxj
|
||||||
* @Date: 2018-12-18 11:40:57
|
* @Date: 2018-12-18 11:40:57
|
||||||
* @Last Modified by: xiaojia.dxj
|
* @Last Modified by: 一凨
|
||||||
* @Last Modified time: 2018-12-20 15:03:18
|
* @Last Modified time: 2019-01-14 16:50:43
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class ChipDemo extends StatefulWidget {
|
class ChipDemo extends StatefulWidget {
|
||||||
@ -11,74 +12,81 @@ class ChipDemo extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ChipDemoState extends State<ChipDemo> {
|
class _ChipDemoState extends State<ChipDemo> {
|
||||||
String dec='点击回收';
|
String dec = '点击回收';
|
||||||
int count=0;
|
int count = 0;
|
||||||
_modifty(){
|
_modifty() {
|
||||||
setState(() {
|
setState(() {
|
||||||
dec='delete success: $count';
|
dec = 'delete success: $count';
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
child: Chip(
|
child: Chip(
|
||||||
padding: EdgeInsets.only(right: 100.0,),
|
padding: EdgeInsets.only(
|
||||||
//标签前面的小widget
|
right: 100.0,
|
||||||
avatar: CircleAvatar(
|
),
|
||||||
backgroundColor: Colors.red.shade200,
|
//标签前面的小widget
|
||||||
child: Text('A',style: TextStyle(color: Colors.white),),
|
avatar: CircleAvatar(
|
||||||
|
backgroundColor: Colors.red.shade200,
|
||||||
),
|
child: Text(
|
||||||
label: Text('pai mai ',style: TextStyle(color: Colors.white,fontSize: 18.0),),
|
'A',
|
||||||
backgroundColor: Colors.red.shade100,
|
style: TextStyle(color: Colors.white),
|
||||||
labelPadding: EdgeInsets.all(6.0),
|
),
|
||||||
),
|
),
|
||||||
),
|
label: Text(
|
||||||
Container(
|
'pai mai ',
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 18.0),
|
||||||
height: 100.0,
|
),
|
||||||
child: Chip(
|
backgroundColor: Colors.red.shade100,
|
||||||
//头像
|
labelPadding: EdgeInsets.all(6.0),
|
||||||
avatar: CircleAvatar(
|
|
||||||
child: Icon(Icons.account_circle,color: Colors.red.shade200,),
|
|
||||||
backgroundColor:Colors.white,
|
|
||||||
|
|
||||||
),
|
),
|
||||||
//设置widget背景颜色
|
|
||||||
backgroundColor: Colors.red.shade100,
|
|
||||||
/**剪辑窗口widget内容
|
|
||||||
* antiAlias:剪辑具有抗锯齿功能,它比antiAliasWithSaveLayer快得多,但比hardEdge慢。
|
|
||||||
antiAliasWithSaveLayer:立即剪辑具有抗锯齿,并且可以分配屏幕外缓冲区,后续涂料都在该缓冲区完成,然后再进行修剪和合成
|
|
||||||
*/
|
|
||||||
clipBehavior: Clip.antiAlias,
|
|
||||||
|
|
||||||
//设置padding值
|
|
||||||
labelPadding: EdgeInsets.all(8.0),
|
|
||||||
label: Text(dec),
|
|
||||||
//设置onDeleted时候显示的图标
|
|
||||||
deleteIcon: Icon(Icons.delete,color: Colors.white,size: 20.0,),
|
|
||||||
onDeleted: (){
|
|
||||||
count++;
|
|
||||||
_modifty();
|
|
||||||
},
|
|
||||||
deleteButtonTooltipMessage: '删除',
|
|
||||||
deleteIconColor: Colors.blueGrey.shade100,
|
|
||||||
//将最小点击目标大小扩展到48*48px
|
|
||||||
materialTapTargetSize: MaterialTapTargetSize.padded,
|
|
||||||
padding: EdgeInsets.all(2.0),
|
|
||||||
//修改字体格式
|
|
||||||
labelStyle: TextStyle(fontWeight: FontWeight.bold),
|
|
||||||
// shape: _MyBorder(),
|
|
||||||
),
|
),
|
||||||
)
|
Container(
|
||||||
],
|
height: 100.0,
|
||||||
|
child: Chip(
|
||||||
|
//头像
|
||||||
|
avatar: CircleAvatar(
|
||||||
|
child: Icon(
|
||||||
|
Icons.account_circle,
|
||||||
|
color: Colors.red.shade200,
|
||||||
|
),
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
),
|
||||||
|
//设置widget背景颜色
|
||||||
|
backgroundColor: Colors.red.shade100,
|
||||||
|
//剪辑窗口widget内容
|
||||||
|
// antiAlias:剪辑具有抗锯齿功能,它比antiAliasWithSaveLayer快得多,但比hardEdge慢。
|
||||||
|
//antiAliasWithSaveLayer:立即剪辑具有抗锯齿,并且可以分配屏幕外缓冲区,后续涂料都在该缓冲区完成,然后再进行修剪和合成
|
||||||
|
clipBehavior: Clip.antiAlias,
|
||||||
|
|
||||||
|
//设置padding值
|
||||||
|
labelPadding: EdgeInsets.all(8.0),
|
||||||
|
label: Text(dec),
|
||||||
|
//设置onDeleted时候显示的图标
|
||||||
|
deleteIcon: Icon(
|
||||||
|
Icons.delete,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 20.0,
|
||||||
|
),
|
||||||
|
onDeleted: () {
|
||||||
|
count++;
|
||||||
|
_modifty();
|
||||||
|
},
|
||||||
|
deleteButtonTooltipMessage: '删除',
|
||||||
|
deleteIconColor: Colors.blueGrey.shade100,
|
||||||
|
//将最小点击目标大小扩展到48*48px
|
||||||
|
materialTapTargetSize: MaterialTapTargetSize.padded,
|
||||||
|
padding: EdgeInsets.all(2.0),
|
||||||
|
//修改字体格式
|
||||||
|
labelStyle: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
// shape: _MyBorder(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,10 +9,8 @@
|
|||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
// FlatButton 默认按钮的实例
|
||||||
* FlatButton 默认按钮的实例
|
// isDisabled:是否是禁用,isDisabled 默认为true
|
||||||
* isDisabled:是否是禁用,isDisabled 默认为true
|
|
||||||
* */
|
|
||||||
class FlatButtonDefault extends StatelessWidget {
|
class FlatButtonDefault extends StatelessWidget {
|
||||||
final bool isDisabled;
|
final bool isDisabled;
|
||||||
|
|
||||||
@ -29,11 +27,10 @@ class FlatButtonDefault extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* FlatButton.icon 默认按钮的实例
|
// FlatButton.icon 默认按钮的实例
|
||||||
* Create a text button from a pair of widgets that serve as the button's icon and label
|
// * Create a text button from a pair of widgets that serve as the button's icon and label
|
||||||
* isDisabled:是否是禁用
|
// * isDisabled:是否是禁用
|
||||||
* */
|
|
||||||
class FlatButtonIconDefault extends StatelessWidget {
|
class FlatButtonIconDefault extends StatelessWidget {
|
||||||
final bool isDisabled;
|
final bool isDisabled;
|
||||||
final IconData icon;
|
final IconData icon;
|
||||||
@ -63,9 +60,9 @@ class FlatButtonIconDefault extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* FlatButton 自定义的实例
|
// FlatButton 自定义的实例
|
||||||
* */
|
|
||||||
class FlatButtonCustom extends StatelessWidget {
|
class FlatButtonCustom extends StatelessWidget {
|
||||||
final String txt;
|
final String txt;
|
||||||
final Color color;
|
final Color color;
|
||||||
|
@ -47,7 +47,7 @@ class _DemoState extends State<Demo> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return WidgetDemo(
|
return WidgetDemo(
|
||||||
title: 'Checkbox',
|
title: 'Checkbox',
|
||||||
codeUrl: 'elements/Form/Checkbox/Checkbox/demo.dart',
|
codeUrl: 'elements/Form/CheckBox/Checkbox/demo.dart',
|
||||||
contentList: [allCheckboxs(context,this)],
|
contentList: [allCheckboxs(context,this)],
|
||||||
docUrl: 'https://docs.flutter.io/flutter/material/Checkbox-class.html',
|
docUrl: 'https://docs.flutter.io/flutter/material/Checkbox-class.html',
|
||||||
);
|
);
|
||||||
|
@ -9,10 +9,8 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/*
|
// Checkbox 默认的实例
|
||||||
* Checkbox 默认的实例
|
// index 当前checkbox 的索引值
|
||||||
* index 当前checkbox 的索引值
|
|
||||||
* */
|
|
||||||
class CheckboxListTileStateDefault extends StatefulWidget {
|
class CheckboxListTileStateDefault extends StatefulWidget {
|
||||||
const CheckboxListTileStateDefault() : super();
|
const CheckboxListTileStateDefault() : super();
|
||||||
|
|
||||||
@ -20,9 +18,7 @@ class CheckboxListTileStateDefault extends StatefulWidget {
|
|||||||
State<StatefulWidget> createState() => _CheckboxListTileStateDefault();
|
State<StatefulWidget> createState() => _CheckboxListTileStateDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// CheckboxListTile 默认的实例,有状态
|
||||||
* CheckboxListTile 默认的实例,有状态
|
|
||||||
* */
|
|
||||||
class _CheckboxListTileStateDefault extends State {
|
class _CheckboxListTileStateDefault extends State {
|
||||||
bool _value = false;
|
bool _value = false;
|
||||||
void _valueChanged(bool value) {
|
void _valueChanged(bool value) {
|
||||||
@ -105,9 +101,7 @@ class _CheckboxListTileStateDefault extends State {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// CheckboxListTile 默认的实例,无状态
|
||||||
* CheckboxListTile 默认的实例,无状态
|
|
||||||
* */
|
|
||||||
class CheckboxListTileDefault extends StatelessWidget {
|
class CheckboxListTileDefault extends StatelessWidget {
|
||||||
final widget;
|
final widget;
|
||||||
final parant;
|
final parant;
|
||||||
|
@ -47,7 +47,7 @@ class _DemoState extends State<Demo> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return WidgetDemo(
|
return WidgetDemo(
|
||||||
title: 'CheckboxListTile',
|
title: 'CheckboxListTile',
|
||||||
codeUrl: 'elements/Form/Checkbox/CheckboxListTile/demo.dart',
|
codeUrl: 'elements/Form/CheckBox/CheckboxListTile/demo.dart',
|
||||||
contentList: [allCheckboxs(context, this)],
|
contentList: [allCheckboxs(context, this)],
|
||||||
docUrl: 'https://docs.flutter.io/flutter/material/CheckboxListTile-class.html',
|
docUrl: 'https://docs.flutter.io/flutter/material/CheckboxListTile-class.html',
|
||||||
);
|
);
|
||||||
|
@ -2,7 +2,8 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* 基本示例
|
* 基本示例
|
||||||
* */
|
*
|
||||||
|
*/
|
||||||
class DefaultTextField extends StatelessWidget {
|
class DefaultTextField extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* @Author: 一凨
|
* @Author: 一凨
|
||||||
* @Date: 2018-11-28 20:44:13
|
* @Date: 2018-11-28 20:44:13
|
||||||
* @Last Modified by: 一凨
|
* @Last Modified by: 一凨
|
||||||
* @Last Modified time: 2018-11-28 20:51:20
|
* @Last Modified time: 2019-01-14 17:02:20
|
||||||
*/
|
*/
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../../../../common/widget_demo.dart';
|
import '../../../../../common/widget_demo.dart';
|
||||||
@ -37,7 +37,7 @@ class _DemoState extends State<Demo> {
|
|||||||
],
|
],
|
||||||
docUrl:
|
docUrl:
|
||||||
'https://docs.flutter.io/flutter/widgets/AnimatedPadding-class.html',
|
'https://docs.flutter.io/flutter/widgets/AnimatedPadding-class.html',
|
||||||
codeUrl: 'elements/Frame/spacing/AnimatedPadding/animatedPadding_demo.dart',
|
codeUrl: 'elements/Frame/Spacing/AnimatedPadding/animatedPadding_demo.dart',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: 一凨
|
* @Author: 一凨
|
||||||
* @Date: 2018-11-28 20:25:24
|
* @Date: 2018-11-28 20:25:24
|
||||||
* @Last Modified by: 一凨
|
* @Last Modified by: 一凨
|
||||||
* @Last Modified time: 2018-11-28 20:25:24
|
* @Last Modified time: 2019-01-14 17:01:55
|
||||||
*/
|
*/
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../../../../common/widget_demo.dart';
|
import '../../../../../common/widget_demo.dart';
|
||||||
@ -38,7 +38,7 @@ class _DemoState extends State<Demo> {
|
|||||||
],
|
],
|
||||||
docUrl: 'https://docs.flutter.io/flutter/widgets/Padding-class.html',
|
docUrl: 'https://docs.flutter.io/flutter/widgets/Padding-class.html',
|
||||||
codeUrl:
|
codeUrl:
|
||||||
'elements/Frame/spacing/Padding/padding_demo.dart',
|
'elements/Frame/Spacing/Padding/padding_demo.dart',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
/*
|
/*
|
||||||
* @Author: 一凨
|
* @Author: 一凨
|
||||||
* @Date: 2018-11-28 20:20:04
|
* @Date: 2018-11-28 20:20:04
|
||||||
* @Last Modified by: 一凨
|
* @Last Modified by: 一凨
|
||||||
* @Last Modified time: 2018-11-28 20:20:49
|
* @Last Modified time: 2019-01-14 16:30:16
|
||||||
*/
|
*/
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class PaddingDemo extends StatelessWidget {
|
class PaddingDemo extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* @Author: 一凨
|
* @Author: 一凨
|
||||||
* @Date: 2018-11-28 20:26:16
|
* @Date: 2018-11-28 20:26:16
|
||||||
* @Last Modified by: 一凨
|
* @Last Modified by: 一凨
|
||||||
* @Last Modified time: 2018-11-28 20:39:28
|
* @Last Modified time: 2019-01-14 17:06:36
|
||||||
*/
|
*/
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_go/common/widget_demo.dart';
|
import 'package:flutter_go/common/widget_demo.dart';
|
||||||
@ -33,7 +33,7 @@ class _DemoState extends State<Demo> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return WidgetDemo(
|
return WidgetDemo(
|
||||||
title: 'SliverPadding',
|
title: 'SliverPadding',
|
||||||
codeUrl: 'elements/Frame/spacing/SliverPadding/sliverpadding_demo.dart',
|
codeUrl: 'elements/Frame/Spacing/SliverPadding/sliverpadding_demo.dart',
|
||||||
contentList: [
|
contentList: [
|
||||||
contentDesc0,
|
contentDesc0,
|
||||||
contentDesc1,
|
contentDesc1,
|
||||||
|
@ -39,7 +39,7 @@ class _DemoState extends State<Demo> {
|
|||||||
title: 'IndexedStack',
|
title: 'IndexedStack',
|
||||||
// desc: _desc,
|
// desc: _desc,
|
||||||
codeUrl:
|
codeUrl:
|
||||||
'https://github.com/alibaba-paimai-frontend/flutter-common-widgets-app/blob/dev/sanlu-0.0.4/lib/widgets/elements/Frame/Stack/IndexedStack/demo.dart',
|
'elements/Frame/Stack/IndexedStack/demo.dart',
|
||||||
docUrl: 'https://docs.flutter.io/flutter/widgets/IndexedStack-class.html',
|
docUrl: 'https://docs.flutter.io/flutter/widgets/IndexedStack-class.html',
|
||||||
contentList: [
|
contentList: [
|
||||||
_stackText0,
|
_stackText0,
|
||||||
|
@ -41,7 +41,7 @@ class _DemoState extends State<Demo> {
|
|||||||
return WidgetDemo(
|
return WidgetDemo(
|
||||||
title: 'Stack',
|
title: 'Stack',
|
||||||
codeUrl:
|
codeUrl:
|
||||||
'https://github.com/alibaba-paimai-frontend/flutter-common-widgets-app/blob/dev/sanlu-0.0.4/lib/widgets/elements/Frame/Stack/Stack/demo.dart',
|
'elements/Frame/Stack/Stack/demo.dart',
|
||||||
docUrl: 'https://docs.flutter.io/flutter/widgets/Stack-class.html',
|
docUrl: 'https://docs.flutter.io/flutter/widgets/Stack-class.html',
|
||||||
contentList: [
|
contentList: [
|
||||||
_stackText0,
|
_stackText0,
|
||||||
|
121
pubspec.yaml
121
pubspec.yaml
@ -45,8 +45,129 @@ flutter:
|
|||||||
# the material Icons class.
|
# the material Icons class.
|
||||||
uses-material-design: true
|
uses-material-design: true
|
||||||
assets:
|
assets:
|
||||||
|
- lib/widgets/elements/Form/Input/TextField/text_field_demo.dart
|
||||||
|
- lib/widgets/elements/Form/CheckBox/Checkbox/demo.dart
|
||||||
|
- lib/widgets/components/Bar/AppBar/demo.dart
|
||||||
|
- lib/widgets/components/Bar/BottomAppBar/demo.dart
|
||||||
|
- lib/widgets/components/Bar/ButtonBar/demo.dart
|
||||||
|
- lib/widgets/components/Bar/FlexibleSpaceBar/demo.dart
|
||||||
|
- lib/widgets/components/Bar/SliverAppBar/demo.dart
|
||||||
|
- lib/widgets/components/Bar/SnackBar/demo.dart
|
||||||
|
- lib/widgets/components/Bar/SnackBarAction/demo.dart
|
||||||
|
- lib/widgets/components/Bar/TabBar/demo.dart
|
||||||
|
- lib/widgets/components/Card/Card/demo.dart
|
||||||
|
- lib/widgets/components/Chip/Chip/demo.dart
|
||||||
|
- lib/widgets/components/Chip/ChipTheme/demo.dart
|
||||||
|
- lib/widgets/components/Chip/ChipThemeData/demo.dart
|
||||||
|
- lib/widgets/components/Chip/ChoiceChip/demo.dart
|
||||||
|
- lib/widgets/components/Chip/FilterChip/demo.dart
|
||||||
|
- lib/widgets/components/Chip/inputChip/demo.dart
|
||||||
|
- lib/widgets/components/Chip/RawChip/demo.dart
|
||||||
|
- lib/widgets/components/Dialog/AboutDialog/demo.dart
|
||||||
|
- lib/widgets/components/Dialog/AlertDialog/demo.dart
|
||||||
|
- lib/widgets/components/Dialog/Dialog/demo.dart
|
||||||
|
- lib/widgets/components/Dialog/SimpleDialog/demo.dart
|
||||||
|
- lib/widgets/components/Grid/GridTile/demo.dart
|
||||||
|
- lib/widgets/components/Grid/GridTileBar/demo.dart
|
||||||
|
- lib/widgets/components/Grid/GridView/demo.dart
|
||||||
|
- lib/widgets/components/LIst/AnimatedList/demo.dart
|
||||||
|
- lib/widgets/components/LIst/ListBody/demo.dart
|
||||||
|
- lib/widgets/components/LIst/ListView/demo.dart
|
||||||
|
- lib/widgets/components/Menu/CheckedPopupMenuItem/demo.dart
|
||||||
|
- lib/widgets/components/Menu/DropdownMenuItem/demo.dart
|
||||||
|
- lib/widgets/components/Menu/PopupMenuButton/demo.dart
|
||||||
|
- lib/widgets/components/Menu/PopupMenuDivider/demo.dart
|
||||||
|
- lib/widgets/components/Navigation/BottomNavigationBar/demo.dart
|
||||||
|
- lib/widgets/components/Navigation/BottomNavigationBarItem/demo.dart
|
||||||
|
- lib/widgets/components/Panel/ExpansionPanel/demo.dart
|
||||||
|
- lib/widgets/components/Panel/ExpansionPanelList/demo.dart
|
||||||
|
- lib/widgets/components/Pick/DayPicker/demo.dart
|
||||||
|
- lib/widgets/components/Pick/MonthPicker/demo.dart
|
||||||
|
- lib/widgets/components/Pick/ShowdatePicker/demo.dart
|
||||||
|
- lib/widgets/components/Pick/YearPicker/demo.dart
|
||||||
|
- lib/widgets/components/Progress/CircularProgressIndicator/demo.dart
|
||||||
|
- lib/widgets/components/Progress/LinearProgressIndicator/demo.dart
|
||||||
|
- lib/widgets/components/Progress/RefreshProgressIndicator/demo.dart
|
||||||
|
- lib/widgets/components/Scaffold/Scaffold/demo.dart
|
||||||
|
- lib/widgets/components/Scaffold/ScaffoldState/demo.dart
|
||||||
|
- lib/widgets/components/Scroll/BoxScrollView/demo.dart
|
||||||
|
- lib/widgets/components/Scroll/CustomScrollView/demo.dart
|
||||||
|
- lib/widgets/components/Scroll/NestedScrollView/demo.dart
|
||||||
|
- lib/widgets/components/Scroll/Scrollable/demo.dart
|
||||||
|
- lib/widgets/components/Scroll/ScrollbarPainter/demo.dart
|
||||||
|
- lib/widgets/components/Scroll/ScrollMetrics/demo.dart
|
||||||
|
- lib/widgets/components/Scroll/ScrollPhysics/demo.dart
|
||||||
|
- lib/widgets/components/Scroll/ScrollView/demo.dart
|
||||||
|
- lib/widgets/components/Tab/Tab/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Button/DropdownButton/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Button/FlatButton/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Button/FloatingActionButton/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Button/IconButton/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Button/OutlineButton/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Button/PopupMenuButton/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Button/RaisedButton/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Button/RawMaterialButton/demo.dart
|
||||||
|
- lib/widgets/elements/Form/CheckBox/Checkbox/demo.dart
|
||||||
|
- lib/widgets/elements/Form/CheckBox/CheckboxListTile/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Radio/Radio/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Radio/RadioListTile/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Slider/Slider/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Slider/SliderTheme/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Slider/SliderThemeData/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Switch/AnimatedSwitcher/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Switch/Switch/demo.dart
|
||||||
|
- lib/widgets/elements/Form/Switch/SwitchListTile/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Align/Align/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Box/ConstrainedBox/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Box/DecoratedBox/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Box/Fittedbox/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Box/LimitedBox/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Box/OverflowBox/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Box/RenderBox/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Box/RotatedBox/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Box/SizeBox/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Box/SizedOverflowBox/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Box/TextBox/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Box/UnconstrainedBox/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Expanded/Expanded/expanded_demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Layout/Center/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Layout/Column/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Layout/Container/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Layout/Row/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Spacing/AnimatedPadding/animatedPadding_demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Spacing/Padding/padding_demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Spacing/SliverPadding/sliverpadding_demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Stack/IndexedStack/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Stack/Stack/demo.dart
|
||||||
|
- lib/widgets/elements/Frame/Table/Table/table_demo.dart
|
||||||
|
- lib/widgets/elements/Media/Icon/Icon/demo.dart
|
||||||
|
- lib/widgets/elements/Media/Icon/IconData/demo.dart
|
||||||
|
- lib/widgets/elements/Media/Icon/IconTheme/demo.dart
|
||||||
|
- lib/widgets/elements/Media/Icon/IconThemeData/demo.dart
|
||||||
|
- lib/widgets/elements/Media/Icon/ImageIcon/demo.dart
|
||||||
|
- lib/widgets/elements/Media/Image/AssetImage/assetImage_demo.dart
|
||||||
|
- lib/widgets/elements/Media/Image/DecorationImage/decorationImage_demo.dart
|
||||||
|
- lib/widgets/elements/Media/Image/DecorationImagePainter/decoration_image_painter_demo.dart
|
||||||
|
- lib/widgets/elements/Media/Image/ExactAssetImage/exact_asset_image_demo.dart
|
||||||
|
- lib/widgets/elements/Media/Image/FadeInImage/fade_in_image_demo.dart
|
||||||
|
- lib/widgets/elements/Media/Image/FileImage/file_image_demo.dart
|
||||||
|
- lib/widgets/elements/Media/Image/Image/demo.dart
|
||||||
|
- lib/widgets/elements/Media/Image/MemoryImage/memory_image_demo.dart
|
||||||
|
- lib/widgets/elements/Media/Image/NetworkImage/network_image_demo.dart
|
||||||
|
- lib/widgets/elements/Media/Image/paintImage/paint_image_demo.dart
|
||||||
|
- lib/widgets/elements/Media/Image/precacheImage/precache_image_demo.dart
|
||||||
|
- lib/widgets/elements/Media/Image/RawImage/raw_image_demo.dart
|
||||||
|
- lib/widgets/themes/Material/MaterialApp/demo.dart
|
||||||
|
- lib/widgets/themes/Material/MaterialButton/demo.dart
|
||||||
|
- lib/widgets/themes/Material/MaterialColor/demo.dart
|
||||||
|
- lib/widgets/themes/Material/MaterialPageRoute/demo.dart
|
||||||
|
- lib/widgets/themes/Material/MergeableMaterialItem/demo.dart
|
||||||
- assets/app.db
|
- assets/app.db
|
||||||
- assets/images/
|
- assets/images/
|
||||||
|
- lib/common/example_code_parser.dart
|
||||||
|
- lib/common/syntax_highlighter.dart
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# To add assets to your application, add an assets section, like this:
|
# To add assets to your application, add an assets section, like this:
|
||||||
# assets:
|
# assets:
|
||||||
|
Reference in New Issue
Block a user