From 7246dfc13a179a844e9134cc23ae0463910fe4ae Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 21:47:46 +0530 Subject: [PATCH 01/42] Update swiftui-devs.md --- src/content/get-started/flutter-for/swiftui-devs.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/get-started/flutter-for/swiftui-devs.md b/src/content/get-started/flutter-for/swiftui-devs.md index ffe38e2f67..84acb3baaf 100644 --- a/src/content/get-started/flutter-for/swiftui-devs.md +++ b/src/content/get-started/flutter-for/swiftui-devs.md @@ -316,7 +316,7 @@ use the `CupertinoButton` class: ```dart - CupertinoButton( +CupertinoButton( onPressed: () { // This closure is called when your button is tapped. }, @@ -362,7 +362,7 @@ HStack { ```dart - Row( +Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(CupertinoIcons.globe), @@ -407,7 +407,7 @@ except it swaps [`Column`][] for `Row`: ```dart - Column( +Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(CupertinoIcons.globe), @@ -619,7 +619,7 @@ of the `Person` class to create the custom `PersonView` widget. ```dart - SingleChildScrollView( +SingleChildScrollView( child: Column( children: mockPersons .map( @@ -772,7 +772,7 @@ This animates the `Transform.rotate` widget. ```dart - AnimatedRotation( +AnimatedRotation( duration: const Duration(seconds: 1), turns: turns, curve: Curves.easeIn, @@ -825,7 +825,7 @@ with two classes that help you draw: ```dart - CustomPaint( + CustomPaint( painter: SignaturePainter(_points), size: Size.infinite, ), From 328af76edbe6d33cdcc3d6e57a106ee529b5dd7e Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 21:54:42 +0530 Subject: [PATCH 02/42] Update canvas.dart --- examples/get-started/flutter-for/ios_devs/lib/canvas.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/canvas.dart b/examples/get-started/flutter-for/ios_devs/lib/canvas.dart index 96f01fdc40..e682ad3f0a 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/canvas.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/canvas.dart @@ -31,8 +31,8 @@ class SignatureState extends State { }, onPanEnd: (details) => _points.add(null), child: - // #docregion custom-paint - CustomPaint( + // #docregion custom-paint + CustomPaint( painter: SignaturePainter(_points), size: Size.infinite, ), From 3a825e993c24b73c2ebda1616f56689999a238f4 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 21:55:17 +0530 Subject: [PATCH 03/42] Update text_button.dart --- .../get-started/flutter-for/ios_devs/lib/text_button.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart index 73c9072846..5e1f763321 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart @@ -24,14 +24,14 @@ class HomePage extends StatelessWidget { return Scaffold( body: Center( child: - // #docregion text-button - CupertinoButton( + // #docregion text-button + CupertinoButton( onPressed: () { // This closure is called when your button is tapped. }, child: const Text('Do something'), ) - // #enddocregion text-button + // #enddocregion text-button ), ); } From f97e0369da6e0dd507ef8c44d024e104d063bb33 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 21:57:30 +0530 Subject: [PATCH 04/42] Update swiftui-devs.md --- src/content/get-started/flutter-for/swiftui-devs.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/content/get-started/flutter-for/swiftui-devs.md b/src/content/get-started/flutter-for/swiftui-devs.md index 84acb3baaf..fd8692ea8f 100644 --- a/src/content/get-started/flutter-for/swiftui-devs.md +++ b/src/content/get-started/flutter-for/swiftui-devs.md @@ -963,7 +963,7 @@ call your navigation routes using their names. ```dart - ListView.builder( + ListView.builder( itemCount: mockPersons.length, itemBuilder: (context, index) { final person = mockPersons.elementAt(index); @@ -1098,7 +1098,7 @@ In **Flutter**, use the [`url_launcher`][] plugin. ```dart - CupertinoButton( +CupertinoButton( onPressed: () async { await launchUrl( Uri.parse('https://google.com'), @@ -1139,7 +1139,7 @@ of the `App` class: ```dart - CupertinoApp( +CupertinoApp( theme: CupertinoThemeData( brightness: Brightness.dark, ), @@ -1175,7 +1175,7 @@ of the `style` parameter of the `Text` widget. ```dart - Text( +Text( 'Hello, world!', style: TextStyle( fontSize: 30, @@ -1284,7 +1284,7 @@ following example: ```dart - Text( +Text( 'Cupertino', style: TextStyle( fontSize: 40, From 66372beb1939ddc08e5cde92e345c09b4f9a7747 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 21:58:09 +0530 Subject: [PATCH 05/42] Update row.dart --- examples/get-started/flutter-for/ios_devs/lib/row.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/row.dart b/examples/get-started/flutter-for/ios_devs/lib/row.dart index b953a1639d..3f7e39840a 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/row.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/row.dart @@ -24,8 +24,8 @@ class HomePage extends StatelessWidget { return const Scaffold( body: Center( child: - // #docregion row - Row( + // #docregion row + Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(CupertinoIcons.globe), From 79ac9eaa6f8cfbf32b894a661012755f72154a3b Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 21:58:33 +0530 Subject: [PATCH 06/42] Update column.dart --- examples/get-started/flutter-for/ios_devs/lib/column.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/column.dart b/examples/get-started/flutter-for/ios_devs/lib/column.dart index d005145b12..dc385945ce 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/column.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/column.dart @@ -24,8 +24,8 @@ class HomePage extends StatelessWidget { return const Scaffold( body: Center( child: - // #docregion column - Column( + // #docregion column + Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(CupertinoIcons.globe), From 82838b642ef1c49a64aa57a63f972ea399725d4b Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 21:59:01 +0530 Subject: [PATCH 07/42] Update scroll.dart --- examples/get-started/flutter-for/ios_devs/lib/scroll.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/scroll.dart b/examples/get-started/flutter-for/ios_devs/lib/scroll.dart index e41083b1cc..621173e1df 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/scroll.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/scroll.dart @@ -81,8 +81,8 @@ class HomePage extends StatelessWidget { // inside a scroll view of type // SingleChildScrollView (equivalent of a ScrollView in SwiftUI). body: - // #docregion scroll-example - SingleChildScrollView( + // #docregion scroll-example + SingleChildScrollView( child: Column( children: mockPersons .map( From f672eb1ce4f6a91c95cfaffee87c84be8155f3bd Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 21:59:27 +0530 Subject: [PATCH 08/42] Update simple_animation.dart --- .../flutter-for/ios_devs/lib/simple_animation.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart b/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart index 01bd5586bb..f5ea677f67 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart @@ -28,8 +28,8 @@ class _MyHomePageState extends State { return Scaffold( body: Center( child: - // #docregion animated-button - AnimatedRotation( + // #docregion animated-button + AnimatedRotation( duration: const Duration(seconds: 1), turns: turns, curve: Curves.easeIn, From 33c6c47da706967f4303b52b9eea0a143d329587 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:00:52 +0530 Subject: [PATCH 09/42] Update navigation.dart --- examples/get-started/flutter-for/ios_devs/lib/navigation.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/navigation.dart b/examples/get-started/flutter-for/ios_devs/lib/navigation.dart index cfebee5b68..59a03ed171 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/navigation.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/navigation.dart @@ -67,8 +67,8 @@ class HomePage extends StatelessWidget { ), child: Material( child: - // #docregion list-view - ListView.builder( + // #docregion list-view + ListView.builder( itemCount: mockPersons.length, itemBuilder: (context, index) { final person = mockPersons.elementAt(index); From cf96e316d92e1ef087b033eee65dad30ba327c27 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:03:11 +0530 Subject: [PATCH 10/42] Update openapp.dart --- .../flutter-for/ios_devs/lib/openapp.dart | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/openapp.dart b/examples/get-started/flutter-for/ios_devs/lib/openapp.dart index f95585f93c..4d81553381 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/openapp.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/openapp.dart @@ -31,18 +31,18 @@ class HomePage extends StatelessWidget { child: SafeArea( child: Center( child: - // #docregion open-app-example - CupertinoButton( - onPressed: () async { - await launchUrl( - Uri.parse('https://google.com'), - ); - }, - child: const Text( - 'Open website', + // #docregion open-app-example + CupertinoButton( + onPressed: () async { + await launchUrl( + Uri.parse('https://google.com'), + ); + }, + child: const Text( + 'Open website', + ), ), - ), - // #enddocregion open-app-example + // #enddocregion open-app-example ), ), ); From 641b0a87192e0ce9b01baf95ce1e1e8b3e0d6eb0 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:04:11 +0530 Subject: [PATCH 11/42] Update cupertino_themes.dart --- .../ios_devs/lib/cupertino_themes.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart b/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart index 813efd082c..09c4f60ab8 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart @@ -14,14 +14,14 @@ class App extends StatelessWidget { @override Widget build(BuildContext context) { return const - // #docregion theme - CupertinoApp( - theme: CupertinoThemeData( - brightness: Brightness.dark, - ), - home: HomePage(), - ); - // #enddocregion theme + // #docregion theme + CupertinoApp( + theme: CupertinoThemeData( + brightness: Brightness.dark, + ), + home: HomePage(), + ); + // #enddocregion theme } } From e81a5f89958d05d41f66e392dc98959b0b9f6b44 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:04:54 +0530 Subject: [PATCH 12/42] Update cupertino_themes.dart --- .../ios_devs/lib/cupertino_themes.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart b/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart index 09c4f60ab8..323b20fae4 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart @@ -38,16 +38,16 @@ class HomePage extends StatelessWidget { ), child: Center( child: - // #docregion styling-text - Text( - 'Hello, world!', - style: TextStyle( - fontSize: 30, - fontWeight: FontWeight.bold, - color: CupertinoColors.systemYellow, + // #docregion styling-text + Text( + 'Hello, world!', + style: TextStyle( + fontSize: 30, + fontWeight: FontWeight.bold, + color: CupertinoColors.systemYellow, + ), ), - ), - // #enddocregion styling-text + // #enddocregion styling-text ), ); } From 67ea7819311c977942daf5713693d5ce25d3de3c Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:06:14 +0530 Subject: [PATCH 13/42] Update stylingbutton.dart --- .../ios_devs/lib/stylingbutton.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart index 7a35f82749..934468023e 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart @@ -31,15 +31,15 @@ class HomePage extends StatelessWidget { return CupertinoPageScaffold( navigationBar: const CupertinoNavigationBar( middle: - // #docregion custom-font - Text( - 'Cupertino', - style: TextStyle( - fontSize: 40, - fontFamily: 'BungeeSpice', - ), - ) - // #enddocregion custom-font + // #docregion custom-font + Text( + 'Cupertino', + style: TextStyle( + fontSize: 40, + fontFamily: 'BungeeSpice', + ), + ) + // #enddocregion custom-font ), child: Center( // #docregion styling-button From 8ec0396c0775d854feb28a05cd94b61cbec8d993 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:07:03 +0530 Subject: [PATCH 14/42] Update cupertino_themes.dart --- .../get-started/flutter-for/ios_devs/lib/cupertino_themes.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart b/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart index 323b20fae4..cced492633 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart @@ -41,7 +41,7 @@ class HomePage extends StatelessWidget { // #docregion styling-text Text( 'Hello, world!', - style: TextStyle( + style: TextStyle( fontSize: 30, fontWeight: FontWeight.bold, color: CupertinoColors.systemYellow, From b398b2851d3feceda244653279b0e79c9bd26d13 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:08:38 +0530 Subject: [PATCH 15/42] Update navigation.dart --- .../flutter-for/ios_devs/lib/navigation.dart | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/navigation.dart b/examples/get-started/flutter-for/ios_devs/lib/navigation.dart index 59a03ed171..bf939ff9fa 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/navigation.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/navigation.dart @@ -67,32 +67,32 @@ class HomePage extends StatelessWidget { ), child: Material( child: - // #docregion list-view - ListView.builder( - itemCount: mockPersons.length, - itemBuilder: (context, index) { - final person = mockPersons.elementAt(index); - final age = '${person.age} years old'; - return ListTile( - title: Text(person.name), - subtitle: Text(age), - trailing: const Icon( - Icons.arrow_forward_ios, - ), - onTap: () { - // When a [ListTile] that represents a person is - // tapped, push the detailsPageRouteName route - // to the Navigator and pass the person's instance - // to the route. - Navigator.of(context).pushNamed( - detailsPageRouteName, - arguments: person, - ); - }, - ); - }, - ), - // #enddocregion list-view + // #docregion list-view + ListView.builder( + itemCount: mockPersons.length, + itemBuilder: (context, index) { + final person = mockPersons.elementAt(index); + final age = '${person.age} years old'; + return ListTile( + title: Text(person.name), + subtitle: Text(age), + trailing: const Icon( + Icons.arrow_forward_ios, + ), + onTap: () { + // When a [ListTile] that represents a person is + // tapped, push the detailsPageRouteName route + // to the Navigator and pass the person's instance + // to the route. + Navigator.of(context).pushNamed( + detailsPageRouteName, + arguments: person, + ); + }, + ); + }, + ), + // #enddocregion list-view ), ); } From fc7f84731337206006ef70bca4d7a924d3b0889d Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:09:19 +0530 Subject: [PATCH 16/42] Update canvas.dart --- .../get-started/flutter-for/ios_devs/lib/canvas.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/canvas.dart b/examples/get-started/flutter-for/ios_devs/lib/canvas.dart index e682ad3f0a..fd474cbcea 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/canvas.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/canvas.dart @@ -31,12 +31,12 @@ class SignatureState extends State { }, onPanEnd: (details) => _points.add(null), child: - // #docregion custom-paint - CustomPaint( - painter: SignaturePainter(_points), - size: Size.infinite, - ), - // #enddocregion custom-paint + // #docregion custom-paint + CustomPaint( + painter: SignaturePainter(_points), + size: Size.infinite, + ), + // #enddocregion custom-paint ); } } From 6ae42fd4b39d0c55458743fc267ab1326ac358f2 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:10:31 +0530 Subject: [PATCH 17/42] Update simple_animation.dart --- .../ios_devs/lib/simple_animation.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart b/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart index f5ea677f67..ce56d4e9ff 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart @@ -28,20 +28,20 @@ class _MyHomePageState extends State { return Scaffold( body: Center( child: - // #docregion animated-button - AnimatedRotation( - duration: const Duration(seconds: 1), - turns: turns, - curve: Curves.easeIn, - child: TextButton( + // #docregion animated-button + AnimatedRotation( + duration: const Duration(seconds: 1), + turns: turns, + curve: Curves.easeIn, + child: TextButton( onPressed: () { setState(() { turns += .125; }); }, child: const Text('Tap me!')), - ), - // #enddocregion animated-button + ), + // #enddocregion animated-button ), ); } From ea49ea60566fcbbb16bf2bdcf2c96789fec79c5a Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:11:02 +0530 Subject: [PATCH 18/42] Update scroll.dart --- .../get-started/flutter-for/ios_devs/lib/scroll.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/scroll.dart b/examples/get-started/flutter-for/ios_devs/lib/scroll.dart index 621173e1df..30e7fa1649 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/scroll.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/scroll.dart @@ -81,19 +81,19 @@ class HomePage extends StatelessWidget { // inside a scroll view of type // SingleChildScrollView (equivalent of a ScrollView in SwiftUI). body: - // #docregion scroll-example - SingleChildScrollView( - child: Column( - children: mockPersons + // #docregion scroll-example + SingleChildScrollView( + child: Column( + children: mockPersons .map( (person) => PersonView( person: person, ), ) .toList(), + ), ), - ), - // #enddocregion scroll-example + // #enddocregion scroll-example ); } } From ffb52ee2b521df1d8e7f05756de5242111c37278 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:11:33 +0530 Subject: [PATCH 19/42] Update column.dart --- .../flutter-for/ios_devs/lib/column.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/column.dart b/examples/get-started/flutter-for/ios_devs/lib/column.dart index dc385945ce..3b08116fd2 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/column.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/column.dart @@ -24,15 +24,15 @@ class HomePage extends StatelessWidget { return const Scaffold( body: Center( child: - // #docregion column - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(CupertinoIcons.globe), - Text('Hello, world!'), - ], - ), - // #enddocregion column + // #docregion column + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(CupertinoIcons.globe), + Text('Hello, world!'), + ], + ), + // #enddocregion column ), ); } From 9199a59dd9c05e8179aea1988e59202a71cc8751 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:11:55 +0530 Subject: [PATCH 20/42] Update row.dart --- .../flutter-for/ios_devs/lib/row.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/row.dart b/examples/get-started/flutter-for/ios_devs/lib/row.dart index 3f7e39840a..16aeb9b630 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/row.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/row.dart @@ -24,15 +24,15 @@ class HomePage extends StatelessWidget { return const Scaffold( body: Center( child: - // #docregion row - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(CupertinoIcons.globe), - Text('Hello, world!'), - ], - ), - // #enddocregion row + // #docregion row + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(CupertinoIcons.globe), + Text('Hello, world!'), + ], + ), + // #enddocregion row ), ); } From 7a73319dc8072cfedda25149304659d69aafa5e9 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:12:49 +0530 Subject: [PATCH 21/42] Update text_button.dart --- .../flutter-for/ios_devs/lib/text_button.dart | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart index 5e1f763321..b2185a7f50 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart @@ -23,16 +23,16 @@ class HomePage extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( body: Center( - child: - // #docregion text-button - CupertinoButton( - onPressed: () { - // This closure is called when your button is tapped. - }, - child: const Text('Do something'), - ) - // #enddocregion text-button - ), + child: + // #docregion text-button + CupertinoButton( + onPressed: () { + // This closure is called when your button is tapped. + }, + child: const Text('Do something'), + ) + // #enddocregion text-button + ), ); } } From 15ee3a95b9324fa7d40358f2ba8678bde0b65d19 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:19:00 +0530 Subject: [PATCH 22/42] Update canvas.dart --- .../get-started/flutter-for/ios_devs/lib/canvas.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/canvas.dart b/examples/get-started/flutter-for/ios_devs/lib/canvas.dart index fd474cbcea..e682ad3f0a 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/canvas.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/canvas.dart @@ -31,12 +31,12 @@ class SignatureState extends State { }, onPanEnd: (details) => _points.add(null), child: - // #docregion custom-paint - CustomPaint( - painter: SignaturePainter(_points), - size: Size.infinite, - ), - // #enddocregion custom-paint + // #docregion custom-paint + CustomPaint( + painter: SignaturePainter(_points), + size: Size.infinite, + ), + // #enddocregion custom-paint ); } } From a07f898c42bb5b5b4f2aef7f3d82dc556590f998 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:20:03 +0530 Subject: [PATCH 23/42] Update column.dart --- .../flutter-for/ios_devs/lib/column.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/column.dart b/examples/get-started/flutter-for/ios_devs/lib/column.dart index 3b08116fd2..dc385945ce 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/column.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/column.dart @@ -24,15 +24,15 @@ class HomePage extends StatelessWidget { return const Scaffold( body: Center( child: - // #docregion column - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(CupertinoIcons.globe), - Text('Hello, world!'), - ], - ), - // #enddocregion column + // #docregion column + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(CupertinoIcons.globe), + Text('Hello, world!'), + ], + ), + // #enddocregion column ), ); } From dd4e6cba960d9fcc540659da9e3a5bda531c5056 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:21:15 +0530 Subject: [PATCH 24/42] Update cupertino_themes.dart --- .../ios_devs/lib/cupertino_themes.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart b/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart index cced492633..421a07d696 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart @@ -14,14 +14,14 @@ class App extends StatelessWidget { @override Widget build(BuildContext context) { return const - // #docregion theme - CupertinoApp( - theme: CupertinoThemeData( - brightness: Brightness.dark, - ), - home: HomePage(), - ); - // #enddocregion theme + // #docregion theme + CupertinoApp( + theme: CupertinoThemeData( + brightness: Brightness.dark, + ), + home: HomePage(), + ); + // #enddocregion theme } } From 9af35979676c3ba424599d59339f6398f3f0aa49 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:21:51 +0530 Subject: [PATCH 25/42] Update cupertino_themes.dart --- .../ios_devs/lib/cupertino_themes.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart b/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart index 421a07d696..ed50f8c165 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart @@ -38,16 +38,16 @@ class HomePage extends StatelessWidget { ), child: Center( child: - // #docregion styling-text - Text( - 'Hello, world!', - style: TextStyle( - fontSize: 30, - fontWeight: FontWeight.bold, - color: CupertinoColors.systemYellow, - ), + // #docregion styling-text + Text( + 'Hello, world!', + style: TextStyle( + fontSize: 30, + fontWeight: FontWeight.bold, + color: CupertinoColors.systemYellow, ), - // #enddocregion styling-text + ), + // #enddocregion styling-text ), ); } From 3e6e1e980281072fef091bfb4bab1c58cf1679a7 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:22:27 +0530 Subject: [PATCH 26/42] Update row.dart --- .../flutter-for/ios_devs/lib/row.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/row.dart b/examples/get-started/flutter-for/ios_devs/lib/row.dart index 16aeb9b630..3f7e39840a 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/row.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/row.dart @@ -24,15 +24,15 @@ class HomePage extends StatelessWidget { return const Scaffold( body: Center( child: - // #docregion row - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(CupertinoIcons.globe), - Text('Hello, world!'), - ], - ), - // #enddocregion row + // #docregion row + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(CupertinoIcons.globe), + Text('Hello, world!'), + ], + ), + // #enddocregion row ), ); } From 90d7b9d642aaad110b0878689efe3043d10cc9eb Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:23:06 +0530 Subject: [PATCH 27/42] Update scroll.dart --- .../get-started/flutter-for/ios_devs/lib/scroll.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/scroll.dart b/examples/get-started/flutter-for/ios_devs/lib/scroll.dart index 30e7fa1649..af467f7959 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/scroll.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/scroll.dart @@ -81,9 +81,9 @@ class HomePage extends StatelessWidget { // inside a scroll view of type // SingleChildScrollView (equivalent of a ScrollView in SwiftUI). body: - // #docregion scroll-example - SingleChildScrollView( - child: Column( + // #docregion scroll-example + SingleChildScrollView( + child: Column( children: mockPersons .map( (person) => PersonView( @@ -91,9 +91,9 @@ class HomePage extends StatelessWidget { ), ) .toList(), - ), ), - // #enddocregion scroll-example + ), + // #enddocregion scroll-example ); } } From 89a1e57f0e9ba4f02eb9a21c83dc5bb68fdec691 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:23:49 +0530 Subject: [PATCH 28/42] Update scroll.dart --- examples/get-started/flutter-for/ios_devs/lib/scroll.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/scroll.dart b/examples/get-started/flutter-for/ios_devs/lib/scroll.dart index af467f7959..621173e1df 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/scroll.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/scroll.dart @@ -84,7 +84,7 @@ class HomePage extends StatelessWidget { // #docregion scroll-example SingleChildScrollView( child: Column( - children: mockPersons + children: mockPersons .map( (person) => PersonView( person: person, From aba9cd69520bb2e446936f9aaee83e5faaeaa4de Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:24:32 +0530 Subject: [PATCH 29/42] Update simple_animation.dart --- .../ios_devs/lib/simple_animation.dart | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart b/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart index ce56d4e9ff..677365e3f6 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart @@ -28,20 +28,20 @@ class _MyHomePageState extends State { return Scaffold( body: Center( child: - // #docregion animated-button - AnimatedRotation( - duration: const Duration(seconds: 1), - turns: turns, - curve: Curves.easeIn, - child: TextButton( - onPressed: () { - setState(() { - turns += .125; - }); - }, - child: const Text('Tap me!')), - ), - // #enddocregion animated-button + // #docregion animated-button + AnimatedRotation( + duration: const Duration(seconds: 1), + turns: turns, + curve: Curves.easeIn, + child: TextButton( + onPressed: () { + setState(() { + turns += .125; + }); + }, + child: const Text('Tap me!')), + ), + // #enddocregion animated-button ), ); } From e5c3ff92d6b991150989ec430246df522ce4feca Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:25:15 +0530 Subject: [PATCH 30/42] Update simple_animation.dart --- .../flutter-for/ios_devs/lib/simple_animation.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart b/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart index 677365e3f6..f5ea677f67 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart @@ -34,12 +34,12 @@ class _MyHomePageState extends State { turns: turns, curve: Curves.easeIn, child: TextButton( - onPressed: () { - setState(() { - turns += .125; - }); - }, - child: const Text('Tap me!')), + onPressed: () { + setState(() { + turns += .125; + }); + }, + child: const Text('Tap me!')), ), // #enddocregion animated-button ), From c5dd3490bf2261920944306010da68875df807f8 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:26:11 +0530 Subject: [PATCH 31/42] Update openapp.dart --- .../flutter-for/ios_devs/lib/openapp.dart | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/openapp.dart b/examples/get-started/flutter-for/ios_devs/lib/openapp.dart index 4d81553381..b2e7d9e37d 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/openapp.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/openapp.dart @@ -31,18 +31,18 @@ class HomePage extends StatelessWidget { child: SafeArea( child: Center( child: - // #docregion open-app-example - CupertinoButton( - onPressed: () async { - await launchUrl( - Uri.parse('https://google.com'), - ); - }, - child: const Text( - 'Open website', - ), + // #docregion open-app-example + CupertinoButton( + onPressed: () async { + await launchUrl( + Uri.parse('https://google.com'), + ); + }, + child: const Text( + 'Open website', ), - // #enddocregion open-app-example + ), + // #enddocregion open-app-example ), ), ); From d0d96b178a086ced6c9cf456d5cd95252d17f0ed Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:26:56 +0530 Subject: [PATCH 32/42] Update text_button.dart --- .../flutter-for/ios_devs/lib/text_button.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart index b2185a7f50..a553e83bdc 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart @@ -24,14 +24,14 @@ class HomePage extends StatelessWidget { return Scaffold( body: Center( child: - // #docregion text-button - CupertinoButton( - onPressed: () { - // This closure is called when your button is tapped. - }, - child: const Text('Do something'), - ) - // #enddocregion text-button + // #docregion text-button + CupertinoButton( + onPressed: () { + // This closure is called when your button is tapped. + }, + child: const Text('Do something'), + ) + // #enddocregion text-button ), ); } From f4a3f86f9c52f6b795c6e6d54d011fdf411bab97 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:27:45 +0530 Subject: [PATCH 33/42] Update text_button.dart --- .../flutter-for/ios_devs/lib/text_button.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart index a553e83bdc..9a266cb3f6 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart @@ -23,15 +23,15 @@ class HomePage extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( body: Center( - child: - // #docregion text-button - CupertinoButton( - onPressed: () { - // This closure is called when your button is tapped. - }, - child: const Text('Do something'), - ) - // #enddocregion text-button + child: + // #docregion text-button + CupertinoButton( + onPressed: () { + // This closure is called when your button is tapped. + }, + child: const Text('Do something'), + ) + // #enddocregion text-button ), ); } From 15dfaef43edd84a82cc2c0461503fc32ca693a55 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 22:29:20 +0530 Subject: [PATCH 34/42] Update navigation.dart --- .../flutter-for/ios_devs/lib/navigation.dart | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/navigation.dart b/examples/get-started/flutter-for/ios_devs/lib/navigation.dart index bf939ff9fa..59a03ed171 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/navigation.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/navigation.dart @@ -67,32 +67,32 @@ class HomePage extends StatelessWidget { ), child: Material( child: - // #docregion list-view - ListView.builder( - itemCount: mockPersons.length, - itemBuilder: (context, index) { - final person = mockPersons.elementAt(index); - final age = '${person.age} years old'; - return ListTile( - title: Text(person.name), - subtitle: Text(age), - trailing: const Icon( - Icons.arrow_forward_ios, - ), - onTap: () { - // When a [ListTile] that represents a person is - // tapped, push the detailsPageRouteName route - // to the Navigator and pass the person's instance - // to the route. - Navigator.of(context).pushNamed( - detailsPageRouteName, - arguments: person, - ); - }, - ); - }, - ), - // #enddocregion list-view + // #docregion list-view + ListView.builder( + itemCount: mockPersons.length, + itemBuilder: (context, index) { + final person = mockPersons.elementAt(index); + final age = '${person.age} years old'; + return ListTile( + title: Text(person.name), + subtitle: Text(age), + trailing: const Icon( + Icons.arrow_forward_ios, + ), + onTap: () { + // When a [ListTile] that represents a person is + // tapped, push the detailsPageRouteName route + // to the Navigator and pass the person's instance + // to the route. + Navigator.of(context).pushNamed( + detailsPageRouteName, + arguments: person, + ); + }, + ); + }, + ), + // #enddocregion list-view ), ); } From e18e8e9b4176a5158d33a8e4fbb8236dbf37a186 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 23:01:32 +0530 Subject: [PATCH 35/42] Update text_button.dart --- .../flutter-for/ios_devs/lib/text_button.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart index 9a266cb3f6..57af299238 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart @@ -24,15 +24,15 @@ class HomePage extends StatelessWidget { return Scaffold( body: Center( child: - // #docregion text-button - CupertinoButton( - onPressed: () { - // This closure is called when your button is tapped. - }, - child: const Text('Do something'), - ) + // #docregion text-button + CupertinoButton( + onPressed: () { + // This closure is called when your button is tapped. + }, + child: const Text('Do something'), + ) // #enddocregion text-button - ), + ), ); } } From aa9878eaeeede2810aa7049a902c9e1aa95cfccb Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 23:02:09 +0530 Subject: [PATCH 36/42] Update text_button.dart --- .../flutter-for/ios_devs/lib/text_button.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart index 57af299238..9aebde2734 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart @@ -24,13 +24,13 @@ class HomePage extends StatelessWidget { return Scaffold( body: Center( child: - // #docregion text-button - CupertinoButton( - onPressed: () { - // This closure is called when your button is tapped. - }, - child: const Text('Do something'), - ) + // #docregion text-button + CupertinoButton( + onPressed: () { + // This closure is called when your button is tapped. + }, + child: const Text('Do something'), + ) // #enddocregion text-button ), ); From 8c4f301fcdd85fb0afadd20c3a4adfb78c17cae8 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 23:05:01 +0530 Subject: [PATCH 37/42] Update stylingbutton.dart --- .../ios_devs/lib/stylingbutton.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart index 934468023e..29446e0d14 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart @@ -31,15 +31,15 @@ class HomePage extends StatelessWidget { return CupertinoPageScaffold( navigationBar: const CupertinoNavigationBar( middle: - // #docregion custom-font - Text( - 'Cupertino', - style: TextStyle( - fontSize: 40, - fontFamily: 'BungeeSpice', - ), - ) - // #enddocregion custom-font + // #docregion custom-font + Text( + 'Cupertino', + style: TextStyle( + fontSize: 40, + fontFamily: 'BungeeSpice', + ), + ) + // #enddocregion custom-font ), child: Center( // #docregion styling-button From 97c0b8f946a540fa05fe594b9ddd4645ae80e41b Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 23:05:33 +0530 Subject: [PATCH 38/42] Update stylingbutton.dart --- .../flutter-for/ios_devs/lib/stylingbutton.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart index 29446e0d14..6cdafbbb39 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart @@ -33,11 +33,11 @@ class HomePage extends StatelessWidget { middle: // #docregion custom-font Text( - 'Cupertino', - style: TextStyle( - fontSize: 40, - fontFamily: 'BungeeSpice', - ), + 'Cupertino', + style: TextStyle( + fontSize: 40, + fontFamily: 'BungeeSpice', + ), ) // #enddocregion custom-font ), From d6c902e88ad8afa7e4a4d8544088d709f22532fb Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 23:06:30 +0530 Subject: [PATCH 39/42] Update stylingbutton.dart --- .../flutter-for/ios_devs/lib/stylingbutton.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart index 6cdafbbb39..c6be5ffb83 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart @@ -33,12 +33,12 @@ class HomePage extends StatelessWidget { middle: // #docregion custom-font Text( - 'Cupertino', - style: TextStyle( - fontSize: 40, - fontFamily: 'BungeeSpice', - ), - ) + 'Cupertino', + style: TextStyle( + fontSize: 40, + fontFamily: 'BungeeSpice', + ), + ) // #enddocregion custom-font ), child: Center( From a33f8a9f0083a72217de6503fe0d02ab9bd61bd1 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 23:06:59 +0530 Subject: [PATCH 40/42] Update stylingbutton.dart --- .../flutter-for/ios_devs/lib/stylingbutton.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart index c6be5ffb83..3dbba32eb8 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart @@ -33,12 +33,12 @@ class HomePage extends StatelessWidget { middle: // #docregion custom-font Text( - 'Cupertino', - style: TextStyle( - fontSize: 40, - fontFamily: 'BungeeSpice', - ), - ) + 'Cupertino', + style: TextStyle( + fontSize: 40, + fontFamily: 'BungeeSpice', + ), + ) // #enddocregion custom-font ), child: Center( From a3e15cd95504195296d42715554e14c9e13f7fe2 Mon Sep 17 00:00:00 2001 From: Tirth Date: Wed, 7 Aug 2024 23:07:29 +0530 Subject: [PATCH 41/42] Update stylingbutton.dart --- .../flutter-for/ios_devs/lib/stylingbutton.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart index 3dbba32eb8..2ab1c985da 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart @@ -33,12 +33,12 @@ class HomePage extends StatelessWidget { middle: // #docregion custom-font Text( - 'Cupertino', - style: TextStyle( - fontSize: 40, - fontFamily: 'BungeeSpice', - ), - ) + 'Cupertino', + style: TextStyle( + fontSize: 40, + fontFamily: 'BungeeSpice', + ), + ) // #enddocregion custom-font ), child: Center( From 9346457b46be8819894379050a11b7b7a7e94188 Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Mon, 9 Sep 2024 15:26:16 -0500 Subject: [PATCH 42/42] Move region comments up and add replacement instructions --- .../flutter-for/ios_devs/lib/canvas.dart | 5 +- .../flutter-for/ios_devs/lib/column.dart | 5 +- .../ios_devs/lib/cupertino_themes.dart | 10 ++-- .../flutter-for/ios_devs/lib/images.dart | 9 ++- .../flutter-for/ios_devs/lib/navigation.dart | 5 +- .../flutter-for/ios_devs/lib/openapp.dart | 5 +- .../flutter-for/ios_devs/lib/row.dart | 5 +- .../flutter-for/ios_devs/lib/scroll.dart | 5 +- .../ios_devs/lib/simple_animation.dart | 5 +- .../ios_devs/lib/string_examples.dart | 5 +- .../ios_devs/lib/stylingbutton.dart | 19 +++---- .../flutter-for/ios_devs/lib/text_button.dart | 19 +++---- .../get-started/flutter-for/swiftui-devs.md | 56 +++++++++---------- .../get-started/flutter-for/uikit-devs.md | 7 +-- 14 files changed, 73 insertions(+), 87 deletions(-) diff --git a/examples/get-started/flutter-for/ios_devs/lib/canvas.dart b/examples/get-started/flutter-for/ios_devs/lib/canvas.dart index 96f01fdc40..6362ecfff7 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/canvas.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/canvas.dart @@ -30,9 +30,8 @@ class SignatureState extends State { }); }, onPanEnd: (details) => _points.add(null), - child: - // #docregion custom-paint - CustomPaint( + // #docregion custom-paint + child: CustomPaint( painter: SignaturePainter(_points), size: Size.infinite, ), diff --git a/examples/get-started/flutter-for/ios_devs/lib/column.dart b/examples/get-started/flutter-for/ios_devs/lib/column.dart index d005145b12..5265ebad7a 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/column.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/column.dart @@ -23,9 +23,8 @@ class HomePage extends StatelessWidget { Widget build(BuildContext context) { return const Scaffold( body: Center( - child: - // #docregion column - Column( + // #docregion column + child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(CupertinoIcons.globe), diff --git a/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart b/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart index 813efd082c..970886b3f0 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/cupertino_themes.dart @@ -13,9 +13,8 @@ class App extends StatelessWidget { @override Widget build(BuildContext context) { - return const - // #docregion theme - CupertinoApp( + // #docregion theme + return const CupertinoApp( theme: CupertinoThemeData( brightness: Brightness.dark, ), @@ -37,9 +36,8 @@ class HomePage extends StatelessWidget { ), ), child: Center( - child: - // #docregion styling-text - Text( + // #docregion styling-text + child: Text( 'Hello, world!', style: TextStyle( fontSize: 30, diff --git a/examples/get-started/flutter-for/ios_devs/lib/images.dart b/examples/get-started/flutter-for/ios_devs/lib/images.dart index 23e10aa51a..79081cc16a 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/images.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/images.dart @@ -6,11 +6,10 @@ class MyWidget extends StatelessWidget { @override Widget build(BuildContext context) { return const Image( - image: - // #docregion asset-image - AssetImage('images/a_dot_burr.jpeg') - // #enddocregion asset-image - ); + // #docregion asset-image + image: AssetImage('images/a_dot_burr.jpeg'), + // #enddocregion asset-image + ); } } diff --git a/examples/get-started/flutter-for/ios_devs/lib/navigation.dart b/examples/get-started/flutter-for/ios_devs/lib/navigation.dart index cfebee5b68..da730b0846 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/navigation.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/navigation.dart @@ -66,9 +66,8 @@ class HomePage extends StatelessWidget { ), ), child: Material( - child: - // #docregion list-view - ListView.builder( + // #docregion list-view + child: ListView.builder( itemCount: mockPersons.length, itemBuilder: (context, index) { final person = mockPersons.elementAt(index); diff --git a/examples/get-started/flutter-for/ios_devs/lib/openapp.dart b/examples/get-started/flutter-for/ios_devs/lib/openapp.dart index f95585f93c..1370f917e6 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/openapp.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/openapp.dart @@ -30,9 +30,8 @@ class HomePage extends StatelessWidget { return CupertinoPageScaffold( child: SafeArea( child: Center( - child: - // #docregion open-app-example - CupertinoButton( + // #docregion open-app-example + child: CupertinoButton( onPressed: () async { await launchUrl( Uri.parse('https://google.com'), diff --git a/examples/get-started/flutter-for/ios_devs/lib/row.dart b/examples/get-started/flutter-for/ios_devs/lib/row.dart index b953a1639d..ff509ffeb5 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/row.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/row.dart @@ -23,9 +23,8 @@ class HomePage extends StatelessWidget { Widget build(BuildContext context) { return const Scaffold( body: Center( - child: - // #docregion row - Row( + // #docregion row + child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(CupertinoIcons.globe), diff --git a/examples/get-started/flutter-for/ios_devs/lib/scroll.dart b/examples/get-started/flutter-for/ios_devs/lib/scroll.dart index e41083b1cc..acaeaf1604 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/scroll.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/scroll.dart @@ -80,9 +80,8 @@ class HomePage extends StatelessWidget { // Finally, display the list of people on the screen, // inside a scroll view of type // SingleChildScrollView (equivalent of a ScrollView in SwiftUI). - body: - // #docregion scroll-example - SingleChildScrollView( + // #docregion scroll-example + body: SingleChildScrollView( child: Column( children: mockPersons .map( diff --git a/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart b/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart index 01bd5586bb..534ffede7b 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/simple_animation.dart @@ -27,9 +27,8 @@ class _MyHomePageState extends State { Widget build(BuildContext context) { return Scaffold( body: Center( - child: - // #docregion animated-button - AnimatedRotation( + // #docregion animated-button + child: AnimatedRotation( duration: const Duration(seconds: 1), turns: turns, curve: Curves.easeIn, diff --git a/examples/get-started/flutter-for/ios_devs/lib/string_examples.dart b/examples/get-started/flutter-for/ios_devs/lib/string_examples.dart index c5e3d82db7..97cea57c9b 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/string_examples.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/string_examples.dart @@ -11,9 +11,8 @@ class MyWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return - // #docregion access-string - const Text(Strings.welcomeMessage); + // #docregion access-string + return const Text(Strings.welcomeMessage); // #enddocregion access-string } } diff --git a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart index 7a35f82749..041259b686 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/stylingbutton.dart @@ -30,17 +30,16 @@ class HomePage extends StatelessWidget { Widget build(BuildContext context) { return CupertinoPageScaffold( navigationBar: const CupertinoNavigationBar( - middle: - // #docregion custom-font - Text( - 'Cupertino', - style: TextStyle( - fontSize: 40, - fontFamily: 'BungeeSpice', - ), - ) - // #enddocregion custom-font + // #docregion custom-font + middle: Text( + 'Cupertino', + style: TextStyle( + fontSize: 40, + fontFamily: 'BungeeSpice', ), + ), + // #enddocregion custom-font + ), child: Center( // #docregion styling-button child: CupertinoButton( diff --git a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart index 73c9072846..aea0f656c4 100644 --- a/examples/get-started/flutter-for/ios_devs/lib/text_button.dart +++ b/examples/get-started/flutter-for/ios_devs/lib/text_button.dart @@ -23,16 +23,15 @@ class HomePage extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( body: Center( - child: - // #docregion text-button - CupertinoButton( - onPressed: () { - // This closure is called when your button is tapped. - }, - child: const Text('Do something'), - ) - // #enddocregion text-button - ), + // #docregion text-button + child: CupertinoButton( + onPressed: () { + // This closure is called when your button is tapped. + }, + child: const Text('Do something'), + ), + // #enddocregion text-button + ), ); } } diff --git a/src/content/get-started/flutter-for/swiftui-devs.md b/src/content/get-started/flutter-for/swiftui-devs.md index fc9c7225ab..eaced7f5ce 100644 --- a/src/content/get-started/flutter-for/swiftui-devs.md +++ b/src/content/get-started/flutter-for/swiftui-devs.md @@ -271,14 +271,14 @@ Button("Do something") { To achieve the same result in **Flutter**, use the `CupertinoButton` class: - + ```dart dartpad="3c9b9a4de431b86725197a7fc2c84158" - CupertinoButton( +CupertinoButton( onPressed: () { // This closure is called when your button is tapped. }, - child: const Text('Do something'), -) + const Text('Do something'), +), ``` **Flutter** gives you access to a variety of buttons with predefined styles. @@ -306,9 +306,9 @@ HStack { **Flutter** uses [`Row`][] rather than `HStack`: - + ```dart dartpad="0365338f938427b01d72e37cea554f75" - Row( +Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(CupertinoIcons.globe), @@ -340,9 +340,9 @@ VStack { **Flutter** uses the same Dart code from the previous example, except it swaps [`Column`][] for `Row`: - + ```dart dartpad="d9a288be0c2a353296fc8825680b84b8" - Column( +Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(CupertinoIcons.globe), @@ -519,9 +519,9 @@ To create a scrolling view, **Flutter** uses [`SingleChildScrollView`][]. In the following example, the function `mockPerson` mocks instances of the `Person` class to create the custom `PersonView` widget. - + ```dart dartpad="a75740320989ed04020d95502a0de34e" - SingleChildScrollView( +SingleChildScrollView( child: Column( children: mockPersons .map( @@ -650,19 +650,19 @@ Flutter names these widgets with the following format: `AnimatedFoo`. For example: To rotate a button, use the [`AnimatedRotation`][] class. This animates the `Transform.rotate` widget. - + ```dart dartpad="0ad0572cbf98ead2e5d31a2a94430f19" - AnimatedRotation( +AnimatedRotation( duration: const Duration(seconds: 1), turns: turns, curve: Curves.easeIn, - child: TextButton( + TextButton( onPressed: () { setState(() { turns += .125; }); }, - child: const Text('Tap me!')), + const Text('Tap me!')), ), ``` @@ -692,9 +692,9 @@ with two classes that help you draw: 1. [`CustomPaint`][] that requires a painter: - + ```dart dartpad="978d64ee66d54177fb639f8a9f801039" - CustomPaint( + CustomPaint( painter: SignaturePainter(_points), size: Size.infinite, ), @@ -797,9 +797,9 @@ call your navigation routes using their names. `mockPersons()`. Tapping a person pushes the person's detail page to the `Navigator` using `pushNamed()`. - + ```dart dartpad="d8b22d4dcbefdc8a2e21f1382cf7dc2a" - ListView.builder( + ListView.builder( itemCount: mockPersons.length, itemBuilder: (context, index) { final person = mockPersons.elementAt(index); @@ -902,15 +902,15 @@ URL to another application. In **Flutter**, use the [`url_launcher`][] plugin. - + ```dart dartpad="695beba25fa8120d89c9960cb222e276" - CupertinoButton( +CupertinoButton( onPressed: () async { await launchUrl( Uri.parse('https://google.com'), ); }, - child: const Text( + const Text( 'Open website', ), ), @@ -932,9 +932,9 @@ In **Flutter**, you can control light and dark mode at the app-level. To control the brightness mode, use the `theme` property of the `App` class: - + ```dart dartpad="18790cfaa8441085994373a4bc4f46b0" - CupertinoApp( +const CupertinoApp( theme: CupertinoThemeData( brightness: Brightness.dark, ), @@ -957,9 +957,9 @@ Text("Hello, world!") To style text in **Flutter**, add a `TextStyle` widget as the value of the `style` parameter of the `Text` widget. - + ```dart dartpad="18790cfaa8441085994373a4bc4f46b0" - Text( +Text( 'Hello, world!', style: TextStyle( fontSize: 30, @@ -1047,15 +1047,15 @@ To add a custom font to your project, follow these steps: After you add the font to your project, you can use it as in the following example: - + ```dart - Text( +Text( 'Cupertino', style: TextStyle( fontSize: 40, fontFamily: 'BungeeSpice', ), -) +), ``` :::note diff --git a/src/content/get-started/flutter-for/uikit-devs.md b/src/content/get-started/flutter-for/uikit-devs.md index a54b4bb845..0a71f8b818 100644 --- a/src/content/get-started/flutter-for/uikit-devs.md +++ b/src/content/get-started/flutter-for/uikit-devs.md @@ -465,8 +465,7 @@ class SignatureState extends State { }); }, onPanEnd: (details) => _points.add(null), - child: - CustomPaint( + child: CustomPaint( painter: SignaturePainter(_points), size: Size.infinite, ), @@ -670,7 +669,7 @@ class Strings { You can access your strings as such: - + ```dart Text(Strings.welcomeMessage); ``` @@ -1498,7 +1497,7 @@ You can now access your images using `AssetImage`: ```dart -AssetImage('images/a_dot_burr.jpeg') +image: AssetImage('images/a_dot_burr.jpeg'), ``` or directly in an `Image` widget: