showToolPage function

void showToolPage(
  1. BuildContext ctx,
  2. String? name,
  3. ToolPageBuilder pageBuilder
)

显示工具页面

Implementation

void showToolPage(BuildContext ctx, String? name, ToolPageBuilder pageBuilder) {
  Widget pageWrapper = SafeArea(
    top: false,
    child: DefaultTextStyle(
      style: TextStyle(
        color: Colors.black,
        fontSize: 14,
        fontWeight: FontWeight.w400,
      ),
      child: Container(
        color: Colors.white,
        child: Column(
          children: <Widget>[
            NavBar(
              title: name,
              onBack: () {
                Navigator.pop(ctx);
              },
            ),
            Expanded(child: pageBuilder(ctx)),
          ],
        ),
      ),
    ),
  );

  Navigator.push(ctx, TransparentCupertinoPageRoute(
    builder: (ctx) {
      return pageWrapper;
    },
  ));
}