parent
0ce81f09f6
commit
166d957f9d
@ -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
|
@ -1,3 +1,4 @@
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
export 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
double get statusBarHeight => ScreenUtil().statusBarHeight;
|
||||
|
@ -0,0 +1,19 @@
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SettingsPage extends StatefulWidget {
|
||||
SettingsPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_SettingsPageState createState() => _SettingsPageState();
|
||||
}
|
||||
|
||||
class _SettingsPageState extends State<SettingsPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AkuScaffold(
|
||||
title: '设置',
|
||||
body: Text('test'),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:qr_code_scanner/qr_code_scanner.dart';
|
||||
|
||||
class ScanPage extends StatefulWidget {
|
||||
ScanPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ScanPageState createState() => _ScanPageState();
|
||||
}
|
||||
|
||||
class _ScanPageState extends State<ScanPage> {
|
||||
GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
|
||||
QRViewController _qrViewController;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_qrViewController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
QRView(
|
||||
key: qrKey,
|
||||
onQRViewCreated: (controller) {
|
||||
_qrViewController = controller;
|
||||
controller.scannedDataStream.listen((event) {
|
||||
BotToast.showText(text: event);
|
||||
});
|
||||
},
|
||||
),
|
||||
Center(
|
||||
child: Container(
|
||||
height: 200,
|
||||
width: 200,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Colors.red,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:aku_community_manager/tools/screen_tool.dart';
|
||||
|
||||
class AkuBackButton extends StatefulWidget {
|
||||
final Brightness brightness;
|
||||
AkuBackButton({
|
||||
Key key,
|
||||
this.brightness = Brightness.light,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AkuBackButtonState createState() => _AkuBackButtonState();
|
||||
}
|
||||
|
||||
class _AkuBackButtonState extends State<AkuBackButton> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Navigator.canPop(context)
|
||||
? IconButton(
|
||||
icon: Icon(
|
||||
Icons.arrow_back_ios,
|
||||
size: 32.w,
|
||||
color: widget.brightness == Brightness.light
|
||||
? Color(0xFF333333)
|
||||
: Color(0xFFEEEEEE),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)
|
||||
: SizedBox();
|
||||
}
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:aku_community_manager/tools/screen_tool.dart';
|
||||
|
||||
///用法大致同Scaffold
|
||||
|
||||
class AkuScaffold extends StatefulWidget {
|
||||
///AppBar 使用该值 `title`,`titleStyle`,`leading`,`brightness`将失效
|
||||
final PreferredSizeWidget appBar;
|
||||
|
||||
///title
|
||||
final String title;
|
||||
|
||||
///title style
|
||||
///
|
||||
///默认
|
||||
///
|
||||
///```
|
||||
///TextStyle(
|
||||
/// fontWeight: FontWeight.bold,
|
||||
/// color: Color(0xFF333333),
|
||||
/// fontSize: 36.sp,
|
||||
///)
|
||||
///```
|
||||
final TextStyle titleStyle;
|
||||
|
||||
///leading
|
||||
///
|
||||
///默认使用 `AkuBackButton`
|
||||
final Widget leading;
|
||||
|
||||
///brightness
|
||||
final Brightness brightness;
|
||||
|
||||
///body
|
||||
final Widget body;
|
||||
|
||||
///背景色
|
||||
///
|
||||
///默认`0xFFF9F9F9`
|
||||
final Color backgroundColor;
|
||||
AkuScaffold({
|
||||
Key key,
|
||||
this.appBar,
|
||||
this.title,
|
||||
this.titleStyle,
|
||||
this.leading,
|
||||
this.brightness = Brightness.light,
|
||||
this.body,
|
||||
this.backgroundColor = const Color(0XFFF9F9F9),
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AkuScaffoldState createState() => _AkuScaffoldState();
|
||||
}
|
||||
|
||||
class _AkuScaffoldState extends State<AkuScaffold> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: widget.backgroundColor,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
leading: widget.leading ?? AkuBackButton(),
|
||||
brightness: widget.brightness,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
title: DefaultTextStyle(
|
||||
style: widget.titleStyle ??
|
||||
TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF333333),
|
||||
fontSize: 36.sp,
|
||||
),
|
||||
child: Text(widget.title),
|
||||
),
|
||||
),
|
||||
body: widget.body,
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue