This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final productResults = await _odooClient.callKw({ | |
'model': 'product.template', // Selecting from 'product.template' model | |
'method': 'search_read', | |
'args': [], | |
'kwargs': { | |
'domain': [ | |
['sale_ok', '=', true], // WHERE sale_ok = true | |
['list_price', '>', 100.0], // AND list_price > 100.0 | |
'|', // OR (applies to the next two conditions) | |
['type', '=', 'product'], // type = 'product' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
await _odooClient.callKw({ | |
model: 'stock.picking', | |
'method': 'search_read', | |
'args': [], | |
'kwargs': { | |
fields: ['pick_state','id', 'name', 'partner_id', 'date', 'sale_id','invoice_number', 'app_driver'], | |
}, | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'dart:developer'; | |
import 'package:http/http.dart' as http; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
class OdooRpcClient { | |
final String baseUrl; | |
final String db; | |
String? _sessionId; // To store the session ID | |
final String _authPath = '/web/session/authenticate'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pubspec.yaml | |
// Add these dependencies: | |
// dependencies: | |
// flutter: | |
// sdk: flutter | |
// dio: ^5.4.0 # Or the latest version | |
// provider: ^6.0.5 # Or the latest version | |
// json_annotation: ^4.8.1 | |
// cached_network_image: ^3.3.1 | |
// shared_preferences: ^2.2.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter/cupertino.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class ChartData { | |
final double x; | |
final double y; | |
ChartData(this.x, this.y); | |
} | |
void main() { | |
runApp(const MyApp()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:integration_test/integration_test.dart'; | |
import 'package:your_app/main.dart'; // Update with the path to your main app file | |
void main() { | |
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | |
testWidgets('Login flow test', (WidgetTester tester) async { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
Path getClip(Size size) { | |
double radius = 50; | |
Path path = Path() | |
..lineTo(size.width - radius, 0) | |
..arcTo( | |
Rect.fromPoints( | |
Offset(size.width - radius, 0), Offset(size.width, radius)), // Rect |
NewerOlder