repo_id
stringlengths
21
168
file_path
stringlengths
36
210
content
stringlengths
1
9.98M
__index_level_0__
int64
0
0
mirrored_repositories/flutter-examples/animation_example
mirrored_repositories/flutter-examples/animation_example/lib/main.dart
import 'package:flutter/material.dart'; import 'home_page.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( ...
0
mirrored_repositories/flutter-examples/animation_example
mirrored_repositories/flutter-examples/animation_example/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/persist_key_value
mirrored_repositories/flutter-examples/persist_key_value/lib/main.dart
import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; void main() { runApp(MaterialApp( // Disable the debug flag debugShowCheckedModeBanner: false, // Home home: MyHome())); } class MyHome extends StatefulWidget { @override MyHomeState crea...
0
mirrored_repositories/flutter-examples/persist_key_value/android
mirrored_repositories/flutter-examples/persist_key_value/android/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the them...
0
mirrored_repositories/flutter-examples/persist_key_value/android
mirrored_repositories/flutter-examples/persist_key_value/android/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/image_editor
mirrored_repositories/flutter-examples/image_editor/lib/GetImg.dart
import 'package:image_picker/image_picker.dart'; import 'dart:io'; GetiImg(_image)async{ var pickedFile=await ImagePicker().getImage(source: ImageSource.gallery); if(pickedFile!=null){ _image=File(pickedFile.path); return _image; } else{ return null; } }
0
mirrored_repositories/flutter-examples/image_editor
mirrored_repositories/flutter-examples/image_editor/lib/ApplyFilters.dart
import 'package:photofilters/photofilters.dart'; import 'package:flutter/material.dart'; import 'package:path/path.dart'; import 'package:image/image.dart' as imageLib; ApplyFilters(context,_image)async{ var image = imageLib.decodeImage(_image.readAsBytesSync()); image = imageLib.copyResize(image, width: 600); S...
0
mirrored_repositories/flutter-examples/image_editor
mirrored_repositories/flutter-examples/image_editor/lib/EditImg.dart
import 'package:flutter/material.dart'; import 'package:image_cropper/image_cropper.dart'; EditImg(_image)async{ var CroppedImg=await ImageCropper.cropImage( sourcePath: _image.path, aspectRatioPresets: [ CropAspectRatioPreset.square, CropAspectRatioPreset.ratio3x2, CropAspectRati...
0
mirrored_repositories/flutter-examples/image_editor
mirrored_repositories/flutter-examples/image_editor/lib/SaveInGallery.dart
import 'package:flutter/material.dart'; import 'package:gallery_saver/gallery_saver.dart'; import 'package:fluttertoast/fluttertoast.dart'; SaveImg(_image)async{ var result=await GallerySaver.saveImage(_image.path,albumName: 'ImageEditor').then((bool success) { success?Fluttertoast.showToast( msg: ...
0
mirrored_repositories/flutter-examples/image_editor
mirrored_repositories/flutter-examples/image_editor/lib/HomePage.dart
import 'package:flutter/material.dart'; import 'package:image_editor/ApplyFilters.dart'; import 'package:image_editor/EditImg.dart'; import 'package:image_editor/GetImg.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:image_editor/SaveInGallery.dart'; import 'dart:io'; class HomePage extends Sta...
0
mirrored_repositories/flutter-examples/image_editor
mirrored_repositories/flutter-examples/image_editor/lib/main.dart
import 'package:flutter/material.dart'; import 'package:image_editor/HomePage.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( home: HomePage() ); } }...
0
mirrored_repositories/flutter-examples/image_editor
mirrored_repositories/flutter-examples/image_editor/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/using_http_get
mirrored_repositories/flutter-examples/using_http_get/lib/main.dart
import 'package:flutter/material.dart'; import 'dart:async'; import 'package:http/http.dart' as http; import 'dart:convert'; void main() { runApp(MaterialApp( home: MyGetHttpData(), )); } // Create a stateful widget class MyGetHttpData extends StatefulWidget { @override MyGetHttpDataState createState() =>...
0
mirrored_repositories/flutter-examples/using_http_get/android
mirrored_repositories/flutter-examples/using_http_get/android/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the them...
0
mirrored_repositories/flutter-examples/using_http_get/android
mirrored_repositories/flutter-examples/using_http_get/android/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/infinite_list
mirrored_repositories/flutter-examples/infinite_list/lib/main.dart
import 'package:english_words/english_words.dart'; import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Infinite List', theme: ThemeData( primaryColor: Colo...
0
mirrored_repositories/flutter-examples/infinite_list/android
mirrored_repositories/flutter-examples/infinite_list/android/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the them...
0
mirrored_repositories/flutter-examples/infinite_list/android
mirrored_repositories/flutter-examples/infinite_list/android/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/scan_qr_code
mirrored_repositories/flutter-examples/scan_qr_code/lib/main.dart
import 'dart:async'; import 'package:flutter/material.dart'; import 'package:mobile_scanner/mobile_scanner.dart'; import 'package:scan_qr_code/utils/qr_code_scanner.dart'; import 'package:scan_qr_code/utils/scanner_box_border_painter.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { ...
0
mirrored_repositories/flutter-examples/scan_qr_code/lib
mirrored_repositories/flutter-examples/scan_qr_code/lib/utils/qr_code_scanner.dart
import 'package:flutter/material.dart'; import 'package:mobile_scanner/mobile_scanner.dart'; class QRCodeScanner extends StatelessWidget { final MobileScannerController mobileScannerController; final bool allowDuplicates; final Function(Barcode barcode, MobileScannerArguments? args) onDetect; const QRCodeScann...
0
mirrored_repositories/flutter-examples/scan_qr_code/lib
mirrored_repositories/flutter-examples/scan_qr_code/lib/utils/scanner_box_border_painter.dart
import 'package:flutter/material.dart'; class ScannerBoxBorderPainter extends CustomPainter { final Color borderColor; ScannerBoxBorderPainter({required this.borderColor}); @override void paint(Canvas canvas, Size size) { double sh = size.height; // for convenient shortage double sw = size.width; // ...
0
mirrored_repositories/flutter-examples/scan_qr_code
mirrored_repositories/flutter-examples/scan_qr_code/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility in the flutter_test package. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the...
0
mirrored_repositories/flutter-examples/lunch_app
mirrored_repositories/flutter-examples/lunch_app/lib/main.dart
import 'package:flutter/material.dart'; import 'package:lunch_app/views/prototype/food_detail_view.dart'; import 'views/prototype/home.dart'; void main() => runApp(LunchApp()); class LunchApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedMo...
0
mirrored_repositories/flutter-examples/lunch_app/lib/views
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype/food_detail_view.dart
import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:lunch_app/views/prototype/widgets/carousel_indicator.dart'; class FoodDetailView extends StatefulWidget { @override _FoodDetailViewState createState() => _FoodDetailViewState(); } class _FoodDetailViewState extends State<FoodDetailView> { ...
0
mirrored_repositories/flutter-examples/lunch_app/lib/views
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype/home.dart
import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:lunch_app/views/prototype/widgets/category_selector.dart'; import 'package:lunch_app/views/prototype/widgets/food_lister.dart'; import 'package:lunch_app/views/prototype/widgets/options_selector.dart'; import 'bottom...
0
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype/widgets/category_selector.dart
import 'package:flutter/material.dart'; import 'package:lunch_app/model/prototype/category.dart'; import 'package:lunch_app/views/prototype/widgets/main_btn.dart'; class CategorySelector extends StatefulWidget { final Function(Category) onChange; const CategorySelector({Key key, @required this.onChange}) : super(...
0
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype/widgets/options_selector.dart
import 'package:flutter/material.dart'; class OptionsSelector extends StatefulWidget { final Function(String) onChange; const OptionsSelector({Key key, @required this.onChange}) : super(key: key); @override _OptionsSelectorState createState() => _OptionsSelectorState(); } class _OptionsSelectorState extends...
0
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype/widgets/main_btn.dart
import 'package:flutter/material.dart'; class MainBtn extends StatelessWidget { final IconData icon; final String title; final bool active; final Function onTap; const MainBtn({ Key key, this.icon, this.title = "All", this.active = true, this.onTap, }) : super(key: key); @override ...
0
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype/widgets/food_lister.dart
import 'package:flutter/material.dart'; import 'package:lunch_app/views/prototype/food_detail_view.dart'; class FoodLister extends StatefulWidget { @override _FoodListerState createState() => _FoodListerState(); } class _FoodListerState extends State<FoodLister> { final PageController controller = PageCon...
0
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype/widgets/carousel_indicator.dart
import 'package:flutter/material.dart'; class CarouselIndicator extends StatelessWidget { final int length; final int selected; const CarouselIndicator( {Key key, @required this.length, @required this.selected}) : super(key: key); @override Widget build(BuildContext context) { return Contai...
0
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype
mirrored_repositories/flutter-examples/lunch_app/lib/views/prototype/bottom_nav/bottom_nav.dart
import 'package:flutter/material.dart'; class BottomNav extends StatelessWidget { @override Widget build(BuildContext context) { return Container( margin: const EdgeInsets.all(10), height: 60, width: double.infinity, decoration: BoxDecoration( color: Colors.black, border...
0
mirrored_repositories/flutter-examples/lunch_app/lib/model
mirrored_repositories/flutter-examples/lunch_app/lib/model/prototype/category.dart
import 'package:flutter/cupertino.dart'; class Category { final String title; final IconData icon; Category(this.title, this.icon); @override bool operator ==(Object other) { if (identical(this, other)) return true; return other is Category && other.title == title && other.icon == icon; } @ov...
0
mirrored_repositories/flutter-examples/using_alert_dialog
mirrored_repositories/flutter-examples/using_alert_dialog/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( home: MyHome(), )); } class MyHome extends StatefulWidget { @override MyHomeState createState() => MyHomeState(); } class MyHomeState extends State<MyHome> { // Generate dialog AlertDialog dialog = AlertDialog( content: T...
0
mirrored_repositories/flutter-examples/using_alert_dialog/android
mirrored_repositories/flutter-examples/using_alert_dialog/android/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the them...
0
mirrored_repositories/flutter-examples/using_alert_dialog/android
mirrored_repositories/flutter-examples/using_alert_dialog/android/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/getx_counter_app
mirrored_repositories/flutter-examples/getx_counter_app/lib/main.dart
import 'package:flutter/material.dart'; //import get package import 'package:get/get.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Dem...
0
mirrored_repositories/flutter-examples/getx_counter_app
mirrored_repositories/flutter-examples/getx_counter_app/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/using_custom_fonts
mirrored_repositories/flutter-examples/using_custom_fonts/lib/utils.dart
import 'package:flutter/material.dart'; TextStyle getCustomFontTextStyle() { // text style which defines a custom font return const TextStyle( // set color of text color: Colors.blueAccent, // set the font family as defined in pubspec.yaml fontFamily: 'Pacifico', // set the font weigh...
0
mirrored_repositories/flutter-examples/using_custom_fonts
mirrored_repositories/flutter-examples/using_custom_fonts/lib/main.dart
import 'package:flutter/material.dart'; import './utils.dart' as utils; void main() { runApp(MaterialApp( // Title title: "Using Custom Fonts", // Home home: Scaffold( // Appbar appBar: AppBar( // Title title: Text("Using Custom Fonts"), ), ...
0
mirrored_repositories/flutter-examples/using_custom_fonts/android
mirrored_repositories/flutter-examples/using_custom_fonts/android/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the them...
0
mirrored_repositories/flutter-examples/using_custom_fonts/android
mirrored_repositories/flutter-examples/using_custom_fonts/android/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/expense_planner
mirrored_repositories/flutter-examples/expense_planner/lib/main.dart
import 'package:flutter/material.dart'; import './widgets/new_transaction.dart'; import './widgets/transaction_list.dart'; import './widgets/chart.dart'; import './models/transaction.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { re...
0
mirrored_repositories/flutter-examples/expense_planner/lib
mirrored_repositories/flutter-examples/expense_planner/lib/widgets/user_transactions.dart
import 'package:flutter/material.dart'; import './new_transaction.dart'; import './transaction_list.dart'; import '../models/transaction.dart'; class UserTransactions extends StatefulWidget { @override _UserTransactionsState createState() => _UserTransactionsState(); } class _UserTransactionsState extends State<...
0
mirrored_repositories/flutter-examples/expense_planner/lib
mirrored_repositories/flutter-examples/expense_planner/lib/widgets/new_transaction.dart
import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; class NewTransaction extends StatefulWidget { final Function addTx; NewTransaction(this.addTx); @override _NewTransactionState createState() => _NewTransactionState(); } class _NewTransactionState extends State<NewTransaction> { fina...
0
mirrored_repositories/flutter-examples/expense_planner/lib
mirrored_repositories/flutter-examples/expense_planner/lib/widgets/transaction_list.dart
import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import '../models/transaction.dart'; class TransactionList extends StatelessWidget { final List<Transaction> transactions; final Function deleteTx; TransactionList(this.transactions, this.deleteTx); @override Widget build(BuildContex...
0
mirrored_repositories/flutter-examples/expense_planner/lib
mirrored_repositories/flutter-examples/expense_planner/lib/widgets/chart.dart
import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import './chart_bar.dart'; import '../models/transaction.dart'; class Chart extends StatelessWidget { final List<Transaction> recentTransactions; Chart(this.recentTransactions); List<Map<String, Object>> get groupedTransactionValues { ...
0
mirrored_repositories/flutter-examples/expense_planner/lib
mirrored_repositories/flutter-examples/expense_planner/lib/widgets/chart_bar.dart
import 'package:flutter/material.dart'; class ChartBar extends StatelessWidget { final String label; final double spendingAmount; final double spendingPctOfTotal; ChartBar(this.label, this.spendingAmount, this.spendingPctOfTotal); @override Widget build(BuildContext context) { return Column( ch...
0
mirrored_repositories/flutter-examples/expense_planner/lib
mirrored_repositories/flutter-examples/expense_planner/lib/models/transaction.dart
import 'package:flutter/foundation.dart'; class Transaction { final String id; final String title; final double amount; final DateTime date; Transaction({ @required this.id, @required this.title, @required this.amount, @required this.date, }); }
0
mirrored_repositories/flutter-examples/expense_planner
mirrored_repositories/flutter-examples/expense_planner/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/expense_planner/android
mirrored_repositories/flutter-examples/expense_planner/android/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the them...
0
mirrored_repositories/flutter-examples/expense_planner/android
mirrored_repositories/flutter-examples/expense_planner/android/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/using_edittext
mirrored_repositories/flutter-examples/using_edittext/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( home: MyEditText(), )); } class MyEditText extends StatefulWidget { @override MyEditTextState createState() => MyEditTextState(); } class MyEditTextState extends State<MyEditText> { String results = ""; final TextEditingContro...
0
mirrored_repositories/flutter-examples/using_edittext/android
mirrored_repositories/flutter-examples/using_edittext/android/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the them...
0
mirrored_repositories/flutter-examples/using_edittext/android
mirrored_repositories/flutter-examples/using_edittext/android/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/sliver_app_bar_example
mirrored_repositories/flutter-examples/sliver_app_bar_example/lib/main.dart
import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: Th...
0
mirrored_repositories/flutter-examples/save_data_locally_with_sqlite
mirrored_repositories/flutter-examples/save_data_locally_with_sqlite/lib/main.dart
import 'package:flutter/material.dart'; import 'package:save_data_locally_with_sqlite/screens/homescreen/homescreen.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialAp...
0
mirrored_repositories/flutter-examples/save_data_locally_with_sqlite/lib
mirrored_repositories/flutter-examples/save_data_locally_with_sqlite/lib/database/local_database.dart
import 'dart:async'; import 'dart:io'; import 'package:path/path.dart'; import 'package:path_provider/path_provider.dart'; import 'package:sqflite/sqflite.dart'; class LocalDatabase { static final _databaseName = "database.db"; static final _databaseVersion = 1; static Database? _database; LocalDatabase._pr...
0
mirrored_repositories/flutter-examples/save_data_locally_with_sqlite/lib
mirrored_repositories/flutter-examples/save_data_locally_with_sqlite/lib/database/database_queries.dart
import 'package:save_data_locally_with_sqlite/database/local_database.dart'; import 'package:sqflite/sqflite.dart'; Future<void> InsertData(String note, String datetime) async { Database? db = await LocalDatabase.instance.database; await db!.rawQuery(''' INSERT INTO data (datetime,note,timestamp) VALUES ('$date...
0
mirrored_repositories/flutter-examples/save_data_locally_with_sqlite/lib/screens
mirrored_repositories/flutter-examples/save_data_locally_with_sqlite/lib/screens/homescreen/homescreen.dart
import 'package:flutter/material.dart'; import 'package:save_data_locally_with_sqlite/database/database_queries.dart'; import 'package:save_data_locally_with_sqlite/screens/homescreen/widgets/note_container.dart'; class HomeScreen extends StatefulWidget { @override _HomeScreenState createState() => _HomeScreenStat...
0
mirrored_repositories/flutter-examples/save_data_locally_with_sqlite/lib/screens/homescreen
mirrored_repositories/flutter-examples/save_data_locally_with_sqlite/lib/screens/homescreen/widgets/note_container.dart
import 'package:flutter/material.dart'; import 'package:flutter/painting.dart'; class NoteContainer extends StatelessWidget { final String text; final String datetime; NoteContainer({Key? key, this.text = '', this.datetime = ''}) : super(key: key); @override Widget build(BuildContext context) { re...
0
mirrored_repositories/flutter-examples/save_data_locally_with_sqlite
mirrored_repositories/flutter-examples/save_data_locally_with_sqlite/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/using_snackbar
mirrored_repositories/flutter-examples/using_snackbar/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MaterialApp(home: ContactPage(), debugShowCheckedModeBanner: false,)); } class ContactPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Using SnackBar"), ...
0
mirrored_repositories/flutter-examples/using_snackbar/android
mirrored_repositories/flutter-examples/using_snackbar/android/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the them...
0
mirrored_repositories/flutter-examples/using_snackbar/android
mirrored_repositories/flutter-examples/using_snackbar/android/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/using_expansionpanel
mirrored_repositories/flutter-examples/using_expansionpanel/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Expansion Panel Demonstration App', debugShowCheckedModeBanner: false, ...
0
mirrored_repositories/flutter-examples/load_local_json
mirrored_repositories/flutter-examples/load_local_json/lib/main.dart
import 'dart:convert'; import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( home: MyApp(), )); } class MyApp extends StatefulWidget { @override MyAppState createState() => MyAppState(); } class MyAppState extends State<MyApp> { List data; @override Widget build(BuildContext c...
0
mirrored_repositories/flutter-examples/load_local_json/android
mirrored_repositories/flutter-examples/load_local_json/android/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the them...
0
mirrored_repositories/flutter-examples/load_local_json/android
mirrored_repositories/flutter-examples/load_local_json/android/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/grid_layout
mirrored_repositories/flutter-examples/grid_layout/lib/gridview.dart
import 'package:flutter/material.dart'; class MyGridView { GestureDetector getStructuredGridCell(name, image) { // Wrap the child under GestureDetector to setup a on click action return GestureDetector( onTap: () { print("onTap called."); }, child: Card( elevation: 1.5, ...
0
mirrored_repositories/flutter-examples/grid_layout
mirrored_repositories/flutter-examples/grid_layout/lib/main.dart
import 'package:flutter/material.dart'; import 'package:grid_layout/gridview.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { final MyGridView myGridView = MyGridView(); @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, ...
0
mirrored_repositories/flutter-examples/grid_layout/android
mirrored_repositories/flutter-examples/grid_layout/android/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the them...
0
mirrored_repositories/flutter-examples/grid_layout/android
mirrored_repositories/flutter-examples/grid_layout/android/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/using_platform_adaptive
mirrored_repositories/flutter-examples/using_platform_adaptive/lib/platform_adaptive.dart
import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; abstract class PlatformAdaptiveWidget extends StatelessWidget { const PlatformAdaptiveWidget({super.key, this.forcePlatform}); final TargetPlatform? forcePlatform; @override Widget build(BuildContext context) { switch (forc...
0
mirrored_repositories/flutter-examples/using_platform_adaptive
mirrored_repositories/flutter-examples/using_platform_adaptive/lib/main.dart
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:using_platform_adaptive/common_widgets/adaptive_button.dart'; import 'package:using_platform_adaptive/common_widgets/adaptive_date_picker.dart'; import 'package:using_platform_adaptive/common_widgets/adaptive_indicator.dart...
0
mirrored_repositories/flutter-examples/using_platform_adaptive/lib
mirrored_repositories/flutter-examples/using_platform_adaptive/lib/common_widgets/adaptive_indicator.dart
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:using_platform_adaptive/platform_adaptive.dart'; class AdaptiveIndicator extends PlatformAdaptiveWidget { const AdaptiveIndicator({super.forcePlatform, super.key}); @override Widget buildAndroid(BuildContext context...
0
mirrored_repositories/flutter-examples/using_platform_adaptive/lib
mirrored_repositories/flutter-examples/using_platform_adaptive/lib/common_widgets/adaptive_date_picker.dart
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:using_platform_adaptive/platform_adaptive.dart'; class AdaptiveDialog extends PlatformAdaptiveWidget { const AdaptiveDialog( {super.key, super.forcePlatform, required this.title, required this.act...
0
mirrored_repositories/flutter-examples/using_platform_adaptive/lib
mirrored_repositories/flutter-examples/using_platform_adaptive/lib/common_widgets/adaptive_button.dart
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:using_platform_adaptive/platform_adaptive.dart'; class AdaptiveButton extends PlatformAdaptiveWidget { const AdaptiveButton( {super.forcePlatform, this.color, required this.child, this.onPressed, ...
0
mirrored_repositories/flutter-examples/using_platform_adaptive
mirrored_repositories/flutter-examples/using_platform_adaptive/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility in the flutter_test package. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the...
0
mirrored_repositories/flutter-examples/stateless_widgets
mirrored_repositories/flutter-examples/stateless_widgets/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( home: MyApp(), // Define the theme, set the primary swatch theme: ThemeData(primarySwatch: Colors.green), )); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { // Declare some constan...
0
mirrored_repositories/flutter-examples/stateless_widgets
mirrored_repositories/flutter-examples/stateless_widgets/test/widget_test.dart
// This is a basic Flutter widget test. // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to // find child widgets in the widget tree, read text, and verify that the values of w...
0
mirrored_repositories/flutter-examples/stateless_widgets/android
mirrored_repositories/flutter-examples/stateless_widgets/android/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the them...
0
mirrored_repositories/flutter-examples/stateless_widgets/android
mirrored_repositories/flutter-examples/stateless_widgets/android/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/biometrics
mirrored_repositories/flutter-examples/biometrics/lib/biometrics_verifier.dart
import 'package:flutter/services.dart'; import 'package:local_auth/local_auth.dart'; class BiometricsVerifier { late LocalAuthentication auth; BiometricsVerifier() { auth = LocalAuthentication(); } Future<void> _ableToAuthenticate() async { bool supported = await auth.canCheckBiometrics; bool ent...
0
mirrored_repositories/flutter-examples/biometrics
mirrored_repositories/flutter-examples/biometrics/lib/main.dart
import 'package:biometrics/biometrics_verifier.dart'; import 'package:flutter/material.dart'; void main() => runApp(Biometrics()); class Biometrics extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Biometrics', theme: ThemeData( appBarThem...
0
mirrored_repositories/flutter-examples/using_firebase_db
mirrored_repositories/flutter-examples/using_firebase_db/lib/main.dart
import 'dart:async'; import 'package:firebase_database/firebase_database.dart'; import 'package:flutter/material.dart'; class Note { String id; String content; String createdOn; Note(content) { this.content = content; this.createdOn = DateTime.now().toString(); } } void main() => runApp(MyApp()); ...
0
mirrored_repositories/flutter-examples/using_firebase_db
mirrored_repositories/flutter-examples/using_firebase_db/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/covid19_mobile_app
mirrored_repositories/flutter-examples/covid19_mobile_app/lib/main.dart
import 'package:flutter/material.dart'; import 'screens/home.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Covid-19', theme: ThemeData( primarySwatch: Colors.blue, accentColor:...
0
mirrored_repositories/flutter-examples/covid19_mobile_app/lib
mirrored_repositories/flutter-examples/covid19_mobile_app/lib/widgets/graph.dart
import 'package:flutter/material.dart'; import 'package:bezier_chart/bezier_chart.dart'; // Widget that will build the graph Widget buildGraph( BuildContext context, List<Map<String, dynamic>> datesAndValues) { // Data is avalaible from a particular date and we are getting that here final fromDate = datesAndVa...
0
mirrored_repositories/flutter-examples/covid19_mobile_app/lib
mirrored_repositories/flutter-examples/covid19_mobile_app/lib/widgets/foldable_cell_widgets.dart
import 'package:flutter/material.dart'; import 'package:folding_cell/folding_cell.dart'; import 'package:number_display/number_display.dart'; // To display data in a width-limited component // Eg: converts 2,000,000 to 2M String updateNumberDisplay(String number) { final display = createDisplay(length: 4); // we a...
0
mirrored_repositories/flutter-examples/covid19_mobile_app/lib
mirrored_repositories/flutter-examples/covid19_mobile_app/lib/widgets/drawer.dart
import '../screens/home.dart'; import '../screens/countrylist.dart'; import 'package:flutter/material.dart'; class DrawerWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Drawer( child: ListView( // Important: Remove any padding from the ListView. padd...
0
mirrored_repositories/flutter-examples/covid19_mobile_app/lib
mirrored_repositories/flutter-examples/covid19_mobile_app/lib/widgets/info_card.dart
import 'package:flutter/material.dart'; // this is the rounded rectangle card widget that appears on the homescreen Widget infoCard(BuildContext context, String title, String number) { return Card( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text( ...
0
mirrored_repositories/flutter-examples/covid19_mobile_app/lib
mirrored_repositories/flutter-examples/covid19_mobile_app/lib/resources/fetch_data_functions.dart
import 'dart:convert'; import 'package:http/http.dart' as http; // function to fetch global Corona Virus(all countries together) // to fetch data of a particular country(in this case, India) Future getAllData() async { try { var allCountriesUrl = 'https://corona.lmao.ninja/v2/all'; var allCountriesResponse =...
0
mirrored_repositories/flutter-examples/covid19_mobile_app/lib
mirrored_repositories/flutter-examples/covid19_mobile_app/lib/screens/searchCountry.dart
import 'package:covid19_mobile_app/widgets/foldable_cell_widgets.dart'; import 'package:flutter/material.dart'; import 'package:folding_cell/folding_cell.dart'; class CountrySearchDelegate extends SearchDelegate { List<dynamic> results; CountrySearchDelegate(this.results); // to put the 'Clear Icon(X)' in the t...
0
mirrored_repositories/flutter-examples/covid19_mobile_app/lib
mirrored_repositories/flutter-examples/covid19_mobile_app/lib/screens/countrylist.dart
import 'package:covid19_mobile_app/resources/fetch_data_functions.dart'; import 'package:covid19_mobile_app/widgets/foldable_cell_widgets.dart'; import '../screens/searchCountry.dart'; import '../widgets/drawer.dart'; import 'package:flutter/material.dart'; import 'dart:convert'; import 'package:folding_cell/folding_c...
0
mirrored_repositories/flutter-examples/covid19_mobile_app/lib
mirrored_repositories/flutter-examples/covid19_mobile_app/lib/screens/home.dart
import 'dart:convert'; import 'package:covid19_mobile_app/resources/fetch_data_functions.dart'; import 'package:covid19_mobile_app/widgets/graph.dart'; import 'package:covid19_mobile_app/widgets/info_card.dart'; import '../widgets/drawer.dart'; import 'package:number_display/number_display.dart'; import 'package:flutte...
0
mirrored_repositories/flutter-examples/covid19_mobile_app
mirrored_repositories/flutter-examples/covid19_mobile_app/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/load_local_image
mirrored_repositories/flutter-examples/load_local_image/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( home: MyApp(), )); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Load local image"), ), body: Container( ...
0
mirrored_repositories/flutter-examples/load_local_image/android
mirrored_repositories/flutter-examples/load_local_image/android/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the them...
0
mirrored_repositories/flutter-examples/load_local_image/android
mirrored_repositories/flutter-examples/load_local_image/android/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the value...
0
mirrored_repositories/flutter-examples/using_listwheelscrollview
mirrored_repositories/flutter-examples/using_listwheelscrollview/lib/roundcontainer.dart
import 'package:flutter/material.dart'; class NewWidget extends StatelessWidget { final Widget l; final String s; double radius = 8; NewWidget({this.size, this.l, this.s}); final double size; @override Widget build(BuildContext context) { return AnimatedContainer( duration: Duration(millisecon...
0