Skip to content

Commit

Permalink
仿真翻页 参考了
Browse files Browse the repository at this point in the history
  • Loading branch information
mabDc committed Mar 20, 2021
1 parent 7fa60be commit e7ee4e1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
24 changes: 22 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class _SettingState extends State<Setting> {
height: 10,
),
OutlinedButton(
child: Text("预览 翻页"),
child: Text("预览 自动翻页"),
onPressed: () async {
if (textComposition == null) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
Expand All @@ -123,7 +123,7 @@ class _SettingState extends State<Setting> {
await SystemChrome.setEnabledSystemUIOverlays([]);
Navigator.of(context)
.push(MaterialPageRoute(
builder: (BuildContext context) => TCAutoPage(textComposition!)))
builder: (BuildContext context) => AutoPage(textComposition!)))
.then((value) =>
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values));
}
Expand All @@ -132,6 +132,26 @@ class _SettingState extends State<Setting> {
SizedBox(
height: 10,
),
OutlinedButton(
child: Text("预览 仿真翻页"),
onPressed: () async {
if (textComposition == null) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text('先排版才能预览'),
));
} else {
await SystemChrome.setEnabledSystemUIOverlays([]);
Navigator.of(context)
.push(MaterialPageRoute(
builder: (BuildContext context) => PageTurn(textComposition: textComposition!,)))
.then((value) =>
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values));
}
},
),
SizedBox(
height: 10,
),
OutlinedButton(
child: Text("预览 水平排列"),
onPressed: () async {
Expand Down
1 change: 1 addition & 0 deletions lib/text_composition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ library text_composition;
import 'package:flutter/material.dart';
import 'dart:ui' as ui;
export 'auto_page.dart';
export 'page_turn.dart';

/// * 暂不支持图片
/// * 文本排版
Expand Down

0 comments on commit e7ee4e1

Please sign in to comment.