Merge branch 'master' of http://192.168.2.201:8099/laiiihz/ansu_ui
commit
aa57f57d2f
@ -1,3 +1,5 @@
|
||||
## [0.0.1] - TODO: Add release date.
|
||||
# CHANGELOGS
|
||||
|
||||
* TODO: Describe initial release.
|
||||
## [0.0.2] - first release
|
||||
|
||||
## [0.0.1] - init Repo
|
||||
|
@ -0,0 +1,46 @@
|
||||
import 'package:ansu_ui/ansu_ui.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ColorObject {
|
||||
Color color;
|
||||
String name;
|
||||
String codeName;
|
||||
ColorObject({
|
||||
this.color,
|
||||
this.name,
|
||||
this.codeName,
|
||||
});
|
||||
}
|
||||
|
||||
List<ColorObject> colorObjects = [
|
||||
ColorObject(
|
||||
color: Color(0xFF333333),
|
||||
name: '主要暗色',
|
||||
codeName: 'kDarkColor',
|
||||
),
|
||||
ColorObject(
|
||||
color: kDarkColor,
|
||||
name: '文本默认颜色',
|
||||
codeName: 'kTextColor',
|
||||
),
|
||||
ColorObject(
|
||||
color: Color.fromRGBO(0, 0, 0, 0.65),
|
||||
name: '次文本颜色',
|
||||
codeName: 'kTextSubColor',
|
||||
),
|
||||
ColorObject(
|
||||
color: Color(0xFFF6B72D),
|
||||
name: '主题色',
|
||||
codeName: 'kPrimaryColor',
|
||||
),
|
||||
ColorObject(
|
||||
color: Color(0xFFFFFFFF),
|
||||
name: '前景色',
|
||||
codeName: 'kForegroundColor',
|
||||
),
|
||||
ColorObject(
|
||||
color: Color(0xFFF6F6F6),
|
||||
name: '背景色',
|
||||
codeName: 'kBackgroundColor',
|
||||
),
|
||||
];
|
@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:example/data/color_object.dart';
|
||||
import 'package:ansu_ui/ansu_ui.dart';
|
||||
|
||||
class ExampleStyleColor extends StatefulWidget {
|
||||
ExampleStyleColor({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ExampleStyleColorState createState() => _ExampleStyleColorState();
|
||||
}
|
||||
|
||||
class _ExampleStyleColorState extends State<ExampleStyleColor> {
|
||||
_buildCard(ColorObject object) {
|
||||
return Column(
|
||||
children: [
|
||||
Text(object.name),
|
||||
Text(object.codeName),
|
||||
Card(
|
||||
color: object.color,
|
||||
child: SizedBox(height: 50.w, width: double.infinity),
|
||||
),
|
||||
SizedBox(height: 16.w),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ASScaffold(
|
||||
title: 'Color',
|
||||
body: ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
return _buildCard(colorObjects[index]);
|
||||
},
|
||||
itemCount: colorObjects.length,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:ansu_ui/ansu_ui.dart';
|
||||
|
||||
void main() {
|
||||
test('adds one to input values', () {
|
||||
final calculator = Calculator();
|
||||
expect(calculator.addOne(2), 3);
|
||||
expect(calculator.addOne(-7), -6);
|
||||
expect(calculator.addOne(0), 1);
|
||||
expect(() => calculator.addOne(null), throwsNoSuchMethodError);
|
||||
});
|
||||
}
|
Loading…
Reference in new issue