mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Turns out there were more clients of the old paragraph API than I expected. This patch migrates them to the new API.
21 lines
629 B
Dart
21 lines
629 B
Dart
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import 'dart:ui';
|
|
|
|
import 'package:test/test.dart';
|
|
|
|
void main() {
|
|
test("Should be able to build and layout a paragraph", () {
|
|
ParagraphBuilder builder = new ParagraphBuilder();
|
|
builder.addText('Hello');
|
|
Paragraph paragraph = builder.build(new ParagraphStyle());
|
|
expect(paragraph, isNotNull);
|
|
|
|
paragraph.layout(new ParagraphConstraints(width: 800.0));
|
|
expect(paragraph.width, isNonZero);
|
|
expect(paragraph.height, isNonZero);
|
|
});
|
|
}
|