diff --git a/ln_jq_app/.gitignore b/ln_jq_app/.gitignore new file mode 100644 index 0000000..3820a95 --- /dev/null +++ b/ln_jq_app/.gitignore @@ -0,0 +1,45 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ +/coverage/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/ln_jq_app/README.md b/ln_jq_app/README.md new file mode 100644 index 0000000..f091074 --- /dev/null +++ b/ln_jq_app/README.md @@ -0,0 +1,16 @@ +# ln_jq_app + +加氢预约app + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/ln_jq_app/analysis_options.yaml b/ln_jq_app/analysis_options.yaml new file mode 100644 index 0000000..0d29021 --- /dev/null +++ b/ln_jq_app/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/ln_jq_app/lib/common/model/base_model.dart b/ln_jq_app/lib/common/model/base_model.dart new file mode 100644 index 0000000..c4d2492 --- /dev/null +++ b/ln_jq_app/lib/common/model/base_model.dart @@ -0,0 +1,19 @@ +class BaseModel { + bool? success; + String? type; + String? url; + + BaseModel({this.success, this.type, this.url}); + + factory BaseModel.fromJson(Map json) => BaseModel( + success: json['success']?.toString().contains("true"), + type: json['type']?.toString(), + url: json['url']?.toString(), + ); + + Map toJson() => { + if (success != null) 'success': success, + if (type != null) 'type': type, + if (url != null) 'url': url, + }; +} diff --git a/ln_jq_app/lib/common/styles/theme.dart b/ln_jq_app/lib/common/styles/theme.dart new file mode 100644 index 0000000..1b7c85e --- /dev/null +++ b/ln_jq_app/lib/common/styles/theme.dart @@ -0,0 +1,61 @@ +import 'package:flutter/material.dart'; + +class AppTheme { + static const String Font_Montserrat = 'Montserrat'; + + static const String Font_YuYang = 'YuYang'; + + static const Color themeColor = Color(0xFF0c83c3); + + static const Color secondaryColor = Colors.orange; + + static const Color darkThemeColor = Color(0xFF032896); + + /// 亮色主题样式 + static ThemeData light = ThemeData( + useMaterial3: false, + fontFamily: Font_Montserrat, + colorScheme: ColorScheme.fromSeed( + seedColor: themeColor, + primary: themeColor, + secondary: secondaryColor, + brightness: Brightness.light, + surface: Colors.white, + surfaceTint: Colors.transparent, + ), + appBarTheme: const AppBarTheme( + backgroundColor: Colors.white, + foregroundColor: Color.fromARGB(200, 0, 0, 0), + centerTitle: true, + titleTextStyle: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: Color.fromARGB(200, 0, 0, 0), + ), + ), + ); + + /// 暗色主题样式 + static ThemeData dark = ThemeData( + useMaterial3: false, + fontFamily: Font_Montserrat, + colorScheme: ColorScheme.fromSeed( + seedColor: darkThemeColor, + brightness: Brightness.dark, + surface: const Color.fromARGB(255, 42, 42, 42), + surfaceTint: Colors.transparent, + ), + appBarTheme: const AppBarTheme( + backgroundColor: Color.fromARGB(255, 34, 34, 34), + centerTitle: true, + titleTextStyle: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + bottomAppBarTheme: BottomAppBarThemeData( + color: Color.fromARGB(255, 34, 34, 34), + elevation: 4.0, + ), + ); +} diff --git a/ln_jq_app/lib/main.dart b/ln_jq_app/lib/main.dart new file mode 100644 index 0000000..7966bc9 --- /dev/null +++ b/ln_jq_app/lib/main.dart @@ -0,0 +1,42 @@ +import 'package:flutter/foundation.dart'; +import 'package:flutter_native_splash/flutter_native_splash.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; +import 'package:ln_jq_app/pages/b_page/base_widgets/view.dart'; +import 'package:ln_jq_app/pages/c_page/base_widgets/view.dart'; +import 'package:ln_jq_app/pages/home/view.dart'; + +import 'common/styles/theme.dart'; +import 'pages/login/view.dart'; + +/// Main +void main() async { + WidgetsBinding widgetsBinding = await init(isDebug: kDebugMode, logTag: '小羚羚'); + FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); + runApp( + GetxApp( + // 设计稿尺寸 单位:dp + designSize: const Size(390, 844), + // Getx Log + enableLog: kDebugMode, + // 默认的跳转动画 + defaultTransition: Transition.rightToLeft, + // 主题模式 + themeMode: GlobalService.to.themeMode, + // 主题 + theme: AppTheme.light, + // Dark主题 + darkTheme: AppTheme.dark, + // AppTitle + title: '小羚羚', + // 首页入口 + home: HomePage(), + // Builder + builder: (context, widget) { + // do something.... + return widget!; + }, + ), + ); +} + + diff --git a/ln_jq_app/lib/pages/b_page/base_widgets/controller.dart b/ln_jq_app/lib/pages/b_page/base_widgets/controller.dart new file mode 100644 index 0000000..5fed81f --- /dev/null +++ b/ln_jq_app/lib/pages/b_page/base_widgets/controller.dart @@ -0,0 +1,18 @@ +import 'package:flutter_native_splash/flutter_native_splash.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; + +class B_BaseWidgetsController extends GetxController with BaseControllerMixin { + @override + String get builderId => 'b_baseWidgets'; + + B_BaseWidgetsController(); + + @override + void onInit() { + super.onInit(); + FlutterNativeSplash.remove(); + } + + int pageIndex = 0; + +} diff --git a/ln_jq_app/lib/pages/b_page/base_widgets/view.dart b/ln_jq_app/lib/pages/b_page/base_widgets/view.dart new file mode 100644 index 0000000..28114b5 --- /dev/null +++ b/ln_jq_app/lib/pages/b_page/base_widgets/view.dart @@ -0,0 +1,75 @@ +import 'package:flutter/material.dart'; +import 'package:getx_scaffold/common/index.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; +import 'package:ln_jq_app/pages/b_page/base_widgets/controller.dart'; +import 'package:ln_jq_app/pages/b_page/site/view.dart'; +import 'package:ln_jq_app/pages/c_page/reservation/view.dart'; + +class B_BaseWidgetsPage extends GetView { + B_BaseWidgetsPage({super.key}); + + final PageController _pageController = PageController(); + // 主视图 + Widget _buildView() { + return PageView( + controller: _pageController, + onPageChanged: (index) { + jumpTabAndPage(index); + }, + children: _buildPages(), // 页面的列表 + ); + } + + void jumpTabAndPage(int index) { + controller.pageIndex = index; // 更新页面索引 + controller.updateUi(); // 更新 UI + _pageController.jumpToPage(controller.pageIndex); + } + // 对应的页面 + List _buildPages() { + return [ + SitePage(), + ReservationPage(), + ]; + } + + //导航栏 + Widget _buildNavigationBar() { + return NavigationX( + currentIndex: controller.pageIndex, // 当前选中的tab索引 + onTap: (index) { + jumpTabAndPage(index); + }, // 切换tab事件 + items: [ + NavigationItemModel( + label: '加氢预约', + icon: AntdIcon.orderedlist, + selectedIcon: AntdIcon.calendar_fill, + badge: '99+', + dot: true, + ), + NavigationItemModel( + label: '站点信息', + icon: AntdIcon.car, + selectedIcon: AntdIcon.car_fill, + ), + ], + ); + } + + @override + Widget build(BuildContext context) { + return GetBuilder( + init: B_BaseWidgetsController(), + id: 'b_baseWidgets', + builder: (_) { + return Scaffold( + extendBody: false, + resizeToAvoidBottomInset: false, + bottomNavigationBar: _buildNavigationBar(), + body: SafeArea(child: _buildView()), + ); + }, + ); + } +} diff --git a/ln_jq_app/lib/pages/b_page/reservation/controller.dart b/ln_jq_app/lib/pages/b_page/reservation/controller.dart new file mode 100644 index 0000000..0391da1 --- /dev/null +++ b/ln_jq_app/lib/pages/b_page/reservation/controller.dart @@ -0,0 +1,18 @@ +import 'package:getx_scaffold/getx_scaffold.dart'; + +class ReservationController extends GetxController with BaseControllerMixin { + @override + String get builderId => 'b_reservation'; + + ReservationController(); + + @override + void onInit() { + super.onInit(); + } + + @override + void onClose() { + super.onClose(); + } +} diff --git a/ln_jq_app/lib/pages/b_page/reservation/view.dart b/ln_jq_app/lib/pages/b_page/reservation/view.dart new file mode 100644 index 0000000..fc4e480 --- /dev/null +++ b/ln_jq_app/lib/pages/b_page/reservation/view.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; + +import 'controller.dart'; + + +class ReservationPage extends GetView { + const ReservationPage({super.key}); + + // 主视图 + Widget _buildView() { + return [ + TextX.titleLarge('预约'), + ].toColumn(mainAxisSize: MainAxisSize.min).center(); + } + + @override + Widget build(BuildContext context) { + return GetBuilder( + init: ReservationController(), + id: 'b_reservation', + builder: (_) { + return _buildView(); + }, + ); + } +} diff --git a/ln_jq_app/lib/pages/b_page/site/controller.dart b/ln_jq_app/lib/pages/b_page/site/controller.dart new file mode 100644 index 0000000..71dec6b --- /dev/null +++ b/ln_jq_app/lib/pages/b_page/site/controller.dart @@ -0,0 +1,18 @@ +import 'package:getx_scaffold/getx_scaffold.dart'; + +class SiteController extends GetxController with BaseControllerMixin { + @override + String get builderId => 'site'; + + SiteController(); + + @override + void onInit() { + super.onInit(); + } + + @override + void onClose() { + super.onClose(); + } +} diff --git a/ln_jq_app/lib/pages/b_page/site/view.dart b/ln_jq_app/lib/pages/b_page/site/view.dart new file mode 100644 index 0000000..f4c6667 --- /dev/null +++ b/ln_jq_app/lib/pages/b_page/site/view.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; + +import 'controller.dart'; + +class SitePage extends GetView { + const SitePage({super.key}); + + // 主视图 + Widget _buildView() { + return [ + TextX.titleLarge('加氢预约 加氢站'), + ].toColumn(mainAxisSize: MainAxisSize.min).center(); + } + + @override + Widget build(BuildContext context) { + return GetBuilder( + init: SiteController(), + id: 'site', + builder: (_) { + return _buildView(); + }, + ); + } +} diff --git a/ln_jq_app/lib/pages/c_page/base_widgets/controller.dart b/ln_jq_app/lib/pages/c_page/base_widgets/controller.dart new file mode 100644 index 0000000..a64faa0 --- /dev/null +++ b/ln_jq_app/lib/pages/c_page/base_widgets/controller.dart @@ -0,0 +1,14 @@ +import 'package:flutter_native_splash/flutter_native_splash.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; + +class BaseWidgetsController extends GetxController with BaseControllerMixin { + @override + String get builderId => 'baseWidgets'; + + BaseWidgetsController(); + + + + int pageIndex = 0; + +} diff --git a/ln_jq_app/lib/pages/c_page/base_widgets/index.dart b/ln_jq_app/lib/pages/c_page/base_widgets/index.dart new file mode 100644 index 0000000..dbd395b --- /dev/null +++ b/ln_jq_app/lib/pages/c_page/base_widgets/index.dart @@ -0,0 +1,4 @@ +library base_widgets; + +export 'controller.dart'; +export 'view.dart'; diff --git a/ln_jq_app/lib/pages/c_page/base_widgets/view.dart b/ln_jq_app/lib/pages/c_page/base_widgets/view.dart new file mode 100644 index 0000000..76e1ae9 --- /dev/null +++ b/ln_jq_app/lib/pages/c_page/base_widgets/view.dart @@ -0,0 +1,91 @@ +import 'package:flutter/material.dart'; +import 'package:getx_scaffold/common/index.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; +import 'package:ln_jq_app/pages/c_page/car_info/view.dart'; +import 'package:ln_jq_app/pages/c_page/map/view.dart'; +import 'package:ln_jq_app/pages/c_page/mine/view.dart'; +import 'package:ln_jq_app/pages/c_page/reservation/view.dart'; +import 'package:ln_jq_app/pages/demo/index.dart'; +import 'index.dart'; + +class BaseWidgetsPage extends GetView { + BaseWidgetsPage({super.key}); + + final PageController _pageController = PageController(); + // 主视图 + Widget _buildView() { + return PageView( + controller: _pageController, + onPageChanged: (index) { + jumpTabAndPage(index); + }, + children: _buildPages(), // 页面的列表 + ); + } + + void jumpTabAndPage(int index) { + controller.pageIndex = index; // 更新页面索引 + controller.updateUi(); // 更新 UI + _pageController.jumpToPage(controller.pageIndex); + } + // 对应的页面 + List _buildPages() { + return [ + MapPage(), + ReservationPage(), + CarInfoPage(), + MinePage(), + ]; + } + + //导航栏 + Widget _buildNavigationBar() { + return NavigationX( + currentIndex: controller.pageIndex, // 当前选中的tab索引 + onTap: (index) { + jumpTabAndPage(index); + }, // 切换tab事件 + items: [ + NavigationItemModel( + label: '地图', + icon: AntdIcon.location, + selectedIcon: AntdIcon.location_fill, + dot: false, + ), + NavigationItemModel( + label: '加氢预约', + icon: AntdIcon.orderedlist, + selectedIcon: AntdIcon.calendar_fill, + badge: '99+', + dot: true, + ), + NavigationItemModel( + label: '车辆信息', + icon: AntdIcon.car, + selectedIcon: AntdIcon.car_fill, + ), + NavigationItemModel( + label: '我的', + icon: AntdIcon.user, + selectedIcon: AntdIcon.user, + ), + ], + ); + } + + @override + Widget build(BuildContext context) { + return GetBuilder( + init: BaseWidgetsController(), + id: 'baseWidgets', + builder: (_) { + return Scaffold( + extendBody: false, + resizeToAvoidBottomInset: false, + bottomNavigationBar: _buildNavigationBar(), + body: SafeArea(child: _buildView()), + ); + }, + ); + } +} diff --git a/ln_jq_app/lib/pages/c_page/car_info/controller.dart b/ln_jq_app/lib/pages/c_page/car_info/controller.dart new file mode 100644 index 0000000..2b43b99 --- /dev/null +++ b/ln_jq_app/lib/pages/c_page/car_info/controller.dart @@ -0,0 +1,18 @@ +import 'package:getx_scaffold/getx_scaffold.dart'; + +class CarInfoController extends GetxController with BaseControllerMixin { + @override + String get builderId => 'car_info'; + + CarInfoController(); + + @override + void onInit() { + super.onInit(); + } + + @override + void onClose() { + super.onClose(); + } +} diff --git a/ln_jq_app/lib/pages/c_page/car_info/view.dart b/ln_jq_app/lib/pages/c_page/car_info/view.dart new file mode 100644 index 0000000..ad97f46 --- /dev/null +++ b/ln_jq_app/lib/pages/c_page/car_info/view.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; + +import 'controller.dart'; + +class CarInfoPage extends GetView { + const CarInfoPage({super.key}); + + // 主视图 + Widget _buildView() { + return [ + TextX.titleLarge('车辆信息'), + ].toColumn(mainAxisSize: MainAxisSize.min).center(); + } + + @override + Widget build(BuildContext context) { + return GetBuilder( + init: CarInfoController(), + id: 'car_info', + builder: (_) { + return _buildView(); + }, + ); + } +} diff --git a/ln_jq_app/lib/pages/c_page/map/controller.dart b/ln_jq_app/lib/pages/c_page/map/controller.dart new file mode 100644 index 0000000..192520a --- /dev/null +++ b/ln_jq_app/lib/pages/c_page/map/controller.dart @@ -0,0 +1,18 @@ +import 'package:getx_scaffold/getx_scaffold.dart'; + +class MapController extends GetxController with BaseControllerMixin { + @override + String get builderId => 'map'; + + MapController(); + + @override + void onInit() { + super.onInit(); + } + + @override + void onClose() { + super.onClose(); + } +} diff --git a/ln_jq_app/lib/pages/c_page/map/view.dart b/ln_jq_app/lib/pages/c_page/map/view.dart new file mode 100644 index 0000000..f4b8f8a --- /dev/null +++ b/ln_jq_app/lib/pages/c_page/map/view.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; + +import 'controller.dart'; + +class MapPage extends GetView { + const MapPage({super.key}); + + // 主视图 + Widget _buildView() { + return [ + TextX.titleLarge('地图'), + ].toColumn(mainAxisSize: MainAxisSize.min).center(); + } + + @override + Widget build(BuildContext context) { + return GetBuilder( + init: MapController(), + id: 'map', + builder: (_) { + return _buildView(); + }, + ); + } +} diff --git a/ln_jq_app/lib/pages/c_page/mine/controller.dart b/ln_jq_app/lib/pages/c_page/mine/controller.dart new file mode 100644 index 0000000..ca7dab7 --- /dev/null +++ b/ln_jq_app/lib/pages/c_page/mine/controller.dart @@ -0,0 +1,18 @@ +import 'package:getx_scaffold/getx_scaffold.dart'; + +class MineController extends GetxController with BaseControllerMixin { + @override + String get builderId => 'mine'; + + MineController(); + + @override + void onInit() { + super.onInit(); + } + + @override + void onClose() { + super.onClose(); + } +} diff --git a/ln_jq_app/lib/pages/c_page/mine/view.dart b/ln_jq_app/lib/pages/c_page/mine/view.dart new file mode 100644 index 0000000..b06c79e --- /dev/null +++ b/ln_jq_app/lib/pages/c_page/mine/view.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; + +import 'controller.dart'; + +class MinePage extends GetView { + const MinePage({super.key}); + + // 主视图 + Widget _buildView() { + return [ + TextX.titleLarge('我的'), + ].toColumn(mainAxisSize: MainAxisSize.min).center(); + } + + @override + Widget build(BuildContext context) { + return GetBuilder( + init: MineController(), + id: 'mine', + builder: (_) { + return _buildView(); + }, + ); + } +} diff --git a/ln_jq_app/lib/pages/c_page/reservation/controller.dart b/ln_jq_app/lib/pages/c_page/reservation/controller.dart new file mode 100644 index 0000000..d52e071 --- /dev/null +++ b/ln_jq_app/lib/pages/c_page/reservation/controller.dart @@ -0,0 +1,18 @@ +import 'package:getx_scaffold/getx_scaffold.dart'; + +class ReservationController extends GetxController with BaseControllerMixin { + @override + String get builderId => 'reservation'; + + ReservationController(); + + @override + void onInit() { + super.onInit(); + } + + @override + void onClose() { + super.onClose(); + } +} diff --git a/ln_jq_app/lib/pages/c_page/reservation/view.dart b/ln_jq_app/lib/pages/c_page/reservation/view.dart new file mode 100644 index 0000000..9299ffd --- /dev/null +++ b/ln_jq_app/lib/pages/c_page/reservation/view.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; + +import 'controller.dart'; + + +class ReservationPage extends GetView { + const ReservationPage({super.key}); + + // 主视图 + Widget _buildView() { + return [ + TextX.titleLarge('H2加氢站'), + ].toColumn(mainAxisSize: MainAxisSize.min).center(); + } + + @override + Widget build(BuildContext context) { + return GetBuilder( + init: ReservationController(), + id: 'reservation', + builder: (_) { + return _buildView(); + }, + ); + } +} diff --git a/ln_jq_app/lib/pages/home/controller.dart b/ln_jq_app/lib/pages/home/controller.dart new file mode 100644 index 0000000..22d56c9 --- /dev/null +++ b/ln_jq_app/lib/pages/home/controller.dart @@ -0,0 +1,39 @@ +import 'package:flutter_native_splash/flutter_native_splash.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; +import 'package:ln_jq_app/pages/b_page/base_widgets/view.dart'; +import 'package:ln_jq_app/pages/c_page/base_widgets/view.dart'; +import 'package:ln_jq_app/pages/login/view.dart'; + +class HomeController extends GetxController with BaseControllerMixin { + @override + String get builderId => 'home'; + + HomeController(); + + @override + void onInit() { + super.onInit(); + FlutterNativeSplash.remove(); + } + + //登录状态 未登录跳转登录页 + bool isLoggedIn = false; + + // 登录渠道 加氢站b_login 司机端c_login + String loginChannel = "c_login"; + String loginChannel_b = "b_login"; + + // 根据登录状态和登录渠道返回不同的首页 + Widget getHomePage(bool isLoggedIn, String loginChannel) { + if (!isLoggedIn) { + return LoginPage(); // 未登录,跳转到登录页面 + } else { + // 已登录,根据渠道判断跳转到不同的页面 + if (loginChannel == "b_login") { + return BaseWidgetsPage(); // 渠道A进入 BaseWidgetsPage + } else { + return B_BaseWidgetsPage(); // 渠道B进入 B_BaseWidgetsPage + } + } + } +} diff --git a/ln_jq_app/lib/pages/home/view.dart b/ln_jq_app/lib/pages/home/view.dart new file mode 100644 index 0000000..ff9ad26 --- /dev/null +++ b/ln_jq_app/lib/pages/home/view.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; +import 'package:ln_jq_app/pages/home/controller.dart'; + +class HomePage extends GetView { + const HomePage({super.key}); + + // 主视图 + Widget _buildView() { + return [Text('主页面')].toColumn(mainAxisSize: MainAxisSize.min).center(); + } + + @override + Widget build(BuildContext context) { + return GetBuilder( + init: HomeController(), + id: 'home', + builder: (_) { + return controller.getHomePage(false, controller.loginChannel); + }, + ); + } +} diff --git a/ln_jq_app/lib/pages/login/controller.dart b/ln_jq_app/lib/pages/login/controller.dart new file mode 100644 index 0000000..c4ffe06 --- /dev/null +++ b/ln_jq_app/lib/pages/login/controller.dart @@ -0,0 +1,25 @@ +import 'package:flutter/material.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; + +class LoginController extends GetxController with BaseControllerMixin { + @override + String get builderId => 'login'; + + LoginController(); + + // 控制输入框的 TextEditingController + final TextEditingController driverIdentityController = TextEditingController(); + final TextEditingController stationIdController = TextEditingController(); + final TextEditingController passwordController = TextEditingController(); + + @override + void onInit() { + super.onInit(); + } + + @override + void onClose() { + super.onClose(); + } + +} diff --git a/ln_jq_app/lib/pages/login/view.dart b/ln_jq_app/lib/pages/login/view.dart new file mode 100644 index 0000000..ab07ade --- /dev/null +++ b/ln_jq_app/lib/pages/login/view.dart @@ -0,0 +1,242 @@ +import 'package:flutter/material.dart'; +import 'package:getx_scaffold/getx_scaffold.dart'; +import 'package:ln_jq_app/common/styles/theme.dart'; +import 'package:ln_jq_app/pages/b_page/base_widgets/view.dart'; +import 'package:ln_jq_app/pages/c_page/base_widgets/view.dart'; +import 'package:ln_jq_app/pages/login/controller.dart'; + +class LoginPage extends StatefulWidget { + const LoginPage({super.key}); + + @override + State createState() => _LoginPageState(); +} + +class _LoginPageState extends State with SingleTickerProviderStateMixin { + late TabController tabController; + + //默认司机端 + bool cLogin = true; + bool _obscureText = true; // 默认密码为隐藏状态 + @override + void initState() { + super.initState(); + // 初始化 TabController,传入 vsync 参数 + tabController = TabController(length: 2, vsync: this); + tabController.addListener(_tabChangeListener); + } + + void _tabChangeListener() { + // 如果 TabController 不是正在被用户手动滑动(即是初始化或其他操作) + if (!tabController.indexIsChanging) { + switchTab(tabController.index); + } + } + + // 切换Tab + void switchTab(int index) { + setState(() { + cLogin = (index == 0); + }); + } + + @override + void dispose() { + tabController.dispose(); // 销毁 TabController + super.dispose(); + } + + // 主视图 + Widget _buildView() { + // 使用 Get.find 获取控制器 + final controller = Get.find(); + + return Container( + color: Color(0xFFEFF4F7), + child: [ + Icon(cLogin ? AntdIcon.car : AntdIcon.USB), + SizedBox(height: 5.h), + TextX.bodyLarge(cLogin ? '司机端' : "加氢站", weight: FontWeight.w700), + SizedBox(height: 5.h), + TextX.bodyLarge(cLogin ? '安全驾驶·智能服务' : "氢能服务·专业运营"), + Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15), // 设置圆角弧度 + ), + margin: EdgeInsets.all(15), + elevation: 4, + child: Container( + height: cLogin ? 260.h : 320.h, + padding: EdgeInsets.all(15), + child: // TabBar切换 + Column( + children: [ + Card( + elevation: 2, + child: Padding( + padding: EdgeInsets.all(3), + child: TabBar( + controller: tabController, + onTap: (index) { + //保证尺寸变化 + delayed(300, () { + switchTab(index); + }); + }, + // 修改TabBar的选中状态和未选中状态样式 + labelColor: Colors.white, + // 选中时的文字颜色 + unselectedLabelColor: Colors.black, + // 未选中时的文字颜色 + indicator: BoxDecoration( + color: AppTheme.themeColor, // 选中的Tab背景色(模拟卡片式效果) + borderRadius: BorderRadius.circular(12), // 卡片的圆角效果 + boxShadow: [ + BoxShadow( + color: Colors.blue.withOpacity(0.2), + spreadRadius: 1, + blurRadius: 6, + ), + ], + ), + tabs: [ + Tab(text: '司机端登录'), + Tab(text: '加氢站登录'), + ], + isScrollable: false, + ), + ), + ), + // 根据选择的Tab展示不同的输入框 + Flexible( + child: TabBarView( + controller: tabController, + children: [ + // 司机端登录 + _driverLoginView(controller), + // 加氢站登录 + _stationLoginView(controller), + ], + ), + ), + ], + ), + ), + ), + ].toColumn(mainAxisSize: MainAxisSize.min).center(),); + } + + // 司机端登录界面 + Widget _driverLoginView(LoginController controller) { + return !cLogin + ? SizedBox() + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 20.h), + TextFormField( + controller: controller.driverIdentityController, + cursorColor: AppTheme.themeColor, + maxLength: 8, + decoration: InputDecoration( + hintText: '请输入身份后8位', + border: OutlineInputBorder(), + prefixIcon: Icon(Icons.person_2_outlined, color: Colors.grey), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: AppTheme.themeColor), + ), + ), + ), + SizedBox(height: 20.h), + ElevatedButton( + onPressed: () { + // 司机端登录 + Get.to(() => BaseWidgetsPage()); + }, + style: ElevatedButton.styleFrom( + backgroundColor: AppTheme.themeColor, + minimumSize: Size(double.infinity, 50), // 设置按钮宽度占满,指定最小高度 + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: Text('登录'), + ), + ], + ); + } + + // 加氢站登录界面 + Widget _stationLoginView(LoginController controller) { + return cLogin + ? SizedBox() + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 20), + TextFormField( + controller: controller.stationIdController, + cursorColor: AppTheme.themeColor, + decoration: InputDecoration( + hintText: '请输入加氢站编号', + border: OutlineInputBorder(), + prefixIcon: Icon(Icons.person_2_outlined, color: Colors.grey), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: AppTheme.themeColor), + ), + ), + ), + SizedBox(height: 20), + TextFormField( + controller: controller.passwordController, + obscureText: _obscureText, + cursorColor: AppTheme.themeColor, + decoration: InputDecoration( + hintText: '请输入密码', + border: OutlineInputBorder(), + suffixIcon: IconButton( + icon: Icon( + _obscureText ? Icons.visibility_off : Icons.visibility, // 切换图标 + ), + onPressed: () { + setState(() { + _obscureText = !_obscureText; + }); + }, + ), + prefixIcon: Icon(Icons.lock_outline, color: Colors.grey), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: AppTheme.themeColor), + ), + ), + ), + SizedBox(height: 20), + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: AppTheme.themeColor, + minimumSize: Size(double.infinity, 50), // 设置按钮宽度占满,指定最小高度 + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + onPressed: () { + // 加氢站登录逻辑 + Get.to(() => B_BaseWidgetsPage()); + }, + child: Text('登录'), + ), + ], + ); + } + + @override + Widget build(BuildContext context) { + return GetBuilder( + init: LoginController(), + id: 'login', + builder: (_) { + return Scaffold(body: _buildView()); + }, + ); + } +} diff --git a/ln_jq_app/pubspec.lock b/ln_jq_app/pubspec.lock new file mode 100644 index 0000000..68d0963 --- /dev/null +++ b/ln_jq_app/pubspec.lock @@ -0,0 +1,922 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + ansicolor: + dependency: transitive + description: + name: ansicolor + sha256: "50e982d500bc863e1d703448afdbf9e5a72eb48840a4f766fa361ffd6877055f" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.3" + archive: + dependency: transitive + description: + name: archive + sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.0.7" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.7.0" + asn1lib: + dependency: transitive + description: + name: asn1lib + sha256: "9a8f69025044eb466b9b60ef3bc3ac99b4dc6c158ae9c56d25eeccf5bc56d024" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.6.5" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.13.0" + badges: + dependency: transitive + description: + name: badges + sha256: a7b6bbd60dce418df0db3058b53f9d083c22cdb5132a052145dc267494df0b84 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.4.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.2" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.19.1" + connectivity_plus: + dependency: transitive + description: + name: connectivity_plus + sha256: b5e72753cf63becce2c61fd04dfe0f1c430cc5278b53a1342dc5ad839eab29ec + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.1.5" + connectivity_plus_platform_interface: + dependency: transitive + description: + name: connectivity_plus_platform_interface + sha256: "42657c1715d48b167930d5f34d00222ac100475f73d10162ddf43e714932f204" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.2" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.6" + csslib: + dependency: transitive + description: + name: csslib + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.2" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.8" + dbus: + dependency: transitive + description: + name: dbus + sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.7.11" + decimal: + dependency: transitive + description: + name: decimal + sha256: fc706a5618b81e5b367b01dd62621def37abc096f2b46a9bd9068b64c1fa36d0 + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.2.4" + device_info_plus: + dependency: transitive + description: + name: device_info_plus + sha256: a7fd703482b391a87d60b6061d04dfdeab07826b96f9abd8f5ed98068acc0074 + url: "https://pub.flutter-io.cn" + source: hosted + version: "10.1.2" + device_info_plus_platform_interface: + dependency: transitive + description: + name: device_info_plus_platform_interface + sha256: e1ea89119e34903dca74b883d0dd78eb762814f97fb6c76f35e9ff74d261a18f + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.0.3" + dio: + dependency: transitive + description: + name: dio + sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9 + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.9.0" + dio_web_adapter: + dependency: transitive + description: + name: dio_web_adapter + sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.1" + encrypt: + dependency: transitive + description: + name: encrypt + sha256: "62d9aa4670cc2a8798bab89b39fc71b6dfbacf615de6cf5001fb39f7e4a996a2" + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.0.3" + event_bus: + dependency: transitive + description: + name: event_bus + sha256: "1a55e97923769c286d295240048fc180e7b0768902c3c2e869fe059aafa15304" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.1" + extended_image: + dependency: transitive + description: + name: extended_image + sha256: "69d4299043334ecece679996e47d0b0891cd8c29d8da0034868443506f1d9a78" + url: "https://pub.flutter-io.cn" + source: hosted + version: "8.3.1" + extended_image_library: + dependency: transitive + description: + name: extended_image_library + sha256: e61dafd94400fff6ef7ed1523d445ff3af137f198f3228e4a3107bc5b4bec5d1 + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.0.6" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.4" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.0.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_easyloading: + dependency: transitive + description: + name: flutter_easyloading + sha256: ba21a3c883544e582f9cc455a4a0907556714e1e9cf0eababfcb600da191d17c + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.5" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.0.0" + flutter_native_splash: + dependency: "direct main" + description: + name: flutter_native_splash + sha256: "4fb9f4113350d3a80841ce05ebf1976a36de622af7d19aca0ca9a9911c7ff002" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.7" + flutter_screenutil: + dependency: transitive + description: + name: flutter_screenutil + sha256: "8239210dd68bee6b0577aa4a090890342d04a136ce1c81f98ee513fc0ce891de" + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.9.3" + flutter_spinkit: + dependency: transitive + description: + name: flutter_spinkit + sha256: "77850df57c00dc218bfe96071d576a8babec24cf58b2ed121c83cca4a2fdce7f" + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.2.2" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + sha256: b9c2ad5872518a27507ab432d1fb97e8813b05f0fc693f9d40fad06d073e0678 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.1" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + get: + dependency: transitive + description: + name: get + sha256: c79eeb4339f1f3deffd9ec912f8a923834bec55f7b49c9e882b8fef2c139d425 + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.7.2" + getx_scaffold: + dependency: "direct main" + description: + name: getx_scaffold + sha256: caf11b370c20840352230f50221bcef1454b30ec56cce10ba25741fbbdf0a806 + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.2.2" + html: + dependency: transitive + description: + name: html + sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.15.6" + http: + dependency: transitive + description: + name: http + sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.5.0" + http_client_helper: + dependency: transitive + description: + name: http_client_helper + sha256: "8a9127650734da86b5c73760de2b404494c968a3fd55602045ffec789dac3cb1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.1.2" + image: + dependency: transitive + description: + name: image + sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928" + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.5.4" + intl: + dependency: transitive + description: + name: intl + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.19.0" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.7.2" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.flutter-io.cn" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.1.1" + lottie: + dependency: transitive + description: + name: lottie + sha256: "8ae0be46dbd9e19641791dc12ee480d34e1fd3f84c749adc05f3ad9342b71b95" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.3.2" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.16.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.0" + modal_bottom_sheet: + dependency: transitive + description: + name: modal_bottom_sheet + sha256: eac66ef8cb0461bf069a38c5eb0fa728cee525a531a8304bd3f7b2185407c67e + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.0" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.5.0" + package_info_plus: + dependency: transitive + description: + name: package_info_plus + sha256: "16eee997588c60225bda0488b6dcfac69280a6b7a3cf02c741895dd370a02968" + url: "https://pub.flutter-io.cn" + source: hosted + version: "8.3.1" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: "202a487f08836a592a6bd4f901ac69b3a8f146af552bbd14407b6b41e1c3f086" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.2.1" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.9.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.0" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: e122c5ea805bb6773bb12ce667611265980940145be920cd09a4b0ec0285cb16 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.20" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: efaec349ddfc181528345c56f8eda9d6cccd71c177511b132c6a0ddaefaa2738 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.3" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.3.0" + permission_handler: + dependency: transitive + description: + name: permission_handler + sha256: "59adad729136f01ea9e35a48f5d1395e25cba6cea552249ddbe9cf950f5d7849" + url: "https://pub.flutter-io.cn" + source: hosted + version: "11.4.0" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + sha256: d3971dcdd76182a0c198c096b5db2f0884b0d4196723d21a866fc4cdea057ebc + url: "https://pub.flutter-io.cn" + source: hosted + version: "12.1.0" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + sha256: f000131e755c54cf4d84a5d8bd6e4149e262cc31c5a8b1d698de1ac85fa41023 + url: "https://pub.flutter-io.cn" + source: hosted + version: "9.4.7" + permission_handler_html: + dependency: transitive + description: + name: permission_handler_html + sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.1.3+5" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + sha256: eb99b295153abce5d683cac8c02e22faab63e50679b937fa1bf67d58bb282878 + url: "https://pub.flutter-io.cn" + source: hosted + version: "4.3.0" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.2.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.0.1" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.8" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.9.1" + posix: + dependency: transitive + description: + name: posix + sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.0.3" + rational: + dependency: transitive + description: + name: rational + sha256: cb808fb6f1a839e6fc5f7d8cb3b0a10e1db48b3be102de73938c627f0b636336 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.3" + shared_preferences: + dependency: transitive + description: + name: shared_preferences + sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.5.3" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "34266009473bf71d748912da4bf62d439185226c03e01e2d9687bc65bbfcb713" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.15" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "1c33a907142607c40a7542768ec9badfd16293bac51da3a4482623d15845f88b" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.5.5" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + slider_captcha: + dependency: transitive + description: + name: slider_captcha + sha256: "0fc2e0e8af7bf0e7ece23b8213e6becf841dd7839a40ad4b2a5071eaf5135774" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.2" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.10.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.7.6" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.4.0" + universal_io: + dependency: transitive + description: + name: universal_io + sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.2" + url_launcher: + dependency: transitive + description: + name: url_launcher + sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.3.2" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "5c8b6c2d89a78f5a1cca70a73d9d5f86c701b36b42f9c9dac7bad592113c28e9" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.3.24" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "6b63f1441e4f653ae799166a72b50b1767321ecc263a57aadf825a7a2a5477d9" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.3.5" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.2.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: "8262208506252a3ed4ff5c0dc1e973d2c0e0ef337d0a074d35634da5d44397c9" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.2.4" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.3.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.4.1" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.4" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.19" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.13" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: d354a7ec6931e6047785f4db12a1f61ec3d43b207fc0790f863818543f8ff0dc + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.19" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.flutter-io.cn" + source: hosted + version: "15.0.2" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.1" + win32: + dependency: transitive + description: + name: win32 + sha256: d7cb55e04cd34096cd3a79b3330245f54cb96a370a1c27adb3c84b917de8b08e + url: "https://pub.flutter-io.cn" + source: hosted + version: "5.15.0" + win32_registry: + dependency: transitive + description: + name: win32_registry + sha256: "21ec76dfc731550fd3e2ce7a33a9ea90b828fdf19a5c3bcf556fa992cfa99852" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.5" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: "971043b3a0d3da28727e40ed3e0b5d18b742fa5a68665cca88e74b7876d5e025" + url: "https://pub.flutter-io.cn" + source: hosted + version: "6.6.1" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.9.0 <4.0.0" + flutter: ">=3.35.0" diff --git a/ln_jq_app/pubspec.yaml b/ln_jq_app/pubspec.yaml new file mode 100644 index 0000000..150001f --- /dev/null +++ b/ln_jq_app/pubspec.yaml @@ -0,0 +1,54 @@ +name: ln_jq_app +description: "加氢预约app" +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: ^3.9.0 + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.8 + getx_scaffold: ^0.2.2 + + flutter_native_splash: ^2.4.7 + +dev_dependencies: + flutter_test: + sdk: flutter + + flutter_lints: ^5.0.0 + + +flutter: + + uses-material-design: true + + assets: + - assets/images/ + diff --git a/ln_jq_app/test/widget_test.dart b/ln_jq_app/test/widget_test.dart new file mode 100644 index 0000000..e03a614 --- /dev/null +++ b/ln_jq_app/test/widget_test.dart @@ -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 in the flutter_test package. 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:ln_jq_app/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const 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); + }); +}