张萌 4 years ago
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,
),
);
}
}

@ -10,6 +10,7 @@ import 'example_scaffold.dart';
import 'example_button.dart';
import 'example_tab_bar.dart';
import 'example_picker.dart';
import 'example_style_color.dart';
void main() {
runApp(MyApp());
@ -59,6 +60,9 @@ class _MyHomePageState extends State<MyHomePage> {
children: [
Image.asset('assets/logo.webp', height: 50),
SizedBox(height: 16.w),
ASButton.info(
title: '颜色 Style Color',
onPressed: () => Get.to(ExampleStyleColor())),
ASButton.info(
title: '按钮 Button', onPressed: () => Get.to(ExampleButton())),
ASButton.info(

@ -7,7 +7,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.1"
version: "0.0.2"
async:
dependency: transitive
description:

@ -8,7 +8,10 @@ import 'package:flutter/material.dart';
///
/// [controller] see more TabController
class ASTabBar extends StatefulWidget implements PreferredSizeWidget {
///items
final List<String> items;
/// TabController
final TabController controller;
///
@ -30,7 +33,9 @@ class ASTabBar extends StatefulWidget implements PreferredSizeWidget {
class _ASTabBarState extends State<ASTabBar> {
@override
Widget build(BuildContext context) {
return TabBar(
return Align(
alignment: Alignment.center,
child: TabBar(
isScrollable: widget.isScrollable,
controller: widget.controller,
tabs: widget.items.map((e) => Tab(text: e)).toList(),
@ -46,6 +51,7 @@ class _ASTabBarState extends State<ASTabBar> {
indicatorSize: TabBarIndicatorSize.label,
indicatorPadding: EdgeInsets.zero,
indicator: ASTabIndicator(),
),
);
}
}

@ -6,6 +6,7 @@ const Color kDarkColor = Color(0xFF333333);
///
const Color kTextColor = kDarkColor;
///
const Color kTextSubColor = Color.fromRGBO(0, 0, 0, 0.65);
///

@ -1,6 +1,6 @@
name: ansu_ui
description: A new Flutter package.
version: 0.0.1
version: 0.0.2
author:
environment:

@ -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…
Cancel
Save