diff --git a/lib/02/01/main.dart b/lib/03/01/main.dart similarity index 100% rename from lib/02/01/main.dart rename to lib/03/01/main.dart diff --git a/lib/02/01/pages/color_add_page.dart b/lib/03/01/pages/color_add_page.dart similarity index 100% rename from lib/02/01/pages/color_add_page.dart rename to lib/03/01/pages/color_add_page.dart diff --git a/lib/02/01/pages/home_page.dart b/lib/03/01/pages/home_page.dart similarity index 96% rename from lib/02/01/pages/home_page.dart rename to lib/03/01/pages/home_page.dart index 9c97e0e..f8e303e 100644 --- a/lib/02/01/pages/home_page.dart +++ b/lib/03/01/pages/home_page.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:iroute/02/01/pages/color_add_page.dart'; +import 'color_add_page.dart'; import '../../../common/components/colors_panel.dart'; import '../../../common/pages/stl_color_page.dart'; diff --git a/lib/02/02/main.dart b/lib/03/02/main.dart similarity index 96% rename from lib/02/02/main.dart rename to lib/03/02/main.dart index 2b9819d..3409614 100644 --- a/lib/02/02/main.dart +++ b/lib/03/02/main.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:iroute/02/01/pages/color_add_page.dart'; +import 'pages/color_add_page.dart'; import '../../common/pages/stl_color_page.dart'; import 'pages/empty_page.dart'; import 'pages/home_page.dart'; diff --git a/lib/02/02/pages/color_add_page.dart b/lib/03/02/pages/color_add_page.dart similarity index 100% rename from lib/02/02/pages/color_add_page.dart rename to lib/03/02/pages/color_add_page.dart diff --git a/lib/02/02/pages/empty_page.dart b/lib/03/02/pages/empty_page.dart similarity index 100% rename from lib/02/02/pages/empty_page.dart rename to lib/03/02/pages/empty_page.dart diff --git a/lib/02/02/pages/home_page.dart b/lib/03/02/pages/home_page.dart similarity index 96% rename from lib/02/02/pages/home_page.dart rename to lib/03/02/pages/home_page.dart index 0c85ccc..76c90db 100644 --- a/lib/02/02/pages/home_page.dart +++ b/lib/03/02/pages/home_page.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:iroute/02/01/pages/color_add_page.dart'; +import 'color_add_page.dart'; import '../../../common/components/colors_panel.dart'; import '../../../common/pages/stl_color_page.dart'; diff --git a/lib/02/03/main.dart b/lib/03/03/main.dart similarity index 79% rename from lib/02/03/main.dart rename to lib/03/03/main.dart index e0d4076..0e7ad2d 100644 --- a/lib/02/03/main.dart +++ b/lib/03/03/main.dart @@ -1,8 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:iroute/02/01/pages/color_add_page.dart'; -import '../../common/pages/stl_color_page.dart'; -import 'pages/empty_page.dart'; -import 'pages/home_page.dart'; import 'router1/router1.dart'; void main() { @@ -21,6 +17,7 @@ class MyApp extends StatelessWidget { colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), + routes: Router1.routeMap, navigatorKey: Router1.globalNavKey, onUnknownRoute: Router1.onUnknownRoute, @@ -28,8 +25,4 @@ class MyApp extends StatelessWidget { onGenerateRoute: Router1.onGenerateRoute, ); } - - - - } diff --git a/lib/02/03/pages/color_add_page.dart b/lib/03/03/pages/color_add_page.dart similarity index 100% rename from lib/02/03/pages/color_add_page.dart rename to lib/03/03/pages/color_add_page.dart diff --git a/lib/02/03/pages/empty_page.dart b/lib/03/03/pages/empty_page.dart similarity index 100% rename from lib/02/03/pages/empty_page.dart rename to lib/03/03/pages/empty_page.dart diff --git a/lib/02/03/pages/home_page.dart b/lib/03/03/pages/home_page.dart similarity index 89% rename from lib/02/03/pages/home_page.dart rename to lib/03/03/pages/home_page.dart index abf86b7..45773e0 100644 --- a/lib/02/03/pages/home_page.dart +++ b/lib/03/03/pages/home_page.dart @@ -1,9 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:iroute/02/01/pages/color_add_page.dart'; -import 'package:iroute/02/03/router1/router1.dart'; +import '../router1/router1.dart'; import '../../../common/components/colors_panel.dart'; -import '../../../common/pages/stl_color_page.dart'; class HomePage extends StatefulWidget { const HomePage({super.key}); @@ -36,6 +34,7 @@ class _HomePageState extends State { } void _selectColor(Color color){ + Router1.nav.pushNamed(Router1.kColorDetail,arguments: color); } diff --git a/lib/02/03/router1/router1.dart b/lib/03/03/router1/router1.dart similarity index 100% rename from lib/02/03/router1/router1.dart rename to lib/03/03/router1/router1.dart diff --git a/lib/05/01/main.dart b/lib/05/01/main.dart new file mode 100644 index 0000000..a80f1f6 --- /dev/null +++ b/lib/05/01/main.dart @@ -0,0 +1,36 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(const OverlayPage()); +} + +class OverlayPage extends StatelessWidget{ + const OverlayPage({super.key}); + + @override + Widget build(BuildContext context) { + final OverlayEntry home = OverlayEntry(builder: (BuildContext context) => const HomePage()); + + return Directionality( + textDirection: TextDirection.ltr, + child: Overlay( + initialEntries: [home], + ), + ); + } +} + +class HomePage extends StatelessWidget { + const HomePage({super.key}); + + @override + Widget build(BuildContext context) { + return const ColoredBox( + color: Colors.white, + child: Align( + child: FlutterLogo(size: 60,), + ), + ); + } +} + diff --git a/lib/05/02/main.dart b/lib/05/02/main.dart new file mode 100644 index 0000000..3d34b2a --- /dev/null +++ b/lib/05/02/main.dart @@ -0,0 +1,54 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(const OverlayPage()); +} + +class OverlayPage extends StatelessWidget{ + const OverlayPage({super.key}); + + @override + Widget build(BuildContext context) { + final OverlayEntry home = OverlayEntry(builder: (BuildContext context) => const HomePage()); + final OverlayEntry circle = OverlayEntry(builder: (BuildContext context) => const Center(child: Circle())); + + return Directionality( + textDirection: TextDirection.ltr, + child: Overlay( + initialEntries: [home,circle], + ), + ); + } +} + +class HomePage extends StatelessWidget { + const HomePage({super.key}); + + @override + Widget build(BuildContext context) { + return const ColoredBox( + color: Colors.white, + child: Align( + child: FlutterLogo( + size: 60, + ), + ), + ); + } +} + +class Circle extends StatelessWidget { + const Circle({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + width: 20, + height: 20, + decoration: const BoxDecoration( + color: Colors.redAccent, + shape: BoxShape.circle + ), + ); + } +} diff --git a/lib/05/03/main.dart b/lib/05/03/main.dart new file mode 100644 index 0000000..f6eae69 --- /dev/null +++ b/lib/05/03/main.dart @@ -0,0 +1,59 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(const OverlayPage()); +} + +class OverlayPage extends StatelessWidget{ + const OverlayPage({super.key}); + + @override + Widget build(BuildContext context) { + final OverlayEntry home = + OverlayEntry(builder: (BuildContext context) => const HomePage()); + + final OverlayEntry circle = OverlayEntry( + builder: (BuildContext context) => Positioned( + top: 50, + left: 50, + child: const Circle(), + )); + + return Directionality( + textDirection: TextDirection.ltr, + child: Overlay( + initialEntries: [home, circle], + ), + ); + } +} + +class HomePage extends StatelessWidget { + const HomePage({super.key}); + + @override + Widget build(BuildContext context) { + return const ColoredBox( + color: Colors.white, + child: Align( + child: FlutterLogo( + size: 60, + ), + ), + ); + } +} + +class Circle extends StatelessWidget { + const Circle({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + width: 20, + height: 20, + decoration: + const BoxDecoration(color: Colors.redAccent, shape: BoxShape.circle), + ); + } +} diff --git a/lib/05/04/main.dart b/lib/05/04/main.dart new file mode 100644 index 0000000..0648355 --- /dev/null +++ b/lib/05/04/main.dart @@ -0,0 +1,77 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(const OverlayPage()); +} + +class OverlayPage extends StatefulWidget { + const OverlayPage({super.key}); + + @override + State createState() => _OverlayPageState(); +} + +class _OverlayPageState extends State { + double _left = 0; + double _top = 0; + + @override + Widget build(BuildContext context) { + final OverlayEntry home = + OverlayEntry(builder: (BuildContext context) => const HomePage()); + + final OverlayEntry circle = OverlayEntry( + builder: (BuildContext context) => Positioned( + top: 50, + left: 50, + child: GestureDetector( + onPanUpdate: _updatePosition, + child: const Circle(), + ), + )); + + return Directionality( + textDirection: TextDirection.ltr, + child: Overlay( + initialEntries: [home, circle], + ), + ); + } + + void _updatePosition(DragUpdateDetails details) { + setState(() { + _top += details.delta.dy; + _left += details.delta.dx; + }); + } +} + +class HomePage extends StatelessWidget { + const HomePage({super.key}); + + @override + Widget build(BuildContext context) { + return const ColoredBox( + color: Colors.white, + child: Align( + child: FlutterLogo( + size: 60, + ), + ), + ); + } +} + +class Circle extends StatelessWidget { + const Circle({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + width: 20, + height: 20, + decoration: + const BoxDecoration(color: Colors.redAccent, shape: BoxShape.circle), + ); + } +} diff --git a/lib/05/05/main.dart b/lib/05/05/main.dart new file mode 100644 index 0000000..8e14ff8 --- /dev/null +++ b/lib/05/05/main.dart @@ -0,0 +1,127 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(const OverlayPage()); +} + +class OverlayPage extends StatefulWidget { + const OverlayPage({super.key}); + + @override + State createState() => _OverlayPageState(); +} + +class _OverlayPageState extends State { + @override + Widget build(BuildContext context) { + final OverlayEntry home = OverlayEntry(builder: (BuildContext context) => const HomePage()); + return Directionality( + textDirection: TextDirection.ltr, + child: Overlay( + initialEntries: [home], + ), + ); + } +} + +class HomePage extends StatefulWidget { + const HomePage({super.key}); + + @override + State createState() => _HomePageState(); +} + +class _HomePageState extends State { + + OverlayEntry? entry; + + @override + Widget build(BuildContext context) { + return ColoredBox( + color: Colors.white, + child: Align( + child: GestureDetector( + onTap: _toggle, + child: const FlutterLogo( + size: 60, + ), + ), + ), + ); + } + + void _toggle() { + if(entry==null){ + entry = _createPoint(); + Overlay.of(context).insert(entry!); + }else{ + entry!.remove(); + entry = null; + } + } + + OverlayEntry _createPoint() { + return OverlayEntry( + builder: (BuildContext context) => Positioned( + width: 20, + height: 20, + left: 20, + top: 20, + child: GestureDetector(child: const Circle()), + ), + ); + } +} + +class ClickShowPage extends StatefulWidget { + const ClickShowPage({super.key}); + + @override + State createState() => _ClickShowPageState(); +} + +class _ClickShowPageState extends State { + Offset _position = Offset.zero; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: _addPoint, + onTapDown: _onTapDown, + ); + } + + void _addPoint() { + OverlayEntry entry = _createPoint(); + Overlay.of(context).insert(entry); + } + + OverlayEntry _createPoint() { + return OverlayEntry( + builder: (BuildContext context) => Positioned( + width: 20, + height: 20, + left: _position.dx - 10, + top: _position.dy - 10, + child: Circle()), + ); + } + + void _onTapDown(TapDownDetails details) { + _position = details.localPosition; + } +} + +class Circle extends StatelessWidget { + const Circle({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + width: 20, + height: 20, + decoration: + const BoxDecoration(color: Colors.redAccent, shape: BoxShape.circle), + ); + } +} diff --git a/lib/05/06/main.dart b/lib/05/06/main.dart new file mode 100644 index 0000000..d61d309 --- /dev/null +++ b/lib/05/06/main.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; +import 'pages/home_page.dart'; + + + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + debugShowCheckedModeBanner: false, + theme: ThemeData( + colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), + useMaterial3: true, + ), + home: const HomePage(), + ); + } +} + + diff --git a/lib/05/06/pages/color_add_page.dart b/lib/05/06/pages/color_add_page.dart new file mode 100644 index 0000000..bee43b4 --- /dev/null +++ b/lib/05/06/pages/color_add_page.dart @@ -0,0 +1,67 @@ +import 'dart:math'; + +import 'package:flutter/material.dart'; + +class ColorAddPage extends StatefulWidget { + const ColorAddPage({super.key}); + + @override + State createState() => _ColorAddPageState(); +} + +class _ColorAddPageState extends State { + late Color _color; + + @override + void initState() { + super.initState(); + _color = randomColor; + } + + @override + Widget build(BuildContext context) { + String text = '# ${_color.value.toRadixString(16)}'; + return Scaffold( + appBar: AppBar( + title: Text('添加颜色'), + actions: [IconButton(onPressed: _selectColor, icon: Icon(Icons.check ))], + ), + body: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0,vertical: 20), + child: Row( + children: [ + Expanded(child: Text(text,style: TextStyle(color: _color,fontSize: 24,letterSpacing: 4),)), + Container( + margin: EdgeInsets.only(left: 10), + width: 40, + height: 40, + child: Icon( + Icons.sell_outlined, + color: Colors.white, + ), + decoration: BoxDecoration( + color: _color, + borderRadius: BorderRadius.circular(8), + ), + ), + ], + ), + ), + ); + } + + Random _random = Random(); + + Color get randomColor { + return Color.fromARGB( + 255, + _random.nextInt(256), + _random.nextInt(256), + _random.nextInt(256), + ); + } + + void _selectColor() { + Navigator.of(context).pop(_color); + } +} diff --git a/lib/05/06/pages/home_page.dart b/lib/05/06/pages/home_page.dart new file mode 100644 index 0000000..f8e303e --- /dev/null +++ b/lib/05/06/pages/home_page.dart @@ -0,0 +1,51 @@ +import 'package:flutter/material.dart'; +import 'color_add_page.dart'; + +import '../../../common/components/colors_panel.dart'; +import '../../../common/pages/stl_color_page.dart'; + +class HomePage extends StatefulWidget { + const HomePage({super.key}); + + @override + State createState() => _HomePageState(); +} + +class _HomePageState extends State { + final List _colors = [ + Colors.red, Colors.black, Colors.blue, Colors.green, Colors.orange, + Colors.pink, Colors.purple, Colors.indigo, Colors.amber, Colors.cyan, + Colors.redAccent, Colors.grey, Colors.blueAccent, Colors.greenAccent, Colors.orangeAccent, + Colors.pinkAccent, Colors.purpleAccent, Colors.indigoAccent, Colors.amberAccent, Colors.cyanAccent, + ]; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title:const Text('颜色主页')), + floatingActionButton: FloatingActionButton( + onPressed: _toAddPage, + child: const Icon(Icons.add), + ), + body: ColorsPanel( + colors: _colors, + onSelect: _selectColor, + ), + ); + } + + void _selectColor(Color color){ + Route route = MaterialPageRoute(builder: (ctx) => StlColorPage(color: color)); + Navigator.of(context).push(route); + } + + void _toAddPage() async { + Route route = MaterialPageRoute(builder: (ctx) => const ColorAddPage()); + Color? color = await Navigator.of(context).push(route); + if (color != null) { + setState(() { + _colors.add(color); + }); + } + } +} diff --git a/lib/06/01/main.dart b/lib/06/01/main.dart new file mode 100644 index 0000000..d61d309 --- /dev/null +++ b/lib/06/01/main.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; +import 'pages/home_page.dart'; + + + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + debugShowCheckedModeBanner: false, + theme: ThemeData( + colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), + useMaterial3: true, + ), + home: const HomePage(), + ); + } +} + + diff --git a/lib/06/01/pages/color_add_page.dart b/lib/06/01/pages/color_add_page.dart new file mode 100644 index 0000000..bee43b4 --- /dev/null +++ b/lib/06/01/pages/color_add_page.dart @@ -0,0 +1,67 @@ +import 'dart:math'; + +import 'package:flutter/material.dart'; + +class ColorAddPage extends StatefulWidget { + const ColorAddPage({super.key}); + + @override + State createState() => _ColorAddPageState(); +} + +class _ColorAddPageState extends State { + late Color _color; + + @override + void initState() { + super.initState(); + _color = randomColor; + } + + @override + Widget build(BuildContext context) { + String text = '# ${_color.value.toRadixString(16)}'; + return Scaffold( + appBar: AppBar( + title: Text('添加颜色'), + actions: [IconButton(onPressed: _selectColor, icon: Icon(Icons.check ))], + ), + body: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0,vertical: 20), + child: Row( + children: [ + Expanded(child: Text(text,style: TextStyle(color: _color,fontSize: 24,letterSpacing: 4),)), + Container( + margin: EdgeInsets.only(left: 10), + width: 40, + height: 40, + child: Icon( + Icons.sell_outlined, + color: Colors.white, + ), + decoration: BoxDecoration( + color: _color, + borderRadius: BorderRadius.circular(8), + ), + ), + ], + ), + ), + ); + } + + Random _random = Random(); + + Color get randomColor { + return Color.fromARGB( + 255, + _random.nextInt(256), + _random.nextInt(256), + _random.nextInt(256), + ); + } + + void _selectColor() { + Navigator.of(context).pop(_color); + } +} diff --git a/lib/06/01/pages/home_page.dart b/lib/06/01/pages/home_page.dart new file mode 100644 index 0000000..f8e303e --- /dev/null +++ b/lib/06/01/pages/home_page.dart @@ -0,0 +1,51 @@ +import 'package:flutter/material.dart'; +import 'color_add_page.dart'; + +import '../../../common/components/colors_panel.dart'; +import '../../../common/pages/stl_color_page.dart'; + +class HomePage extends StatefulWidget { + const HomePage({super.key}); + + @override + State createState() => _HomePageState(); +} + +class _HomePageState extends State { + final List _colors = [ + Colors.red, Colors.black, Colors.blue, Colors.green, Colors.orange, + Colors.pink, Colors.purple, Colors.indigo, Colors.amber, Colors.cyan, + Colors.redAccent, Colors.grey, Colors.blueAccent, Colors.greenAccent, Colors.orangeAccent, + Colors.pinkAccent, Colors.purpleAccent, Colors.indigoAccent, Colors.amberAccent, Colors.cyanAccent, + ]; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title:const Text('颜色主页')), + floatingActionButton: FloatingActionButton( + onPressed: _toAddPage, + child: const Icon(Icons.add), + ), + body: ColorsPanel( + colors: _colors, + onSelect: _selectColor, + ), + ); + } + + void _selectColor(Color color){ + Route route = MaterialPageRoute(builder: (ctx) => StlColorPage(color: color)); + Navigator.of(context).push(route); + } + + void _toAddPage() async { + Route route = MaterialPageRoute(builder: (ctx) => const ColorAddPage()); + Color? color = await Navigator.of(context).push(route); + if (color != null) { + setState(() { + _colors.add(color); + }); + } + } +} diff --git a/lib/07/01/main.dart b/lib/07/01/main.dart new file mode 100644 index 0000000..6d242e4 --- /dev/null +++ b/lib/07/01/main.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; + +import 'pages/page_a.dart'; + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + debugShowCheckedModeBanner: false, + theme: ThemeData( + appBarTheme: AppBarTheme( + iconTheme: IconThemeData(color: Colors.black), + titleTextStyle: TextStyle(color: Colors.black,fontSize: 18,fontWeight: FontWeight.bold) + ) + ), + home: const PageA(), + ); + } +} diff --git a/lib/07/01/pages/page_a.dart b/lib/07/01/pages/page_a.dart new file mode 100644 index 0000000..3a6b700 --- /dev/null +++ b/lib/07/01/pages/page_a.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; +import 'package:iroute/07/01/pages/page_b.dart'; + +class PageA extends StatelessWidget { + const PageA({super.key}); + + @override + Widget build(BuildContext context) { + const Color bgColor = Color(0xffCCFFFF); + + return Scaffold( + backgroundColor: bgColor, + appBar: AppBar(title: Text('A'), + elevation: 0, + backgroundColor: bgColor, + ), + body: Center( + child: ElevatedButton( + onPressed: ()=>toPageB(context), + child: Text('Push B'), + ), + ), + ); + } + + void toPageB(BuildContext context){ + Navigator.of(context).push(MaterialPageRoute(builder: (_)=> const PageB())); + } +} diff --git a/lib/07/01/pages/page_b.dart b/lib/07/01/pages/page_b.dart new file mode 100644 index 0000000..843d2a2 --- /dev/null +++ b/lib/07/01/pages/page_b.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; + +import 'page_c.dart'; + +class PageB extends StatelessWidget { + const PageB({super.key}); + + @override + Widget build(BuildContext context) { + const Color bgColor = Color(0xffCCE5FF); + + return Scaffold( + backgroundColor: bgColor, + appBar: AppBar(title: Text('B',style: TextStyle(color: Colors.black),), + elevation: 0, + backgroundColor: bgColor, + ), + body: Center( + child: ElevatedButton( + onPressed: ()=>toPageC(context), + child: Text('Push C'), + ), + ), + ); + } + + void toPageC(BuildContext context){ + Navigator.of(context).push(MaterialPageRoute(builder: (_)=> const PageC())); + } +} \ No newline at end of file diff --git a/lib/07/01/pages/page_c.dart b/lib/07/01/pages/page_c.dart new file mode 100644 index 0000000..ff39d99 --- /dev/null +++ b/lib/07/01/pages/page_c.dart @@ -0,0 +1,17 @@ +import 'package:flutter/material.dart'; + +class PageC extends StatelessWidget { + const PageC({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text('C'),), + body: Center( + child: Text( + 'C' + ), + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index 46a2d20..4f612fd 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.flutter-io.cn" source: hosted - version: "1.17.1" + version: "1.17.2" cupertino_icons: dependency: "direct main" description: @@ -75,14 +75,19 @@ packages: description: flutter source: sdk version: "0.0.0" - js: + flutter_web_plugins: dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + go_router: + dependency: "direct main" description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + name: go_router + sha256: "2aa884667eeda3a1c461f31e72af1f77984ab0f29450d8fb12ec1f7bc53eea14" url: "https://pub.flutter-io.cn" source: hosted - version: "0.6.7" + version: "10.1.0" lints: dependency: transitive description: @@ -91,22 +96,30 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.2.0" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -132,10 +145,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.flutter-io.cn" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -172,10 +185,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.flutter-io.cn" source: hosted - version: "0.5.1" + version: "0.6.0" vector_math: dependency: transitive description: @@ -184,5 +197,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.1.4-beta" sdks: - dart: ">=3.0.6 <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" + flutter: ">=3.7.0" diff --git a/pubspec.yaml b/pubspec.yaml index 9879309..e157af2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -31,7 +31,7 @@ dependencies: flutter: sdk: flutter - + go_router: ^10.1.0 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 diff --git a/windows/runner/flutter_window.cpp b/windows/runner/flutter_window.cpp index b25e363..955ee30 100644 --- a/windows/runner/flutter_window.cpp +++ b/windows/runner/flutter_window.cpp @@ -31,6 +31,11 @@ bool FlutterWindow::OnCreate() { this->Show(); }); + // Flutter can complete the first frame before the "show window" callback is + // registered. The following call ensures a frame is pending to ensure the + // window is shown. It is a no-op if the first frame hasn't completed yet. + flutter_controller_->ForceRedraw(); + return true; }