Skip to content

Commit

Permalink
version 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
suragch committed Nov 29, 2022
1 parent 2ca097f commit 9276e5e
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 21 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## [3.2.1] - unpublished
## [3.3.0] - 2022.11.29

- Fix label problems on outlined input border with `MongolOutlineInputBorder` (#28).
- Export `TextAlignHorizontal` for `MongolTextField`.

## [3.2.0] - 2022.10.22

Expand Down
48 changes: 35 additions & 13 deletions example/lib/demos/mongol_text_field_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class SearchBody extends StatefulWidget {
}

class _SearchBodyState extends State<SearchBody> {
TextEditingController controller = TextEditingController();
TextEditingController controller1 = TextEditingController();
TextEditingController controller2 = TextEditingController();

@override
void initState() {
Expand All @@ -28,26 +29,47 @@ class _SearchBodyState extends State<SearchBody> {

@override
void dispose() {
controller.dispose();
controller1.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return SafeArea(
child: Center(
child: SizedBox(
width: 200,
height: 200,
child: MongolTextField(
style: const TextStyle(fontSize: 24),
controller: controller,
maxLines: null,
decoration: const InputDecoration(
border: OutlineInputBorder(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: SizedBox(
width: 200,
height: 200,
child: MongolTextField(
style: const TextStyle(fontSize: 24),
controller: controller1,
maxLines: null,
decoration: const InputDecoration(
border: OutlineInputBorder(),
),
),
),
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: MongolTextField(
style: const TextStyle(fontSize: 24),
controller: controller2,
textAlignHorizontal: TextAlignHorizontal.left,
maxLines: null,
expands: true,
decoration: const InputDecoration(
border: OutlineInputBorder(),
),
),
),
),
],
),
);
}
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.2.0"
version: "3.3.0"
path:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions lib/mongol.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export 'package:mongol/src/base/mongol_text_painter.dart';
export 'package:mongol/src/dialog/mongol_alert_dialog.dart';
export 'package:mongol/src/editing/mongol_text_field.dart';
export 'package:mongol/src/editing/mongol_render_editable.dart';
export 'package:mongol/src/editing/alignment.dart';
export 'package:mongol/src/editing/input_border.dart'
show SidelineInputBorder, MongolOutlineInputBorder;
export 'package:mongol/src/menu/mongol_popup_menu.dart';
Expand Down
9 changes: 5 additions & 4 deletions lib/src/editing/alignment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import 'package:flutter/foundation.dart';

/// The horizontal alignment of verical Mongolian text within an input box.
/// The horizontal alignment of vertical Mongolian text within an input box.
///
/// A single [x] value that can range from -1.0 to 1.0. -1.0 aligns to the left side
/// of an input box so that the left side of the first line of text fits within the
Expand All @@ -24,8 +24,7 @@ class TextAlignHorizontal {
/// Creates a TextAlignHorizontal from any x value between -1.0 and 1.0.
const TextAlignHorizontal({
required this.x,
}) :
assert(x >= -1.0 && x <= 1.0);
}) : assert(x >= -1.0 && x <= 1.0);

/// A value ranging from -1.0 to 1.0 that defines the leftmost and rightmost
/// locations of the left and right sides of the input box.
Expand All @@ -34,8 +33,10 @@ class TextAlignHorizontal {
/// Aligns a MongolTextField's input text with the leftmost location within a
/// MongolTextField's input box.
static const TextAlignHorizontal left = TextAlignHorizontal(x: -1.0);

/// Aligns a MongolTextField's input text to the center of the MongolTextField.
static const TextAlignHorizontal center = TextAlignHorizontal(x: 0.0);

/// Aligns a MongolTextField's input text with the rightmost location within a
/// MongolTextField.
static const TextAlignHorizontal right = TextAlignHorizontal(x: 1.0);
Expand All @@ -44,4 +45,4 @@ class TextAlignHorizontal {
String toString() {
return '${objectRuntimeType(this, 'TextAlignHorizontal')}(x: $x)';
}
}
}
1 change: 0 additions & 1 deletion lib/src/editing/input_border.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import 'dart:ui';
import 'dart:math' as math;

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'
show
InputBorder,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: mongol
description: Flutter widget package for displaying and editing vertical Mongolian text.
version: 3.2.0
version: 3.3.0
homepage: https://github.com/suragch/mongol

environment:
Expand Down

0 comments on commit 9276e5e

Please sign in to comment.