Merge branch 'master' of http://192.168.2.201:8099/laiiihz/ansu_ui
# Conflicts: # example/lib/main.dartnull_safety
commit
a6688ca4f9
@ -1 +1,2 @@
|
||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||
#include "Generated.xcconfig"
|
||||
|
@ -1 +1,2 @@
|
||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||
#include "Generated.xcconfig"
|
||||
|
@ -0,0 +1,41 @@
|
||||
# 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,43 @@
|
||||
import 'package:ansu_ui/ansu_ui.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ExampleNumericButton extends StatefulWidget {
|
||||
ExampleNumericButton({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ExampleNumericButtonState createState() => _ExampleNumericButtonState();
|
||||
}
|
||||
|
||||
class _ExampleNumericButtonState extends State<ExampleNumericButton> {
|
||||
_showSnack(BuildContext context, String title) {
|
||||
Scaffold.of(context).showSnackBar(
|
||||
SnackBar(content: Text(title)),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ASScaffold(
|
||||
title: '数量选择器',
|
||||
body: Builder(
|
||||
builder: (context) {
|
||||
return ListView(
|
||||
children: [
|
||||
ASNumericButton(
|
||||
initValue: 0,
|
||||
maxValue: 10,
|
||||
onChange: (value) {},
|
||||
reachMax: (value) {
|
||||
_showSnack(context, 'reach max');
|
||||
},
|
||||
reachMin: (value) {
|
||||
_showSnack(context, 'reach min');
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
import 'package:ansu_ui/ansu_ui.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ExampleTabBar extends StatefulWidget {
|
||||
ExampleTabBar({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ExampleTabBarState createState() => _ExampleTabBarState();
|
||||
}
|
||||
|
||||
class _ExampleTabBarState extends State<ExampleTabBar>
|
||||
with TickerProviderStateMixin {
|
||||
TabController _tabController1;
|
||||
TabController _tabController2;
|
||||
TabController _tabController3;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController1 = TabController(length: 3, vsync: this);
|
||||
_tabController2 = TabController(length: 5, vsync: this);
|
||||
_tabController3 = TabController(length: 10, vsync: this);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_tabController1?.dispose();
|
||||
_tabController2?.dispose();
|
||||
_tabController3?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ASScaffold(
|
||||
title: 'TabBar',
|
||||
appBarBottom: PreferredSize(
|
||||
child: Column(
|
||||
children: [
|
||||
ASTabBar(
|
||||
items: ['全部', 'Part1', 'Part2'],
|
||||
controller: _tabController1,
|
||||
),
|
||||
ASTabBar(
|
||||
items: List.generate(5, (index) => 'Tab $index'),
|
||||
controller: _tabController2,
|
||||
),
|
||||
ASTabBar(
|
||||
isScrollable: true,
|
||||
items: List.generate(10, (index) => 'Tab $index'),
|
||||
controller: _tabController3,
|
||||
),
|
||||
],
|
||||
),
|
||||
preferredSize: Size.fromHeight(46 * 3.0),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue