FLUTTER ARCHIVE

 1 # flutter pub get
 2 cd Intel-SRD-Flutter
 3 flutter clean
 4 flutter pub get
 5 
 6 # build app,里面的primary是前面的target
 7 flutter build ios --release
 8 
 9 cd ..
10 # 进入原生项目 archive和export
11 cd Intel-SRDAPP-IOS_flutter
12 
13 pod install
14 
15 # 导出achive,里面的primary是前面的target
16 xcodebuild archive -workspace HikVisionSRD.xcworkspace -scheme HikVisionSRD.xcworkspace -configuration release -sdk iphoneos 
17 
18 # 导出ipa
19 #xcodebuild -exportArchive -archivePath ${ArchivePath}runner.xcarchive -exportPath ${EXPORTIPA}runner -exportOptionsPlist ¥{EXPORT_OPTIONS}
20 xcodebuild -exportArchive -archivePath HikVisionSRD.xcarchive -exportOptionsPlist /Users/liuzhu/Downloads/thirdLibrary/exportOptions.plist -allowProvisioningUpdates -exportPath ./

 其他

import 'package:flutter/material.dart';

class WirelessSignalSimulation extends StatelessWidget {
  const WirelessSignalSimulation({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('无线信号覆盖仿真'),
      ),
      body: Stack(
        alignment: Alignment.center,
        children: [
          // 底层:径向渐变模拟信号覆盖
          Container(
            decoration: BoxDecoration(
              // 径向渐变配置
              gradient: RadialGradient(
                center: Alignment.center, // 渐变中心(与AP位置对应)
                radius: 1.0, // 渐变半径,1.0 表示覆盖整个容器
                colors: [
                  Colors.green, // 中心信号强,绿色
                  Colors.yellow, // 过渡颜色
                  Colors.orange, // 边缘信号弱,橙色
                ],
                stops: const [0.1, 0.3, 0.7], // 颜色分布位置,0~1
              ),
            ),
          ),
          // 上层:AP 图标和文字
          Positioned(
            child: Column(
              mainAxisSize: MainAxisSize.min,
              children: [
                // AP 图标
                const CircleAvatar(
                  radius: 10,
                  backgroundColor: Colors.white,
                ),
                const SizedBox(height: 4),
                // AP 文字说明
                Text(
                  '吸顶 AP',
                  style: TextStyle(
                    color: Colors.black,
                    fontSize: 12,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}

void main() {
  runApp(const MaterialApp(
    home: WirelessSignalSimulation(),
  ));
}

  

import 'package:flutter/material.dart';

void main() => runApp(const MaterialApp(home: WifiCoverageDemo()));

class WifiCoverageDemo extends StatelessWidget {
  const WifiCoverageDemo({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color(0xFFFFCCCC), // 粉色背景
      body: Center(
        child: CustomPaint(
          size: const Size(400, 400),
          painter: WifiCoveragePainter(),
        ),
      ),
    );
  }
}

class WifiCoveragePainter extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    final center = Offset(size.width / 2, size.height / 2);

    // 绘制信号强度区域 (同心圆渐变)
    _drawSignalRegions(canvas, center, size);

    // 绘制放射状光线
    _drawRadialLines(canvas, center);

    // 绘制墙体障碍物
    _drawObstacles(canvas, size);

    // 绘制吸顶AP
    _drawCeilingAP(canvas, center);
  }

  void _drawSignalRegions(Canvas canvas, Offset center, Size size) {
    const radii = [160.0, 120.0, 80.0]; // 红/黄/绿区域半径
    const colors = [
      Color(0xFFD32F2F), // 红色
      Color(0xFFFFEB3B), // 黄色
      Color(0xFF4CAF50), // 绿色
    ];

    for (int i = 0; i < radii.length; i++) {
      final paint = Paint()
        ..shader = RadialGradient(
          colors: [colors[i].withOpacity(0.8), colors[i].withOpacity(0.2)],
          stops: const [0.0, 1.0],
        ).createShader(Rect.fromCircle(center: center, radius: radii[i]))
        ..style = PaintingStyle.fill;

      canvas.drawCircle(center, radii[i], paint);
    }
  }

  void _drawRadialLines(Canvas canvas, Offset center) {
    final paint = Paint()
      ..color = Colors.white.withOpacity(0.3)
      ..strokeWidth = 1.5;

    for (int i = 0; i < 36; i++) {
      final angle = i * (3.1415926 * 2) / 36;
      final end = Offset(
        center.dx + 160 * cos(angle),
        center.dy + 160 * sin(angle),
      );
      canvas.drawLine(center, end, paint);
    }
  }

  void _drawObstacles(Canvas canvas, Size size) {
    final paint = Paint()
      ..color = Colors.black
      ..strokeWidth = 8.0
      ..strokeCap = StrokeCap.round
      ..style = PaintingStyle.stroke;

    final path = Path()
      // 十字墙体
      ..moveTo(size.width * 0.2, size.height / 2)
      ..lineTo(size.width * 0.8, size.height / 2)
      ..moveTo(size.width / 2, size.height * 0.2)
      ..lineTo(size.width / 2, size.height * 0.8)
      // L型墙角
      ..moveTo(size.width * 0.7, size.height * 0.7)
      ..lineTo(size.width * 0.9, size.height * 0.7)
      ..lineTo(size.width * 0.9, size.height * 0.9);

    canvas.drawPath(path, paint);
  }

  void _drawCeilingAP(Canvas canvas, Offset center) {
    // AP白圈
    canvas.drawCircle(
      center,
      24,
      Paint()
        ..color = Colors.white
        ..style = PaintingStyle.fill,
    );

    // AP文字
    final textPainter = TextPainter(
      text: const TextSpan(
        text: '吸顶AP',
        style: TextStyle(color: Colors.black, fontSize: 14, fontWeight: FontWeight.bold),
      ),
      textDirection: TextDirection.ltr,
    )..layout();
    textPainter.paint(
      canvas,
      Offset(center.dx - textPainter.width / 2, center.dy - textPainter.height / 2),
    );
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
}

  

posted on 2022-01-17 08:33  活最好的自己  阅读(253)  评论(0)    收藏  举报

导航