parent
a6688ca4f9
commit
296726de4a
@ -1,2 +1 @@
|
|||||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
|
||||||
#include "Generated.xcconfig"
|
#include "Generated.xcconfig"
|
||||||
|
@ -1,2 +1 @@
|
|||||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
|
||||||
#include "Generated.xcconfig"
|
#include "Generated.xcconfig"
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
# Uncomment this line to define a global platform for your project
|
|
||||||
# platform :ios, '9.0'
|
|
||||||
|
|
||||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
|
||||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
|
||||||
|
|
||||||
project 'Runner', {
|
|
||||||
'Debug' => :debug,
|
|
||||||
'Profile' => :release,
|
|
||||||
'Release' => :release,
|
|
||||||
}
|
|
||||||
|
|
||||||
def flutter_root
|
|
||||||
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
|
|
||||||
unless File.exist?(generated_xcode_build_settings_path)
|
|
||||||
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
|
|
||||||
end
|
|
||||||
|
|
||||||
File.foreach(generated_xcode_build_settings_path) do |line|
|
|
||||||
matches = line.match(/FLUTTER_ROOT\=(.*)/)
|
|
||||||
return matches[1].strip if matches
|
|
||||||
end
|
|
||||||
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
|
|
||||||
end
|
|
||||||
|
|
||||||
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
|
|
||||||
|
|
||||||
flutter_ios_podfile_setup
|
|
||||||
|
|
||||||
target 'Runner' do
|
|
||||||
use_frameworks!
|
|
||||||
use_modular_headers!
|
|
||||||
|
|
||||||
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
|
|
||||||
end
|
|
||||||
|
|
||||||
post_install do |installer|
|
|
||||||
installer.pods_project.targets.each do |target|
|
|
||||||
flutter_additional_ios_build_settings(target)
|
|
||||||
end
|
|
||||||
end
|
|
@ -0,0 +1,27 @@
|
|||||||
|
import 'package:ansu_ui/scaffold/as_scaffold.dart';
|
||||||
|
import 'package:ansu_ui/tag/as_tag.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ExampleTag extends StatefulWidget {
|
||||||
|
ExampleTag({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ExampaleTagState createState() => _ExampaleTagState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ExampaleTagState extends State<ExampleTag> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ASScaffold(title: 'Tag',
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
ASTag.dangerousItem('带电'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
// This is a basic Flutter widget test.
|
||||||
|
//
|
||||||
|
// To perform an interaction with a widget in your test, use the WidgetTester
|
||||||
|
// utility that Flutter provides. For example, you can send tap and scroll
|
||||||
|
// gestures. You can also use WidgetTester to find child widgets in the widget
|
||||||
|
// tree, read text, and verify that the values of widget properties are correct.
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
|
import 'package:example/main.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||||
|
// Build our app and trigger a frame.
|
||||||
|
await tester.pumpWidget(MyApp());
|
||||||
|
|
||||||
|
// Verify that our counter starts at 0.
|
||||||
|
expect(find.text('0'), findsOneWidget);
|
||||||
|
expect(find.text('1'), findsNothing);
|
||||||
|
|
||||||
|
// Tap the '+' icon and trigger a frame.
|
||||||
|
await tester.tap(find.byIcon(Icons.add));
|
||||||
|
await tester.pump();
|
||||||
|
|
||||||
|
// Verify that our counter has incremented.
|
||||||
|
expect(find.text('0'), findsNothing);
|
||||||
|
expect(find.text('1'), findsOneWidget);
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
|
||||||
|
class ASTag extends StatefulWidget {
|
||||||
|
///宽度
|
||||||
|
final double width;
|
||||||
|
|
||||||
|
///高度
|
||||||
|
final double height;
|
||||||
|
|
||||||
|
///背景色
|
||||||
|
final Color bgColor;
|
||||||
|
|
||||||
|
///标签内容
|
||||||
|
final String text;
|
||||||
|
|
||||||
|
///标签文字颜色
|
||||||
|
final Color textColor;
|
||||||
|
|
||||||
|
///标签文字风格
|
||||||
|
final TextStyle textStyle;
|
||||||
|
|
||||||
|
///是否有边框
|
||||||
|
final bool outline;
|
||||||
|
|
||||||
|
///边框颜色
|
||||||
|
final Color outlineColor;
|
||||||
|
|
||||||
|
///圆角
|
||||||
|
final double radius;
|
||||||
|
ASTag(
|
||||||
|
{Key key,
|
||||||
|
this.width,
|
||||||
|
this.height,
|
||||||
|
this.bgColor,
|
||||||
|
this.text,
|
||||||
|
this.textColor,
|
||||||
|
this.textStyle,
|
||||||
|
this.outline = false,
|
||||||
|
this.outlineColor,
|
||||||
|
this.radius})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
ASTag.dangerousItem(this.text,
|
||||||
|
{Key key,
|
||||||
|
this.width,
|
||||||
|
this.height,
|
||||||
|
this.textStyle,
|
||||||
|
this.outlineColor,
|
||||||
|
this.radius})
|
||||||
|
: bgColor = Color(0xFFF69A2D),
|
||||||
|
textColor = Color(0xFFFFFFFF),
|
||||||
|
outline = false,
|
||||||
|
super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ASTagState createState() => _ASTagState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ASTagState extends State<ASTag> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
width: widget.width ?? 36.w,
|
||||||
|
height: widget.height ?? 18.w,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: widget.bgColor ?? Color(0xFFF69A2D),
|
||||||
|
border: widget.outline
|
||||||
|
? Border.all(
|
||||||
|
color: widget.outlineColor ?? Color(0xFFE50112),
|
||||||
|
)
|
||||||
|
: Border.fromBorderSide(BorderSide.none),
|
||||||
|
borderRadius: BorderRadius.circular(widget.radius ?? 9.w)),
|
||||||
|
child: Text(
|
||||||
|
widget.text,
|
||||||
|
style: widget.textStyle ??
|
||||||
|
TextStyle(
|
||||||
|
color: widget.textColor,
|
||||||
|
fontSize: 10.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
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