Skip to content

Latest commit

 

History

History

zcode_embed_ime

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

English is not my mother tongue, please correct the mistake.

Zcode 52 standard Mongolian Embed IME.

Web Demo click here

Features

  • Embed into the Flutter app, support all platform.

  • On mobile, use a soft keyboard by default.

  • On mobile, the soft keyboard auto show or hide when one MongolTextField or TextField gets or loses focus.

  • On the Desktop, use a hard keyboard by default.

  • support database

  • support MongolTextField and TextField.

Getting started

Although the mongol library is optional, I recommend adding it. It contains MongolTextField, MongolText, and other vertical Mongol components. For convenience, in this guide, I did not import the mongol libray. If you want to use the mongol library, import the the mongol library following the official guide and replace TextField used in this guide with MongolTextField.

1. Add needed library

dependencies:
  zcode_embed_ime: ^0.0.2

Run Flutter pub get.

2. Add Zcode 52 Mongol Font

If you using the mongol library, skip this step. However, please ensure that you are using a Zcode 52 font in your project.

  • Get a Zcode font

  • Add the font to your project

    Basically you just need to create an fonts folder for it and then declare the font in pubspec.yaml like this:

     flutter:
     fonts:
         - family: ZcodeQagan
         fonts:
             - asset: fonts/z52tsagaantig.ttf
  • Set the default Mongol font for your app

    In your main.dart file, set the fontFamily for the app theme.

    MaterialApp(
       theme: ThemeData(fontFamily: 'ZcodeQagan'),
       // ...
    );

    Now you won't have to manually set the font for every text widget. If you want to use a different font for some widgets, though, you can still set the fontFamily as you normally would inside TextStyle.

3. Use zcode_embed_ime

  • Import library

    import 'package:zcode_embed_ime/zcode_embed_ime.dart';
  • Add EmbedKeyboard

    @override
    Widget build() {
      return Scaffold(
        body: Column(children: [
          const Expanded(child: TextField()),
          EmbedKeyboard(
            layoutBuilders: const [
              ZcodeLayout.create,
              EnglishLayout.create,
            ],
          ),
        ]),
      );
    }

After completing this step, the library is imported at the lowest cost. You run your project and see what's going on.

However, after this step, there is no supporting the word database. Some words cannot be typed without supporting the word database. In the next version, I will fix this issue so that it can type all the words without relying on the word database. The word database should only be auxiliary.

Supporting word database

Please use zcode_embed_ime_db instead of this library, if you want to support the word database. zcode_embed_ime_db using sqlite3 libray and zcode_ime.db to show candidate words.

Statement

The Zcode inputting logic is copied from Zmongol's zmongol2021 library. The copyright belongs to Zmongol.

If someone finds cannot input some words or has any other problem with this library, please feel free to open an issue or PR.