From ba51cb0fdcf6b421bc8858655992ec4430c48af6 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Fri, 8 Jul 2022 02:32:48 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Improve=20the=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/lib/main.dart | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index baa0e07a..0a573545 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:oktoast/oktoast.dart'; import 'package:photo_manager/photo_manager.dart'; @@ -9,7 +11,12 @@ import 'widget/image_item_widget.dart'; final PhotoProvider provider = PhotoProvider(); -void main() => runApp(const _SimpleExampleApp()); +void main() { + runZonedGuarded( + () => runApp(const _SimpleExampleApp()), + (Object e, StackTrace s) => showToast('$e\n$s', textAlign: TextAlign.start), + ); +} class _SimpleExampleApp extends StatelessWidget { const _SimpleExampleApp({Key? key}) : super(key: key); @@ -19,7 +26,10 @@ class _SimpleExampleApp extends StatelessWidget { return OKToast( child: ChangeNotifierProvider.value( value: provider, // This is for the advanced usages. - child: const MaterialApp(home: _SimpleExamplePage()), + child: const MaterialApp( + title: 'Photo Manager Example', + home: _SimpleExamplePage(), + ), ), ); }