import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:widget_with_codeview/widget_with_codeview.dart'; String comment = ''' flutter codeview template 1) flutter create codeview --empty 2) cd codeview 3) flutter pub add widget_with_codeview 4) edit pubspec.yaml to include flutter: uses-material-design: true assets: - lib/main.dart 5) flutter run '''; void main() {runApp(MyApp());} ////////// class MyApp class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData.dark(), home: Scaffold( body: WidgetWithCodeView( child: Home(), filePath: 'lib/main.dart', codeLinkPrefix: 'https://google.com?q=', iconBackgroundColor: Colors.white, iconForegroundColor: Colors.pink, labelBackgroundColor: Theme.of(context).canvasColor, labelTextStyle: TextStyle(color: Theme.of(context).textTheme.bodyLarge!.color), showLabelText: true)));}} ////////// class Home class Home extends StatelessWidget{ @override Widget build(BuildContext context){ return Scaffold( appBar:AppBar(title: Text('Home')), drawer: ListView(children:[ ListTile(title:Text('Screen1'),onTap:()=>Navigator.of(context).push(Screen1(1))), ListTile(title:Text('Screen2'),onTap:()=>Navigator.of(context).push(Screen2())), ListTile(title:Text('Exit'),onTap:(){SystemNavigator.pop();})]), body: Center(child: Text('goto drawer screen1 for help')));}} ////////// class Screen1 class Screen1 extends MaterialPageRoute { Screen1(int id) : super( builder: (BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Screen $id'), elevation: 1.0, ), body: Center( child: Text( ''' flutter with codeview template flutter create codeview --empty cd codeview flutter pub add widget_with_codeview edit pubspec.yaml to include flutter: uses-material-design: true assets: - lib/main.dart flutter run ''')));});} ////////// class Screen2 class Screen2 extends MaterialPageRoute { Screen2() : super( builder: (BuildContext context) { // declare your variable here // String _value = ' '; // List packet=[0,0]; // late BleController ble; // ble=Get.put(BleController()); // double height = MediaQuery.of(context).size.height; // double width = MediaQuery.of(context).size.width; return Scaffold(appBar: AppBar(title: Text('Screen2')), body: Center(child: SingleChildScrollView(child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox(height:50), ElevatedButton(child: Text('button'),onPressed:(){}), SizedBox(height:50), Text('Screen 2 text widget') ]))));});}