ap_common 0.4.0-beta copy "ap_common: ^0.4.0-beta" to clipboard
ap_common: ^0.4.0-beta copied to clipboard

outdated

The school affairs(AP) series shares the engineering kit, rapid development of the school affairs series(AP) app

校務通系列介面與函式共用(施工中) #

長期校務通相關系列的app,介面與相關功能都極為相似,將相關的介面與函式庫,製作此套件以方便維護。

相關專案 #

目前共用項目 Todo List #

  • 資源
    • 主題色
      • 基本顏色
      • 淺色主題
      • 深色主題
    • 圖示
      • Outline
      • Filled
    • 圖片資源(97KB)
  • 工具類
    • 多國語言
    • 共用函式
    • 提示訊息(Toast - Flutter Level)
    • SharePreferences 包裝
  • 元件
    • 抽屜 ap_drawer.dart
    • 一般對話框 default_dialog.dart
    • 選項對話框中選項 dialog_option.dart
    • 頁面提示 hint_content.dart
    • 選項對話框 option_dialog.dart
    • 進度對話框 progress_dialog.dart
    • 設定頁元件 setting_widget.dart
    • 是或否對話框 yes_no_dialog.dart
  • 頁面(pages)
    • 關於我們 about_us_page.dart
    • 開放原始碼 open_source_page.dart
    • 使用者資訊 user_info_page.dart
    • 最新消息詳細資訊 news_content_page.dart
  • 頁面骨架(scaffold)
    • 課表
    • 成績
    • 首頁
    • 校園資訊
      • 教務處最新消息
      • 學校電話
      • 行事曆
    • 空堂教室查詢
    • 登入頁

Getting Started #

pubspec.yaml 中加入 package

    # 官方多國語套件
    flutter_localizations:
        sdk: flutter
    ap_common: ^0.2.8

執行加入套件

  $ flutter package get

在MaterialApp 上一層加入主題色模式(ThemeMode)設定 否則無法正常顯示
此功能只支援flutter v1.9 以上的SDK

    ThemeMode themeMode = ThemeMode.system;

    @override
      Widget build(BuildContext context) {
        return ApTheme(
            themeMode,
            child: MaterialApp(
              // (選擇)是否加入 
              theme: ApTheme.light,
              darkTheme: ApTheme.dark,
              themeMode: themeMode,
            ),
        );
    }

多國語言支援列表 #

  • 繁體中文(zh-TW)
  • 英文(en)

在MaterialApp 加入多國語言支援(有使用到ApLocalization才需要)

    ThemeMode themeMode = ThemeMode.system;

    @override
      Widget build(BuildContext context) {
        return MaterialApp(
              // 在此設定使用的語言,否則會按照系統提供語言,若為不支援語言 預設為英文
              localeResolutionCallback:
                    (Locale locale, Iterable<Locale> supportedLocales) {
                  return locale;
                },
               localizationsDelegates: [
                const ApLocalizationsDelegate(),
              ],
              supportedLocales: [
                const Locale('en', 'US'), // English
                const Locale('zh', 'TW'), // Chinese
              ],
            );
    }

widgets #

此項目必須加入主題色設定,否則會無法正常使用

//TODO 文件

pages #

此項目必須加入多國語言設定,否則會無法正常使用

//TODO 文件